FIX: Nokogiri bugs in certain environments

This commit is contained in:
Robin Ward 2013-10-16 12:19:20 -04:00
parent c7aaee907b
commit 15cad17810
2 changed files with 7 additions and 5 deletions

View file

@ -246,6 +246,7 @@ GEM
metaclass (0.0.1) metaclass (0.0.1)
method_source (0.8.1) method_source (0.8.1)
mime-types (1.23) mime-types (1.23)
mini_portile (0.5.1)
minitest (4.7.3) minitest (4.7.3)
mocha (0.13.3) mocha (0.13.3)
metaclass (~> 0.0.1) metaclass (~> 0.0.1)
@ -256,7 +257,8 @@ GEM
net-scp (1.1.2) net-scp (1.1.2)
net-ssh (>= 2.6.5) net-ssh (>= 2.6.5)
net-ssh (2.6.8) net-ssh (2.6.8)
nokogiri (1.5.9) nokogiri (1.6.0)
mini_portile (~> 0.5.0)
oauth (0.4.7) oauth (0.4.7)
oauth2 (0.8.1) oauth2 (0.8.1)
faraday (~> 0.8) faraday (~> 0.8)
@ -390,8 +392,8 @@ GEM
rspec-mocks (~> 2.13.0) rspec-mocks (~> 2.13.0)
ruby-hmac (0.4.0) ruby-hmac (0.4.0)
ruby-openid (2.2.3) ruby-openid (2.2.3)
sanitize (2.0.3) sanitize (2.0.6)
nokogiri (>= 1.4.4, < 1.6) nokogiri (>= 1.4.4)
sass (3.2.8) sass (3.2.8)
sass-rails (3.2.6) sass-rails (3.2.6)
railties (~> 3.2.0) railties (~> 3.2.0)

View file

@ -95,8 +95,8 @@ class PostAnalyzer
# Don't include @mentions in the link count # Don't include @mentions in the link count
@raw_links = [] @raw_links = []
cooked_document.search("a[href]").each do |l| cooked_document.search("a").each do |l|
next if link_is_a_mention?(l) next if l.attributes['href'].nil? || link_is_a_mention?(l)
url = l.attributes['href'].to_s url = l.attributes['href'].to_s
@raw_links << url @raw_links << url
end end