earl 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +4 -15
- data/.rspec +1 -0
- data/.travis.yml +11 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +60 -0
- data/Guardfile +10 -0
- data/LICENSE +2 -4
- data/README.rdoc +145 -0
- data/Rakefile +35 -2
- data/earl.gemspec +13 -7
- data/lib/earl.rb +7 -22
- data/lib/earl/earl.rb +158 -0
- data/lib/earl/scraper.rb +93 -0
- data/lib/earl/version.rb +2 -2
- data/script/console +10 -0
- data/spec/fixtures/bicycles.html +490 -0
- data/spec/fixtures/bicycles_without_description.html +489 -0
- data/spec/fixtures/bicycles_without_images.html +457 -0
- data/spec/fixtures/page_as_atom.html +161 -0
- data/spec/fixtures/page_as_rss.html +151 -0
- data/spec/fixtures/page_with_atom_feed.html +39 -0
- data/spec/fixtures/page_with_rss_and_atom_feeds.html +40 -0
- data/spec/fixtures/page_with_rss_feed.html +39 -0
- data/spec/fixtures/page_without_feeds.html +36 -0
- data/spec/fixtures/youtube.html +1839 -0
- data/spec/integration/feed_spec.rb +78 -0
- data/spec/integration/oembed_spec.rb +40 -0
- data/spec/spec_helper.rb +18 -28
- data/spec/support/fixtures.rb +10 -0
- data/spec/unit/earl/earl_spec.rb +16 -0
- data/spec/unit/earl/feed_spec.rb +59 -0
- data/spec/unit/earl/oembed_spec.rb +49 -0
- data/spec/unit/earl/scraper_spec.rb +48 -0
- data/spec/unit/earl_spec.rb +65 -0
- metadata +123 -46
- data/.rvmrc +0 -48
- data/README.md +0 -41
- data/lib/earl/email_assembler.rb +0 -11
- data/lib/earl/email_entity.rb +0 -27
- data/lib/earl/email_parser.tt +0 -58
- data/lib/earl/entity_base.rb +0 -37
- data/lib/earl/hash_inquirer.rb +0 -16
- data/lib/earl/string_inquirer.rb +0 -11
- data/lib/earl/url_assembler.rb +0 -15
- data/lib/earl/url_entity.rb +0 -23
- data/lib/earl/url_parser.tt +0 -163
- data/spec/earl/earl_spec.rb +0 -17
- data/spec/earl/email_entity_spec.rb +0 -31
- data/spec/earl/email_parser_spec.rb +0 -29
- data/spec/earl/entity_base_spec.rb +0 -39
- data/spec/earl/hash_inquirer_spec.rb +0 -24
- data/spec/earl/string_inquirer_spec.rb +0 -9
- data/spec/earl/url_entity_spec.rb +0 -45
- data/spec/earl/url_parser_spec.rb +0 -189
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# These tests hit real network endpoints - not included in the default test runs. Run with:
|
4
|
+
# rake spec:integration
|
5
|
+
# or
|
6
|
+
# rake spec:all
|
7
|
+
#
|
8
|
+
describe Earl do
|
9
|
+
let(:instance) { Earl[url] }
|
10
|
+
|
11
|
+
subject { instance }
|
12
|
+
|
13
|
+
context "when page has no feeds associated" do
|
14
|
+
let(:url) { 'http://google.com/' }
|
15
|
+
its(:has_feed?) { should be_false }
|
16
|
+
its(:rss_feed) { should be_nil }
|
17
|
+
its(:feed) { should be_nil }
|
18
|
+
end
|
19
|
+
|
20
|
+
context "when page has rss feed associated" do
|
21
|
+
let(:url) { 'http://www.readwriteweb.com/' }
|
22
|
+
its(:has_feed?) { should be_true }
|
23
|
+
its(:rss_feed) { should eql('http://www.readwriteweb.com/rss.xml') }
|
24
|
+
its(:feed) { should eql('http://www.readwriteweb.com/rss.xml') }
|
25
|
+
end
|
26
|
+
|
27
|
+
# context "when page has atom feed associated" do
|
28
|
+
# let(:url) { 'http:// still looking for a page that just has atom' }
|
29
|
+
# its(:has_feed?) { should be_true }
|
30
|
+
# its(:atom_feed) { should eql('http://www.readwriteweb.com/atom.xml') }
|
31
|
+
# its(:feed) { should eql('http://www.readwriteweb.com/atom.xml') }
|
32
|
+
# end
|
33
|
+
|
34
|
+
context "when page has rss and atom feed associated" do
|
35
|
+
let(:url) { 'http://tardate.blogspot.com' }
|
36
|
+
let(:expected_rss_feed) { 'http://tardate.blogspot.com/feeds/posts/default?alt=rss' }
|
37
|
+
let(:expected_atom_feed) { 'http://tardate.blogspot.com/feeds/posts/default' }
|
38
|
+
|
39
|
+
its(:has_feed?) { should be_true }
|
40
|
+
its(:rss_feed) { should eql(expected_rss_feed) }
|
41
|
+
its(:atom_feed) { should eql(expected_atom_feed) }
|
42
|
+
describe "#feed" do
|
43
|
+
context "default (rss)" do
|
44
|
+
subject { instance.feed }
|
45
|
+
it { should eql(expected_rss_feed) }
|
46
|
+
end
|
47
|
+
context "rss prefered" do
|
48
|
+
subject { instance.feed(:rss) }
|
49
|
+
it { should eql(expected_rss_feed) }
|
50
|
+
end
|
51
|
+
context "atom prefered" do
|
52
|
+
subject { instance.feed(:atom) }
|
53
|
+
it { should eql(expected_atom_feed) }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context "when page IS an rss feed" do
|
59
|
+
let(:url) { 'http://www.readwriteweb.com/rss.xml' }
|
60
|
+
its(:url) { should eql(url) }
|
61
|
+
its(:base_url) { should eql('http://feeds.feedburner.com/readwriteweb') }
|
62
|
+
its(:content_type) { should eql('text/xml') }
|
63
|
+
its(:has_feed?) { should be_true }
|
64
|
+
its(:rss_feed) { should eql(url) }
|
65
|
+
its(:feed) { should eql(url) }
|
66
|
+
end
|
67
|
+
|
68
|
+
context "when page IS an atom feed" do
|
69
|
+
let(:url) { 'http://tardate.blogspot.com/feeds/posts/default' }
|
70
|
+
its(:url) { should eql(url) }
|
71
|
+
its(:base_url) { should eql('http://feeds.feedburner.com/tardate') }
|
72
|
+
its(:content_type) { should eql('text/xml') }
|
73
|
+
its(:has_feed?) { should be_true }
|
74
|
+
its(:atom_feed) { should eql(url) }
|
75
|
+
its(:feed) { should eql(url) }
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# These tests hit real network endpoints - not included in the default test runs. Run with:
|
4
|
+
# rake spec:integration
|
5
|
+
# or
|
6
|
+
# rake spec:all
|
7
|
+
#
|
8
|
+
describe Earl do
|
9
|
+
let(:instance) { Earl[url] }
|
10
|
+
|
11
|
+
subject { instance }
|
12
|
+
|
13
|
+
context "when page does not support oembed" do
|
14
|
+
let(:url) { 'http://google.com/' }
|
15
|
+
its(:oembed) { should be_nil }
|
16
|
+
its(:oembed_html) { should be_nil }
|
17
|
+
describe "#metadata" do
|
18
|
+
subject { instance.metadata }
|
19
|
+
it { subject[:base_url].should match(/google/) }
|
20
|
+
it { subject[:content_type].should eql("text/html") }
|
21
|
+
it { subject[:html].should be_nil }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context "when page supports oembed" do
|
26
|
+
let(:url) { 'http://www.youtube.com/watch?v=g3DCEcSlfhw' }
|
27
|
+
let(:expected_oembed_html) { %(<iframe width="420" height="315" src="http://www.youtube.com/embed/g3DCEcSlfhw?fs=1&feature=oembed" frameborder="0" allowfullscreen></iframe>) }
|
28
|
+
|
29
|
+
its(:oembed) { should be_a(Hash) }
|
30
|
+
its(:oembed_html) { should eql(expected_oembed_html) }
|
31
|
+
describe "#metadata" do
|
32
|
+
subject { instance.metadata }
|
33
|
+
it { subject[:base_url].should eql("http://www.youtube.com/watch?v=g3DCEcSlfhw") }
|
34
|
+
it { subject[:content_type].should eql("text/html") }
|
35
|
+
it { subject[:title].should eql("'Virtuosos of Guitar 2008' festival, Moscow. Marcin Dylla") }
|
36
|
+
it { subject[:html].should eql(expected_oembed_html) }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,34 +1,24 @@
|
|
1
1
|
require 'earl'
|
2
2
|
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
config.color_enabled = true
|
7
|
-
# Change the formatter
|
8
|
-
config.formatter = :documentation
|
9
|
-
end
|
10
|
-
|
11
|
-
# Custom entity manipulation matcher
|
12
|
-
RSpec::Matchers.define :produce do |expected|
|
3
|
+
# Requires supporting files with custom matchers and macros, etc,
|
4
|
+
# in ./support/ and its subdirectories.
|
5
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
13
6
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
failure_message_for_should do |entity|
|
24
|
-
%Q{expected that "#{@start}" would become "#{expected}" when given #{@changes}, but was "#{@actual}"}
|
25
|
-
end
|
7
|
+
RSpec.configure do |config|
|
8
|
+
# == Mock Framework
|
9
|
+
#
|
10
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
11
|
+
#
|
12
|
+
# config.mock_with :mocha
|
13
|
+
# config.mock_with :flexmock
|
14
|
+
# config.mock_with :rr
|
15
|
+
config.mock_with :rspec
|
26
16
|
|
27
|
-
|
28
|
-
|
29
|
-
end
|
17
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
18
|
+
# config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
30
19
|
|
31
|
-
|
32
|
-
|
33
|
-
|
20
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
21
|
+
# examples within a transaction, remove the following line or assign false
|
22
|
+
# instead of true.
|
23
|
+
# config.use_transactional_fixtures = true
|
34
24
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Earl do
|
4
|
+
|
5
|
+
|
6
|
+
describe '##new' do
|
7
|
+
subject { Earl.new('http://test.host/') }
|
8
|
+
its(:to_s) { should eql('http://test.host/') }
|
9
|
+
end
|
10
|
+
|
11
|
+
describe '[]=' do
|
12
|
+
subject { Earl['http://test.host/'] }
|
13
|
+
its(:to_s) { should eql('http://test.host/') }
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Earl do
|
4
|
+
let(:instance) { Earl[url] }
|
5
|
+
let(:url) { 'http:://example.com' }
|
6
|
+
|
7
|
+
before { Earl.any_instance.stub(:uri).and_return(source) }
|
8
|
+
subject { instance }
|
9
|
+
|
10
|
+
context "when page has no feeds associated" do
|
11
|
+
let(:source) { fixture(:page_without_feeds) }
|
12
|
+
its(:has_feed?) { should be_false }
|
13
|
+
its(:rss_feed) { should be_nil }
|
14
|
+
its(:feed) { should be_nil }
|
15
|
+
end
|
16
|
+
|
17
|
+
context "when page has rss feed associated" do
|
18
|
+
let(:source) { fixture(:page_with_rss_feed) }
|
19
|
+
its(:has_feed?) { should be_true }
|
20
|
+
its(:rss_feed) { should eql('http://www.readwriteweb.com/rss.xml') }
|
21
|
+
its(:feed) { should eql('http://www.readwriteweb.com/rss.xml') }
|
22
|
+
end
|
23
|
+
|
24
|
+
context "when page has atom feed associated" do
|
25
|
+
let(:source) { fixture(:page_with_atom_feed) }
|
26
|
+
its(:has_feed?) { should be_true }
|
27
|
+
its(:atom_feed) { should eql('http://www.readwriteweb.com/atom.xml') }
|
28
|
+
its(:feed) { should eql('http://www.readwriteweb.com/atom.xml') }
|
29
|
+
end
|
30
|
+
|
31
|
+
context "when page has rss and atom feed associated" do
|
32
|
+
let(:source) { fixture(:page_with_rss_and_atom_feeds) }
|
33
|
+
its(:has_feed?) { should be_true }
|
34
|
+
its(:rss_feed) { should eql('http://www.readwriteweb.com/rss.xml') }
|
35
|
+
its(:atom_feed) { should eql('http://www.readwriteweb.com/atom.xml') }
|
36
|
+
describe "#feed" do
|
37
|
+
context "default (rss)" do
|
38
|
+
subject { instance.feed }
|
39
|
+
it { should eql('http://www.readwriteweb.com/rss.xml') }
|
40
|
+
end
|
41
|
+
context "rss prefered" do
|
42
|
+
subject { instance.feed(:rss) }
|
43
|
+
it { should eql('http://www.readwriteweb.com/rss.xml') }
|
44
|
+
end
|
45
|
+
context "atom prefered" do
|
46
|
+
subject { instance.feed(:atom) }
|
47
|
+
it { should eql('http://www.readwriteweb.com/atom.xml') }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# context "when page IS an rss feed" do
|
53
|
+
# let(:source) { fixture(:page_as_rss) }
|
54
|
+
# its(:has_feed?) { should be_true }
|
55
|
+
# its(:rss_feed) { should eql(url) }
|
56
|
+
# its(:feed) { should eql(url) }
|
57
|
+
# end
|
58
|
+
|
59
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class MockOembedResponse
|
4
|
+
def body
|
5
|
+
{ 'html' => '<iframe/>' }
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
describe Earl do
|
10
|
+
let(:instance) { Earl.new(url,options) }
|
11
|
+
let(:url) { 'http:://example.com' }
|
12
|
+
let(:options) { {} }
|
13
|
+
|
14
|
+
describe "#oembed_options" do
|
15
|
+
subject { instance.oembed_options }
|
16
|
+
context "with default options" do
|
17
|
+
let(:expected) { { :maxwidth => "560", :maxheight => "315" } }
|
18
|
+
it { should eql(expected) }
|
19
|
+
end
|
20
|
+
context "with custom options" do
|
21
|
+
let(:options) { { :oembed => { :maxwidth => "260" } } }
|
22
|
+
let(:expected) { { :maxwidth => "260", :maxheight => "315" } }
|
23
|
+
it { should eql(expected) }
|
24
|
+
end
|
25
|
+
context "with custom options passed to oembed" do
|
26
|
+
let(:expected) { { :maxwidth => "360", :maxheight => "315" } }
|
27
|
+
before do
|
28
|
+
Oembedr.stub(:fetch).and_return(nil)
|
29
|
+
instance.oembed({ :maxwidth => "360" })
|
30
|
+
end
|
31
|
+
it { should eql(expected) }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "#oembed" do
|
36
|
+
let(:dummy_response) { MockOembedResponse.new }
|
37
|
+
before do
|
38
|
+
instance.stub(:base_url).and_return('')
|
39
|
+
Oembedr.stub(:fetch).and_return(dummy_response)
|
40
|
+
end
|
41
|
+
subject { instance.oembed }
|
42
|
+
it { should eql({ :html => '<iframe/>' }) }
|
43
|
+
describe "#oembed_html" do
|
44
|
+
subject { instance.oembed_html }
|
45
|
+
it { should eql('<iframe/>') }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Earl::Scraper do
|
4
|
+
|
5
|
+
before :each do
|
6
|
+
Earl.any_instance.stub(:uri_response).and_return(<<-DOC
|
7
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
8
|
+
<html></html>
|
9
|
+
DOC
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'When validating URLs' do
|
14
|
+
before :each do
|
15
|
+
class Earl::TestScraper < Earl::Scraper
|
16
|
+
match /^http\:\/\/www\.test\.com\/$/
|
17
|
+
define_attribute(:title) {|response| :test_title }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should return the result if the URL matches the scraper regexp' do
|
22
|
+
Earl['http://www.test.com/'].title.should == :test_title
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe 'When retrieving the response' do
|
27
|
+
it 'should return a Nokogiri document' do
|
28
|
+
Earl['test'].response.css('html').size.should == 1
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe 'Scraper inheritance' do
|
33
|
+
class SubScraper < Earl::Scraper
|
34
|
+
define_attribute :some_attribute do |doc|
|
35
|
+
doc
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'inherits all attributes from its superclass' do
|
40
|
+
scraper = SubScraper.new('foo.bar')
|
41
|
+
scraper.attributes.should include(:title)
|
42
|
+
scraper.attributes.should include(:description)
|
43
|
+
scraper.attributes.should include(:image)
|
44
|
+
scraper.attributes.should include(:some_attribute)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Earl do
|
4
|
+
|
5
|
+
before { Earl.any_instance.stub(:uri).and_return(source) }
|
6
|
+
let(:url) { 'http://mock.net' }
|
7
|
+
let(:instance) { Earl[url] }
|
8
|
+
subject { instance }
|
9
|
+
|
10
|
+
describe '#title' do
|
11
|
+
context "example with title tag" do
|
12
|
+
let(:source) { fixture(:bicycles) }
|
13
|
+
its(:title) { should eql('bicycles (bicycles) on Twitter') }
|
14
|
+
end
|
15
|
+
context "youtube example with title tag" do
|
16
|
+
let(:source) { fixture(:youtube) }
|
17
|
+
its(:title) { should eql('YouTube - Symptoms of Swine Flu') }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe '#description' do
|
22
|
+
context "example with description tag" do
|
23
|
+
let(:source) { fixture(:bicycles) }
|
24
|
+
its(:description) { should eql('I write business plans for a living and fiction to stay sane. I also try my hand at all sorts of creative side projects: painting, game dev, whiskey drinking..') }
|
25
|
+
end
|
26
|
+
context "example without description tag" do
|
27
|
+
let(:source) { fixture(:bicycles_without_description) }
|
28
|
+
its(:description) { should be_nil }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe '#image' do
|
33
|
+
context "example with image tag" do
|
34
|
+
let(:source) { fixture(:bicycles) }
|
35
|
+
its(:image) { should eql('http://assets0.twitter.com/images/loader.gif') }
|
36
|
+
end
|
37
|
+
context "example without image tag" do
|
38
|
+
let(:source) { fixture(:bicycles_without_images) }
|
39
|
+
its(:image) { should be_nil }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe '#attributes' do
|
44
|
+
let(:source) { fixture(:bicycles) }
|
45
|
+
its(:attributes) { should be_an(Array) }
|
46
|
+
[ :description, :title, :image ].each do |attribute|
|
47
|
+
its(:attributes) { should include(attribute) }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe '#metadata' do
|
52
|
+
let(:source) { fixture(:bicycles) }
|
53
|
+
its(:metadata) { should be_a(Hash) }
|
54
|
+
its(:metadata) { should eql({
|
55
|
+
:title => 'bicycles (bicycles) on Twitter',
|
56
|
+
:description => 'I write business plans for a living and fiction to stay sane. I also try my hand at all sorts of creative side projects: painting, game dev, whiskey drinking..',
|
57
|
+
:image => 'http://assets0.twitter.com/images/loader.gif',
|
58
|
+
:rss_feed => "/statuses/user_timeline/user_id.rss",
|
59
|
+
:base_url => "http://mock.net",
|
60
|
+
:feed => "/statuses/user_timeline/user_id.rss"
|
61
|
+
}) }
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
metadata
CHANGED
@@ -1,83 +1,149 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: earl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
|
-
-
|
8
|
+
- teejayvanslyke
|
9
|
+
- Paul Gallagher
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2012-
|
13
|
+
date: 2012-10-16 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
name: nokogiri
|
17
|
+
requirement: &70141387965520 !ruby/object:Gem::Requirement
|
17
18
|
none: false
|
18
19
|
requirements:
|
19
20
|
- - ! '>='
|
20
21
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.4.
|
22
|
+
version: 1.4.4
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
+
version_requirements: *70141387965520
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: oembedr
|
28
|
+
requirement: &70141387964980 !ruby/object:Gem::Requirement
|
25
29
|
none: false
|
26
30
|
requirements:
|
27
31
|
- - ! '>='
|
28
32
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.
|
33
|
+
version: 1.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *70141387964980
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: bundler
|
39
|
+
requirement: &70141387964420 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>'
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.1.0
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *70141387964420
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rake
|
50
|
+
requirement: &70141387963920 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.9.2.2
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *70141387963920
|
30
59
|
- !ruby/object:Gem::Dependency
|
31
60
|
name: rspec
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
61
|
+
requirement: &70141387963380 !ruby/object:Gem::Requirement
|
33
62
|
none: false
|
34
63
|
requirements:
|
35
|
-
- -
|
64
|
+
- - ~>
|
36
65
|
- !ruby/object:Gem::Version
|
37
|
-
version: 2.
|
66
|
+
version: 2.8.0
|
38
67
|
type: :development
|
39
68
|
prerelease: false
|
40
|
-
version_requirements:
|
69
|
+
version_requirements: *70141387963380
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rdoc
|
72
|
+
requirement: &70141387962880 !ruby/object:Gem::Requirement
|
41
73
|
none: false
|
42
74
|
requirements:
|
43
|
-
- -
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '3.11'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *70141387962880
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: guard-rspec
|
83
|
+
requirement: &70141387962240 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
44
87
|
- !ruby/object:Gem::Version
|
45
|
-
version: 2.
|
46
|
-
|
88
|
+
version: 1.2.0
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: *70141387962240
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: rb-fsevent
|
94
|
+
requirement: &70141387961480 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ~>
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 0.9.1
|
100
|
+
type: :development
|
101
|
+
prerelease: false
|
102
|
+
version_requirements: *70141387961480
|
103
|
+
description: URL metadata API
|
47
104
|
email:
|
48
|
-
-
|
105
|
+
- tj@elctech.com
|
106
|
+
- gallagher.paul@gmail.com
|
49
107
|
executables: []
|
50
108
|
extensions: []
|
51
109
|
extra_rdoc_files: []
|
52
110
|
files:
|
111
|
+
- .document
|
53
112
|
- .gitignore
|
54
|
-
- .
|
113
|
+
- .rspec
|
114
|
+
- .travis.yml
|
55
115
|
- Gemfile
|
116
|
+
- Gemfile.lock
|
117
|
+
- Guardfile
|
56
118
|
- LICENSE
|
57
|
-
- README.
|
119
|
+
- README.rdoc
|
58
120
|
- Rakefile
|
59
121
|
- earl.gemspec
|
60
122
|
- lib/earl.rb
|
61
|
-
- lib/earl/
|
62
|
-
- lib/earl/
|
63
|
-
- lib/earl/email_parser.tt
|
64
|
-
- lib/earl/entity_base.rb
|
65
|
-
- lib/earl/hash_inquirer.rb
|
66
|
-
- lib/earl/string_inquirer.rb
|
67
|
-
- lib/earl/url_assembler.rb
|
68
|
-
- lib/earl/url_entity.rb
|
69
|
-
- lib/earl/url_parser.tt
|
123
|
+
- lib/earl/earl.rb
|
124
|
+
- lib/earl/scraper.rb
|
70
125
|
- lib/earl/version.rb
|
71
|
-
-
|
72
|
-
- spec/
|
73
|
-
- spec/
|
74
|
-
- spec/
|
75
|
-
- spec/
|
76
|
-
- spec/
|
77
|
-
- spec/
|
78
|
-
- spec/
|
126
|
+
- script/console
|
127
|
+
- spec/fixtures/bicycles.html
|
128
|
+
- spec/fixtures/bicycles_without_description.html
|
129
|
+
- spec/fixtures/bicycles_without_images.html
|
130
|
+
- spec/fixtures/page_as_atom.html
|
131
|
+
- spec/fixtures/page_as_rss.html
|
132
|
+
- spec/fixtures/page_with_atom_feed.html
|
133
|
+
- spec/fixtures/page_with_rss_and_atom_feeds.html
|
134
|
+
- spec/fixtures/page_with_rss_feed.html
|
135
|
+
- spec/fixtures/page_without_feeds.html
|
136
|
+
- spec/fixtures/youtube.html
|
137
|
+
- spec/integration/feed_spec.rb
|
138
|
+
- spec/integration/oembed_spec.rb
|
79
139
|
- spec/spec_helper.rb
|
80
|
-
|
140
|
+
- spec/support/fixtures.rb
|
141
|
+
- spec/unit/earl/earl_spec.rb
|
142
|
+
- spec/unit/earl/feed_spec.rb
|
143
|
+
- spec/unit/earl/oembed_spec.rb
|
144
|
+
- spec/unit/earl/scraper_spec.rb
|
145
|
+
- spec/unit/earl_spec.rb
|
146
|
+
homepage: https://github.com/evendis/earl
|
81
147
|
licenses: []
|
82
148
|
post_install_message:
|
83
149
|
rdoc_options: []
|
@@ -97,17 +163,28 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
163
|
version: '0'
|
98
164
|
requirements: []
|
99
165
|
rubyforge_project:
|
100
|
-
rubygems_version: 1.8.
|
166
|
+
rubygems_version: 1.8.15
|
101
167
|
signing_key:
|
102
168
|
specification_version: 3
|
103
|
-
summary:
|
169
|
+
summary: URL metadata API for scraping titles, descriptions, images, and videos from
|
170
|
+
URL's
|
104
171
|
test_files:
|
105
|
-
- spec/
|
106
|
-
- spec/
|
107
|
-
- spec/
|
108
|
-
- spec/
|
109
|
-
- spec/
|
110
|
-
- spec/
|
111
|
-
- spec/
|
112
|
-
- spec/
|
172
|
+
- spec/fixtures/bicycles.html
|
173
|
+
- spec/fixtures/bicycles_without_description.html
|
174
|
+
- spec/fixtures/bicycles_without_images.html
|
175
|
+
- spec/fixtures/page_as_atom.html
|
176
|
+
- spec/fixtures/page_as_rss.html
|
177
|
+
- spec/fixtures/page_with_atom_feed.html
|
178
|
+
- spec/fixtures/page_with_rss_and_atom_feeds.html
|
179
|
+
- spec/fixtures/page_with_rss_feed.html
|
180
|
+
- spec/fixtures/page_without_feeds.html
|
181
|
+
- spec/fixtures/youtube.html
|
182
|
+
- spec/integration/feed_spec.rb
|
183
|
+
- spec/integration/oembed_spec.rb
|
113
184
|
- spec/spec_helper.rb
|
185
|
+
- spec/support/fixtures.rb
|
186
|
+
- spec/unit/earl/earl_spec.rb
|
187
|
+
- spec/unit/earl/feed_spec.rb
|
188
|
+
- spec/unit/earl/oembed_spec.rb
|
189
|
+
- spec/unit/earl/scraper_spec.rb
|
190
|
+
- spec/unit/earl_spec.rb
|