ruby-readability 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +1 -1
- data/lib/readability.rb +2 -0
- data/ruby-readability.gemspec +1 -1
- metadata +4 -22
data/README.markdown
CHANGED
|
@@ -56,7 +56,7 @@ You can get a list of images in the content area with `.images`. This feature r
|
|
|
56
56
|
|
|
57
57
|
## Potential Issues
|
|
58
58
|
|
|
59
|
-
If you're on a Mac and are getting segmentation faults, see the discussion at https://github.com/
|
|
59
|
+
If you're on a Mac and are getting segmentation faults, see the discussion at https://github.com/sparklemotion/nokogiri/issues/404 and consider updating your version of libxml2. Version 2.7.8 of libxml2, installed with `brew`, worked for me:
|
|
60
60
|
|
|
61
61
|
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
|
|
62
62
|
|
data/lib/readability.rb
CHANGED
|
@@ -71,6 +71,8 @@ module Readability
|
|
|
71
71
|
elements = content.css("img").map(&:attributes)
|
|
72
72
|
|
|
73
73
|
elements.each do |element|
|
|
74
|
+
next unless element["src"]
|
|
75
|
+
|
|
74
76
|
url = element["src"].value
|
|
75
77
|
height = element["height"].nil? ? 0 : element["height"].value.to_i
|
|
76
78
|
width = element["width"].nil? ? 0 : element["width"].value.to_i
|
data/ruby-readability.gemspec
CHANGED
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "ruby-readability"
|
|
6
|
-
s.version = '0.5.
|
|
6
|
+
s.version = '0.5.4'
|
|
7
7
|
s.authors = ["Andrew Cantino", "starrhorne", "libc", "Kyle Maxwell"]
|
|
8
8
|
s.email = ["andrew@iterationlabs.com"]
|
|
9
9
|
s.homepage = "http://github.com/iterationlabs/ruby-readability"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-readability
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.4
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -12,7 +12,7 @@ authors:
|
|
|
12
12
|
autorequire:
|
|
13
13
|
bindir: bin
|
|
14
14
|
cert_chain: []
|
|
15
|
-
date: 2012-
|
|
15
|
+
date: 2012-07-27 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: rspec
|
|
@@ -150,26 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
150
150
|
version: '0'
|
|
151
151
|
requirements: []
|
|
152
152
|
rubyforge_project: ruby-readability
|
|
153
|
-
rubygems_version: 1.8.
|
|
153
|
+
rubygems_version: 1.8.19
|
|
154
154
|
signing_key:
|
|
155
155
|
specification_version: 3
|
|
156
156
|
summary: Port of arc90's readability project to ruby
|
|
157
|
-
test_files:
|
|
158
|
-
- spec/fixtures/bbc.html
|
|
159
|
-
- spec/fixtures/cant_read.html
|
|
160
|
-
- spec/fixtures/images/dim_1416768a.jpg
|
|
161
|
-
- spec/fixtures/nytimes.html
|
|
162
|
-
- spec/fixtures/sample.html
|
|
163
|
-
- spec/fixtures/samples/blogpost_with_links-fragments.rb
|
|
164
|
-
- spec/fixtures/samples/blogpost_with_links.html
|
|
165
|
-
- spec/fixtures/samples/channel4-1-fragments.rb
|
|
166
|
-
- spec/fixtures/samples/channel4-1.html
|
|
167
|
-
- spec/fixtures/samples/foxnews-india1-fragments.rb
|
|
168
|
-
- spec/fixtures/samples/foxnews-india1.html
|
|
169
|
-
- spec/fixtures/samples/globemail-ottawa-cuts-fragments.rb
|
|
170
|
-
- spec/fixtures/samples/globemail-ottawa-cuts.html
|
|
171
|
-
- spec/fixtures/should_not_truncate.txt
|
|
172
|
-
- spec/fixtures/thesun.html
|
|
173
|
-
- spec/readability_spec.rb
|
|
174
|
-
- spec/spec.opts
|
|
175
|
-
- spec/spec_helper.rb
|
|
157
|
+
test_files: []
|