metainspector 5.10.0 → 5.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc758c043b7b4a077348b67361a856571c9094ddab2fbe0e886025251ff6a627
4
- data.tar.gz: a842076246a4495f268078d272df3eced9d0b82ba5c4979ee6c82b2e6b27f43d
3
+ metadata.gz: 97b670ec8a7026383d659037318206d8262e17bbc35b0ec51f34609b6a6ebc95
4
+ data.tar.gz: 326230360c0199174e39bf495e00de74057a208e155ca0f4ec584f9e728f59bd
5
5
  SHA512:
6
- metadata.gz: 8eff062fd09c1ba05b41af584eb2355e6157235cc76d1c1bb10216b1b8c48502bb9c7f68a784bdbd932bca21e5d2ecfce4b1664892eb3cf1770a4e25bce8ff81
7
- data.tar.gz: e92bcd2a9cae3dfbaac2588464d5202c0de171c40d28feb04a40e7b734bb5d94e9362e4a1887c19f649bcbc21ef4fc34f0b9c5c6f70dff816aea54320096015e
6
+ metadata.gz: 1e89cc17ea97453f74935883267851f1a2f0e1a9255ea5a1a259a850950d9633227a41f4ed06af0b43a7e1f1a2331368b274c7a715ea6779e3ba60e616e11aa7
7
+ data.tar.gz: 656a52071ada09f4ac45703f1a688ec85f17f30b5e89f9f1965f81478c21ad3feb651df7773caf5a447c07bea6ee78cb84505f53f5ab5ac689a847ccbdb5ee15
@@ -1,6 +1,5 @@
1
1
  script: "bundle exec rspec -b"
2
2
  rvm:
3
- - 2.3.6
4
- - 2.4.3
5
- - 2.5.0
6
- - 2.6.4
3
+ - 2.5.8
4
+ - 2.6.6
5
+ - 2.7.1
@@ -1,5 +1,9 @@
1
1
  # MetaInpector Changelog
2
2
 
3
+ ## [Changes in 5.10](https://github.com/jaimeiniesta/metainspector/compare/v5.9.0...v5.10.0)
4
+
5
+ * Upgrade to Faraday 1.0.
6
+
3
7
  ## [Changes in 5.9](https://github.com/jaimeiniesta/metainspector/compare/v5.8.0...v5.9.0)
4
8
 
5
9
  * Added #feeds method to retrieve all feeds of a page.
data/README.md CHANGED
@@ -22,6 +22,8 @@ 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
+ Supported Ruby versions are defined in [`.travis.yml`](.travis.yml).
26
+
25
27
  ## Usage
26
28
 
27
29
  Initialize a MetaInspector instance for an URL, like this:
@@ -47,7 +47,8 @@ module MetaInspector
47
47
  # This can be the one set on a <base> tag,
48
48
  # or the url of the document if no <base> tag was found.
49
49
  def base_url
50
- base_href || url
50
+ current_base_href = base_href.to_s.strip.empty? ? nil : base_href
51
+ current_base_href || url
51
52
  end
52
53
 
53
54
  # Returns the value of the href attribute on the <base /> tag, if exists
@@ -1,3 +1,3 @@
1
1
  module MetaInspector
2
- VERSION = '5.10.0'
2
+ VERSION = '5.10.1'
3
3
  end
@@ -0,0 +1,22 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx/1.0.5
3
+ Date: Thu, 29 Dec 2011 23:10:13 GMT
4
+ Content-Type: text/html
5
+ Content-Length: 15013
6
+ Last-Modified: Fri, 02 Dec 2011 21:00:49 GMT
7
+ Connection: keep-alive
8
+ Accept-Ranges: bytes
9
+
10
+ <!DOCTYPE html>
11
+ <html>
12
+ <head>
13
+ <base href=""/>
14
+ <meta charset="utf-8" />
15
+ <title>Relative links</title>
16
+ </head>
17
+ <body>
18
+ <p>Relative links</p>
19
+ <a href="about">About</a>
20
+ <a href="../sitemap">Sitemap</a>
21
+ </body>
22
+ </html>
@@ -145,6 +145,13 @@ describe MetaInspector do
145
145
  end
146
146
  end
147
147
 
148
+ describe 'Relative links with empty or blank base' do
149
+ it 'should get the relative links from a document' do
150
+ m = MetaInspector.new('http://relativewithemptybase.com/company')
151
+ expect(m.links.internal).to eq(['http://relativewithemptybase.com/about', 'http://relativewithemptybase.com/sitemap'])
152
+ end
153
+ end
154
+
148
155
  describe 'Relative links with base' do
149
156
  it 'should get the relative links from a document' do
150
157
  m = MetaInspector.new('http://relativewithbase.com/company/page2')
@@ -65,6 +65,7 @@ RSpec.configure do |config|
65
65
  stub_request(:get, "http://relativewithbase.com/").to_return(fixture_file("relative_links_with_base.response"))
66
66
  stub_request(:get, "http://relativewithbase.com/company/page2").to_return(fixture_file("relative_links_with_base.response"))
67
67
  stub_request(:get, "http://relativewithbase.com/company/page2/").to_return(fixture_file("relative_links_with_base.response"))
68
+ stub_request(:get, "http://relativewithemptybase.com/company").to_return(fixture_file("relative_links_with_empty_base.response"))
68
69
  stub_request(:get, "http://theonion-no-description.com").to_return(fixture_file("theonion-no-description.com.response"))
69
70
  stub_request(:get, "http://www.24-horas.mx/mexico-firma-acuerdo-bilateral-automotriz-con-argentina/").to_return(fixture_file("relative_og_image.response"))
70
71
  stub_request(:get, "http://www.alazan.com").to_return(fixture_file("alazan.com.response"))
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.10.0
4
+ version: 5.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Iniesta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-24 00:00:00.000000000 Z
11
+ date: 2020-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -302,6 +302,7 @@ files:
302
302
  - spec/fixtures/protocol_relative.response
303
303
  - spec/fixtures/relative_links.response
304
304
  - spec/fixtures/relative_links_with_base.response
305
+ - spec/fixtures/relative_links_with_empty_base.response
305
306
  - spec/fixtures/relative_og_image.response
306
307
  - spec/fixtures/theonion-no-description.com.response
307
308
  - spec/fixtures/theonion.com.response