metainspector 5.4.1 → 5.4.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef70ce77a81fb9913d7efc9638cb9b40ae39a6d3
4
- data.tar.gz: 302ab1f5c39cb2c3357fa2b365b589900a8e01b2
3
+ metadata.gz: bc1180957b70b2fddea3607fcbcd0cf9c6be46fe
4
+ data.tar.gz: 433b5a354c38e0c5dc75b7698e0310b19de4f7bb
5
5
  SHA512:
6
- metadata.gz: cdc124fe224875ca944a760398e101668d251afa20842100d29982ae643bddfb8d41105472f27c086ff35b9c80dab0813984085aa232a7fba440bf9e6119a37f
7
- data.tar.gz: de826dff76e3f05b081f6c732f5f893936f094def30169f0df9386f5c87b160b80e787ba22895e3f7e92bdca9595e0bae63d6de10dc60c5cfe5168aa87b2c9b8
6
+ metadata.gz: 9c0373ba9ad2b88be80ae08b8f5f4eb5e2c64fb01497a3c7f6934c42ea077c33f84051d94ded182c00326cd234e4587de3d7f932483540f4368256539846fca0
7
+ data.tar.gz: 60bae22abc575ef14bb5291f7c9eccd94b8f1f6db63bfb5d617d6f557eed6554a3f175587aad0dbfcbb8ef7e1102e4732b8e81431e6ed9d6ba26c735a6cc1eb9
@@ -1,5 +1,6 @@
1
+ script: "bundle exec rspec -b"
1
2
  rvm:
2
- - 2.1.8
3
- - 2.2.4
4
- - 2.3.1
5
- - 2.4.0
3
+ - 2.2.9
4
+ - 2.3.6
5
+ - 2.4.3
6
+ - 2.5.0
data/README.md CHANGED
@@ -22,8 +22,6 @@ If you're using it on a Rails application, just add it to your Gemfile and run `
22
22
  gem 'metainspector'
23
23
  ```
24
24
 
25
- This gem is tested on Ruby versions 2.0.0, 2.1.8 and 2.2.4.
26
-
27
25
  ## Usage
28
26
 
29
27
  Initialize a MetaInspector instance for an URL, like this:
@@ -438,7 +436,7 @@ You can also come to chat with us on our [Gitter room](https://gitter.im/jaimein
438
436
  * [go-metainspector](https://github.com/fern4lvarez/go-metainspector), a port of MetaInspector for Go.
439
437
  * [Node-MetaInspector](https://github.com/gabceb/node-metainspector), a port of MetaInspector for Node.
440
438
  * [MetaInvestigator](https://github.com/nekova/metainvestigator), a port of MetaInspector for Elixir.
441
- * [Funkspector] (https://github.com/jaimeiniesta/funkspector), another port of MetaInspector for Elixir.
439
+ * [Funkspector](https://github.com/jaimeiniesta/funkspector), another port of MetaInspector for Elixir.
442
440
 
443
441
  ## License
444
442
  MetaInspector is released under the [MIT license](MIT-LICENSE).
@@ -42,7 +42,7 @@ class BrokenLinkChecker
42
42
  def process_next_on_queue
43
43
  page = MetaInspector.new(@queue.pop)
44
44
 
45
- page.links.all.select {|l| l =~ /^http(s)?:\/\//i}.each do |link|
45
+ page.links.http.each do |link|
46
46
  check_status(link, page.url)
47
47
  end
48
48
 
@@ -27,10 +27,14 @@ while queue.any?
27
27
 
28
28
  puts "VISITED: #{url}"
29
29
 
30
- page = MetaInspector.new(url)
31
-
32
- page.links.internal.each do |link|
33
- queue.push(link) unless visited.include?(link) || queue.include?(link)
30
+ begin
31
+ page = MetaInspector.new(url)
32
+
33
+ page.links.internal.each do |link|
34
+ queue.push(link) unless visited.include?(link) || queue.include?(link)
35
+ end
36
+ rescue MetaInspector::ParserError
37
+ puts "Couldn't get links from #{url}, skipping"
34
38
  end
35
39
 
36
40
  puts "#{visited.size} pages visited, #{queue.size} pages on queue\n\n"
@@ -28,7 +28,7 @@ module MetaInspector
28
28
  # See doc at http://developers.facebook.com/docs/opengraph/
29
29
  # If none found, tries with Twitter image
30
30
  def owner_suggested
31
- suggested_img = meta['og:image'] || meta['twitter:image']
31
+ suggested_img = content_of(meta['og:image']) || content_of(meta['twitter:image'])
32
32
  URL.absolutify(suggested_img, base_url) if suggested_img
33
33
  end
34
34
 
@@ -89,6 +89,11 @@ module MetaInspector
89
89
  def parsed_images
90
90
  cleanup(parsed.search('//img/@src'))
91
91
  end
92
+
93
+ def content_of(content)
94
+ return nil if content.nil? || content.empty?
95
+ content
96
+ end
92
97
  end
93
98
  end
94
99
  end
@@ -1,3 +1,3 @@
1
1
  module MetaInspector
2
- VERSION = '5.4.1'
2
+ VERSION = '5.4.2'
3
3
  end
@@ -25,7 +25,6 @@ Gem::Specification.new do |gem|
25
25
  gem.add_dependency 'nesty', '~> 1.0'
26
26
 
27
27
  gem.add_development_dependency 'rspec', '~> 3.0'
28
- gem.add_development_dependency 'fakeweb', '1.3.0'
29
28
  gem.add_development_dependency 'webmock'
30
29
  gem.add_development_dependency 'awesome_print'
31
30
  gem.add_development_dependency 'rake', '~> 10.1.0'
@@ -0,0 +1,53 @@
1
+ HTTP/1.1 200 OK
2
+ Age: 13
3
+ Cache-Control: max-age=120
4
+ Content-Type: text/html
5
+ Date: Mon, 06 Jan 2014 12:47:42 GMT
6
+ Expires: Mon, 06 Jan 2014 12:49:28 GMT
7
+ Server: Apache/2.2.14 (Ubuntu)
8
+ Vary: Accept-Encoding
9
+ Via: 1.1 varnish
10
+ X-Powered-By: PHP/5.3.2-1ubuntu4.22
11
+ X-Varnish: 1188792404 1188790413
12
+ Content-Length: 40571
13
+ Connection: keep-alive
14
+
15
+ <!DOCTYPE html>
16
+ <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
17
+ <head>
18
+ <!-- meta name examples -->
19
+
20
+ <meta name="keywords" content="" />
21
+ <meta name="description" content="" />
22
+ <meta name="author" content="" />
23
+ <meta name="robots" content="" />
24
+ <meta name="revisit" content="" />
25
+ <meta name="DC.date.issued" content="">
26
+
27
+ <!-- meta http-equiv examples -->
28
+
29
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
30
+ <meta http-equiv="Content-Style-Type" content="text/css" />
31
+
32
+ <!-- meta charset examples -->
33
+
34
+ <meta charset="UTF-8" />
35
+
36
+ <!-- meta property examples -->
37
+
38
+ <meta property="og:title" content="" />
39
+ <meta property="og:type" content="" />
40
+ <meta property="og:url" content="" />
41
+
42
+ <meta property="og:image" content="" />
43
+ <meta property="og:image:width" content="" />
44
+ <meta property="og:image:height" content="" />
45
+
46
+ <meta property="twitter:image" content="" />
47
+
48
+ </head>
49
+ <body>
50
+ <p>A sample page with many types of empty meta tags and an image to fallback to</p>
51
+ <img src="/100x100" />
52
+ </body>
53
+ </html>
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe MetaInspector do
4
-
5
4
  describe "head_links" do
6
5
  let(:page) { MetaInspector.new('http://example.com/head_links') }
7
6
  let(:page_https) { MetaInspector.new('https://example.com/head_links') }
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe MetaInspector do
4
-
5
4
  describe "#images" do
6
5
  describe "returns an Enumerable" do
7
6
  let(:page) { MetaInspector.new('https://twitter.com/markupvalidator') }
@@ -89,6 +88,12 @@ describe MetaInspector do
89
88
  expect(page.images.best).to eq("http://example.com/100x100")
90
89
  end
91
90
 
91
+ it "should find image when og:image and twitter:image metatags are present but empty" do
92
+ page = MetaInspector.new('http://example.com/meta_tags_empty')
93
+
94
+ expect(page.images.best).to eq("http://example.com/100x100")
95
+ end
96
+
92
97
  it "should find image when some img tag has no src attribute" do
93
98
  page = MetaInspector.new('http://example.com/malformed_image_in_html')
94
99
 
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe MetaInspector do
4
-
5
4
  describe "meta tags" do
6
5
  let(:page) { MetaInspector.new('http://example.com/meta-tags') }
7
6
 
@@ -19,9 +19,6 @@ describe MetaInspector do
19
19
  end
20
20
 
21
21
  context "when there are too many redirects" do
22
- before(:all) { WebMock.enable! }
23
- after(:all) { WebMock.disable! }
24
-
25
22
  before do
26
23
  12.times { |i| register_redirect(i, i+1) }
27
24
  end
@@ -34,9 +31,6 @@ describe MetaInspector do
34
31
  end
35
32
 
36
33
  context "when there are cookies required for proper redirection" do
37
- before(:all) { WebMock.enable! }
38
- after(:all) { WebMock.disable! }
39
-
40
34
  it "allows follows redirections while sending the cookies" do
41
35
  stub_request(:get, "http://blogs.clarionledger.com/dechols/2014/03/24/digital-medicine/")
42
36
  .to_return(:status => 302,
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe MetaInspector::Request do
4
-
5
4
  it "raises an error if the URL is non-HTTP" do
6
5
  expect do
7
6
  MetaInspector::Request.new(url('ftp://ftp.example.com'))
@@ -55,11 +54,11 @@ describe MetaInspector::Request do
55
54
 
56
55
  describe 'exception handling' do
57
56
  before(:each) do
58
- FakeWeb.allow_net_connect = true
57
+ WebMock.allow_net_connect!
59
58
  end
60
59
 
61
60
  after(:each) do
62
- FakeWeb.allow_net_connect = false
61
+ WebMock.disable_net_connect!
63
62
  end
64
63
 
65
64
  it "should handle socket errors" do
@@ -1,12 +1,8 @@
1
1
  $: << File.join(File.dirname(__FILE__), "/../lib")
2
2
  require 'meta_inspector'
3
- require 'fakeweb'
4
3
  require "webmock/rspec"
5
4
  require "pry"
6
5
 
7
- FakeWeb.allow_net_connect = false
8
- WebMock.disable!
9
-
10
6
  def fixture_file(filename)
11
7
  return '' if filename == ''
12
8
  file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/' + filename)
@@ -16,107 +12,66 @@ end
16
12
  RSpec.configure do |config|
17
13
  config.filter_run focus: true
18
14
  config.run_all_when_everything_filtered = true
19
- end
20
-
21
- #######################
22
- # Faked web responses #
23
- #######################
24
-
25
- # We're reorganizing fixtures, trying to combine them on as few as possible response files
26
- # For each change in the fixtures, a comment should be included explaining why it's needed
27
- # This is the base page to be used in the examples
28
- FakeWeb.register_uri(:get, "http://example.com/", :response => fixture_file("example.response"))
29
-
30
- # Used to test response status codes
31
- FakeWeb.register_uri(:get, "http://example.com/404", :response => fixture_file("404.response"))
32
-
33
- # Used to test headers
34
- FakeWeb.register_uri(:get, "http://example.com/no-content-type", :response => fixture_file("no-content-type.response"))
35
-
36
- # Used to test largest image in page logic
37
- FakeWeb.register_uri(:get, "http://example.com/largest_image_in_html", :response => fixture_file("largest_image_in_html.response"))
38
- FakeWeb.register_uri(:get, "http://example.com/largest_image_using_image_size", :response => fixture_file("largest_image_using_image_size.response"))
39
- FakeWeb.register_uri(:get, "http://example.com/malformed_image_in_html", :response => fixture_file("malformed_image_in_html.response"))
40
- FakeWeb.register_uri(:get, "http://example.com/10x10", :response => fixture_file("10x10.jpg.response"))
41
- FakeWeb.register_uri(:get, "http://example.com/100x100", :response => fixture_file("100x100.jpg.response"))
42
- FakeWeb.register_uri(:get, "http://www.24-horas.mx/mexico-firma-acuerdo-bilateral-automotriz-con-argentina/", :response => fixture_file("relative_og_image.response"))
43
-
44
- # Used to test canonical URLs in head
45
- FakeWeb.register_uri(:get, "http://example.com/head_links", :response => fixture_file("head_links.response"))
46
- FakeWeb.register_uri(:get, "https://example.com/head_links", :response => fixture_file("head_links.response"))
47
- FakeWeb.register_uri(:get, "http://example.com/broken_head_links", :response => fixture_file("broken_head_links.response"))
48
-
49
- # Used to test best_title logic
50
- FakeWeb.register_uri(:get, "http://example.com/title_in_head", :response => fixture_file("title_in_head.response"))
51
- FakeWeb.register_uri(:get, "http://example.com/title_in_body", :response => fixture_file("title_in_body.response"))
52
- FakeWeb.register_uri(:get, "http://example.com/title_in_h1", :response => fixture_file("title_in_h1.response"))
53
- FakeWeb.register_uri(:get, "http://example.com/title_best_choice", :response => fixture_file("title_best_choice.response"))
54
- FakeWeb.register_uri(:get, "http://example.com/title_in_head_with_whitespace", :response => fixture_file("title_in_head_with_whitespace.response"))
55
- FakeWeb.register_uri(:get, "http://example.com/title_not_present", :response => fixture_file("title_not_present.response"))
56
- # best_title now has specific logic for youtube
57
- FakeWeb.register_uri(:get, "http://www.youtube.com/watch?v=short_title", :response => fixture_file("youtube_short_title.response"))
58
15
 
59
- # Used to test best_description logic
60
- FakeWeb.register_uri(:get, "http://example.com/desc_in_meta", :response => fixture_file("desc_in_meta.response"))
61
- FakeWeb.register_uri(:get, "http://example.com/desc_in_og", :response => fixture_file("desc_in_og.response"))
62
- FakeWeb.register_uri(:get, "http://example.com/desc_in_twitter", :response => fixture_file("desc_in_twitter.response"))
63
-
64
- # These are older fixtures
65
- FakeWeb.register_uri(:get, "http://pagerankalert.com", :response => fixture_file("pagerankalert.com.response"))
66
- FakeWeb.register_uri(:get, "http://pagerankalert-shortcut.com", :response => fixture_file("pagerankalert-shortcut.com.response"))
67
- FakeWeb.register_uri(:get, "http://pagerankalert-shortcut-and-icon.com", :response => fixture_file("pagerankalert-shortcut-and-icon.com.response"))
68
- FakeWeb.register_uri(:get, "http://pagerankalert-touch-icon.com", :response => fixture_file("pagerankalert-touch-icon.com.response"))
69
- FakeWeb.register_uri(:get, "pagerankalert.com", :response => fixture_file("pagerankalert.com.response"))
70
- FakeWeb.register_uri(:get, "http://www.alazan.com", :response => fixture_file("alazan.com.response"))
71
- FakeWeb.register_uri(:get, "http://alazan.com/websolution.asp", :response => fixture_file("alazan_websolution.response"))
72
- FakeWeb.register_uri(:get, "http://www.theonion.com/articles/apple-claims-new-iphone-only-visible-to-most-loyal,2772/", :response => fixture_file("theonion.com.response"))
73
- FakeWeb.register_uri(:get, "http://theonion-no-description.com", :response => fixture_file("theonion-no-description.com.response"))
74
- FakeWeb.register_uri(:get, "http://www.iteh.at", :response => fixture_file("iteh.at.response"))
75
- FakeWeb.register_uri(:get, "http://www.tea-tron.com/jbravo/blog/", :response => fixture_file("tea-tron.com.response"))
76
- FakeWeb.register_uri(:get, "http://www.guardian.co.uk/media/pda/2011/sep/15/techcrunch-arrington-startups", :response => fixture_file("guardian.co.uk.response"))
77
- FakeWeb.register_uri(:get, "http://protocol-relative.com", :response => fixture_file("protocol_relative.response"))
78
- FakeWeb.register_uri(:get, "https://protocol-relative.com", :response => fixture_file("protocol_relative.response"))
79
- FakeWeb.register_uri(:get, "http://example.com/nonhttp", :response => fixture_file("nonhttp.response"))
80
- FakeWeb.register_uri(:get, "http://example.com/invalid_href", :response => fixture_file("invalid_href.response"))
81
- FakeWeb.register_uri(:get, "http://example.com/invalid_byte_seq", :response => fixture_file("invalid_byte_seq.response"))
82
- FakeWeb.register_uri(:get, "http://example.com/malformed_href", :response => fixture_file("malformed_href.response"))
83
- FakeWeb.register_uri(:get, "http://www.youtube.com/watch?v=iaGSSrp49uc", :response => fixture_file("youtube.response"))
84
- FakeWeb.register_uri(:get, "http://markupvalidator.com/faqs", :response => fixture_file("markupvalidator_faqs.response"))
85
- FakeWeb.register_uri(:get, "https://twitter.com/markupvalidator", :response => fixture_file("twitter_markupvalidator.response"))
86
- FakeWeb.register_uri(:get, "http://example.com/empty", :response => fixture_file("empty_page.response"))
87
- FakeWeb.register_uri(:get, "http://international.com", :response => fixture_file("international.response"))
88
- FakeWeb.register_uri(:get, "http://charset000.com", :response => fixture_file("charset_000.response"))
89
- FakeWeb.register_uri(:get, "http://charset001.com", :response => fixture_file("charset_001.response"))
90
- FakeWeb.register_uri(:get, "http://charset002.com", :response => fixture_file("charset_002.response"))
91
- FakeWeb.register_uri(:get, "http://www.inkthemes.com/", :response => fixture_file("wordpress_site.response"))
92
- FakeWeb.register_uri(:get, "http://pagerankalert.com/image.png", :body => "Image", :content_type => "image/png")
93
- FakeWeb.register_uri(:get, "http://pagerankalert.com/file.tar.gz", :body => "Image", :content_type => "application/x-gzip")
94
- FakeWeb.register_uri(:get, "http://example.com/meta-tags", :response => fixture_file("meta_tags.response"))
95
-
96
- # These examples are used to test relative links
97
- FakeWeb.register_uri(:get, "http://relative.com/", :response => fixture_file("relative_links.response"))
98
- FakeWeb.register_uri(:get, "http://relative.com/company", :response => fixture_file("relative_links.response"))
99
- FakeWeb.register_uri(:get, "http://relative.com/company/", :response => fixture_file("relative_links.response"))
100
-
101
- FakeWeb.register_uri(:get, "http://relativewithbase.com/", :response => fixture_file("relative_links_with_base.response"))
102
- FakeWeb.register_uri(:get, "http://relativewithbase.com/company/page2", :response => fixture_file("relative_links_with_base.response"))
103
- FakeWeb.register_uri(:get, "http://relativewithbase.com/company/page2/", :response => fixture_file("relative_links_with_base.response"))
104
-
105
- # These examples are used to test the redirections from HTTP to HTTPS and vice versa
106
- # http://facebook.com => https://facebook.com
107
- FakeWeb.register_uri(:get, "http://facebook.com/", :response => fixture_file("facebook.com.response"))
108
- FakeWeb.register_uri(:get, "https://www.facebook.com/", :response => fixture_file("https.facebook.com.response"))
109
-
110
- # https://unsafe-facebook.com => http://unsafe-facebook.com
111
- FakeWeb.register_uri(:get, "https://unsafe-facebook.com/", :response => fixture_file("unsafe_https.facebook.com.response"))
112
- FakeWeb.register_uri(:get, "http://unsafe-facebook.com/", :response => fixture_file("unsafe_facebook.com.response"))
113
-
114
- # These examples are used to test normalize URLs
115
- FakeWeb.register_uri(:get, "http://example.com/%EF%BD%9E", :response => fixture_file("example.response"))
116
- FakeWeb.register_uri(:get, "http://example.com/~", :response => fixture_file("example.response"))
117
-
118
- # Example to test correct encoding
119
- FakeWeb.register_uri(:get, "http://example-rtl.com/", :response => fixture_file("encoding.response"))
120
-
121
- # Example used to test empty description metatags
122
- FakeWeb.register_uri(:get, "http://example.com/empty-meta-description", :response => fixture_file("empty_metatag_description.response"))
16
+ config.before(:each) do
17
+ stub_request(:get, "http://alazan.com/websolution.asp").to_return(fixture_file("alazan_websolution.response"))
18
+ stub_request(:get, "http://charset000.com").to_return(fixture_file("charset_000.response"))
19
+ stub_request(:get, "http://charset001.com").to_return(fixture_file("charset_001.response"))
20
+ stub_request(:get, "http://charset002.com").to_return(fixture_file("charset_002.response"))
21
+ stub_request(:get, "http://example-rtl.com/").to_return(fixture_file("encoding.response"))
22
+ stub_request(:get, "http://example.com").to_return(fixture_file("example.response"))
23
+ stub_request(:get, "http://example.com/").to_return(fixture_file("example.response"))
24
+ stub_request(:get, "http://example.com/100x100").to_return(fixture_file("100x100.jpg.response"))
25
+ stub_request(:get, "http://example.com/10x10").to_return(fixture_file("10x10.jpg.response"))
26
+ stub_request(:get, "http://example.com/broken_head_links").to_return(fixture_file("broken_head_links.response"))
27
+ stub_request(:get, "http://example.com/desc_in_meta").to_return(fixture_file("desc_in_meta.response"))
28
+ stub_request(:get, "http://example.com/desc_in_og").to_return(fixture_file("desc_in_og.response"))
29
+ stub_request(:get, "http://example.com/desc_in_twitter").to_return(fixture_file("desc_in_twitter.response"))
30
+ stub_request(:get, "http://example.com/empty").to_return(fixture_file("empty_page.response"))
31
+ stub_request(:get, "http://example.com/head_links").to_return(fixture_file("head_links.response"))
32
+ stub_request(:get, "http://example.com/invalid_byte_seq").to_return(fixture_file("invalid_byte_seq.response"))
33
+ stub_request(:get, "http://example.com/invalid_href").to_return(fixture_file("invalid_href.response"))
34
+ stub_request(:get, "http://example.com/largest_image_in_html").to_return(fixture_file("largest_image_in_html.response"))
35
+ stub_request(:get, "http://example.com/largest_image_using_image_size").to_return(fixture_file("largest_image_using_image_size.response"))
36
+ stub_request(:get, "http://example.com/malformed_href").to_return(fixture_file("malformed_href.response"))
37
+ stub_request(:get, "http://example.com/malformed_image_in_html").to_return(fixture_file("malformed_image_in_html.response"))
38
+ stub_request(:get, "http://example.com/meta-tags").to_return(fixture_file("meta_tags.response"))
39
+ stub_request(:get, "http://example.com/no-content-type").to_return(fixture_file("no-content-type.response"))
40
+ stub_request(:get, "http://example.com/nonhttp").to_return(fixture_file("nonhttp.response"))
41
+ stub_request(:get, "http://example.com/title_best_choice").to_return(fixture_file("title_best_choice.response"))
42
+ stub_request(:get, "http://example.com/title_in_body").to_return(fixture_file("title_in_body.response"))
43
+ stub_request(:get, "http://example.com/title_in_h1").to_return(fixture_file("title_in_h1.response"))
44
+ stub_request(:get, "http://example.com/title_in_head").to_return(fixture_file("title_in_head.response"))
45
+ stub_request(:get, "http://example.com/title_in_head_with_whitespace").to_return(fixture_file("title_in_head_with_whitespace.response"))
46
+ stub_request(:get, "http://example.com/title_not_present").to_return(fixture_file("title_not_present.response"))
47
+ stub_request(:get, "http://example.com/~").to_return(fixture_file("example.response"))
48
+ stub_request(:get, "http://facebook.com/").to_return(fixture_file("facebook.com.response"))
49
+ stub_request(:get, "http://international.com").to_return(fixture_file("international.response"))
50
+ stub_request(:get, "http://pagerankalert-shortcut-and-icon.com").to_return(fixture_file("pagerankalert-shortcut-and-icon.com.response"))
51
+ stub_request(:get, "http://pagerankalert-shortcut.com").to_return(fixture_file("pagerankalert-shortcut.com.response"))
52
+ stub_request(:get, "http://pagerankalert-touch-icon.com").to_return(fixture_file("pagerankalert-touch-icon.com.response"))
53
+ stub_request(:get, "http://pagerankalert.com/").to_return(fixture_file("pagerankalert.com.response"))
54
+ stub_request(:get, "http://pagerankalert.com/image.png").to_return(headers: {'Content-Type' => 'image/png'})
55
+ stub_request(:get, "http://protocol-relative.com").to_return(fixture_file("protocol_relative.response"))
56
+ stub_request(:get, "http://relative.com/").to_return(fixture_file("relative_links.response"))
57
+ stub_request(:get, "http://relative.com/company").to_return(fixture_file("relative_links.response"))
58
+ stub_request(:get, "http://relative.com/company/").to_return(fixture_file("relative_links.response"))
59
+ stub_request(:get, "http://relativewithbase.com/").to_return(fixture_file("relative_links_with_base.response"))
60
+ stub_request(:get, "http://relativewithbase.com/company/page2").to_return(fixture_file("relative_links_with_base.response"))
61
+ stub_request(:get, "http://relativewithbase.com/company/page2/").to_return(fixture_file("relative_links_with_base.response"))
62
+ stub_request(:get, "http://theonion-no-description.com").to_return(fixture_file("theonion-no-description.com.response"))
63
+ stub_request(:get, "http://www.24-horas.mx/mexico-firma-acuerdo-bilateral-automotriz-con-argentina/").to_return(fixture_file("relative_og_image.response"))
64
+ stub_request(:get, "http://www.alazan.com").to_return(fixture_file("alazan.com.response"))
65
+ stub_request(:get, "http://www.guardian.co.uk/media/pda/2011/sep/15/techcrunch-arrington-startups").to_return(fixture_file("guardian.co.uk.response"))
66
+ stub_request(:get, "http://www.iteh.at").to_return(fixture_file("iteh.at.response"))
67
+ stub_request(:get, "http://www.tea-tron.com/jbravo/blog/").to_return(fixture_file("tea-tron.com.response"))
68
+ stub_request(:get, "http://www.theonion.com/articles/apple-claims-new-iphone-only-visible-to-most-loyal,2772/").to_return(fixture_file("theonion.com.response"))
69
+ stub_request(:get, "http://www.youtube.com/watch?v=iaGSSrp49uc").to_return(fixture_file("youtube.response"))
70
+ stub_request(:get, "http://www.youtube.com/watch?v=short_title").to_return(fixture_file("youtube_short_title.response"))
71
+ stub_request(:get, "https://example.com/head_links").to_return(fixture_file("head_links.response"))
72
+ stub_request(:get, "https://protocol-relative.com").to_return(fixture_file("protocol_relative.response"))
73
+ stub_request(:get, "https://twitter.com/markupvalidator").to_return(fixture_file("twitter_markupvalidator.response"))
74
+ stub_request(:get, "https://www.facebook.com/").to_return(fixture_file("https.facebook.com.response"))
75
+ stub_request(:get, "http://example.com/meta_tags_empty").to_return(fixture_file("meta_tags_empty.response"))
76
+ end
77
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metainspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.1
4
+ version: 5.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Iniesta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-23 00:00:00.000000000 Z
11
+ date: 2018-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -150,20 +150,6 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '3.0'
153
- - !ruby/object:Gem::Dependency
154
- name: fakeweb
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - '='
158
- - !ruby/object:Gem::Version
159
- version: 1.3.0
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - '='
165
- - !ruby/object:Gem::Version
166
- version: 1.3.0
167
153
  - !ruby/object:Gem::Dependency
168
154
  name: webmock
169
155
  requirement: !ruby/object:Gem::Requirement
@@ -301,6 +287,7 @@ files:
301
287
  - spec/fixtures/malformed_image_in_html.response
302
288
  - spec/fixtures/markupvalidator_faqs.response
303
289
  - spec/fixtures/meta_tags.response
290
+ - spec/fixtures/meta_tags_empty.response
304
291
  - spec/fixtures/no-content-type.response
305
292
  - spec/fixtures/nonhttp.response
306
293
  - spec/fixtures/pagerankalert-shortcut-and-icon.com.response