metainspector 5.2.1 → 5.2.2

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
  SHA1:
3
- metadata.gz: ee91e2584212fcc3855df7194995c540f270b93d
4
- data.tar.gz: be340bfaf27f1711f41f4aa2bdede5d9ed13dcf1
3
+ metadata.gz: 6cecd7d0c5bc039440b960b63d6f95117370d064
4
+ data.tar.gz: 9017254d980488f088f362bbb6659369636a13e1
5
5
  SHA512:
6
- metadata.gz: ad094ae13e5ee7aeb2b31bb11fbe77e6970b64ee8a075db4dff76ec2a0161f6bbf958c6e0910d4893e59838d4ec4efb6c534fa6b31ef6f3005d4350fec29b11e
7
- data.tar.gz: bd2f433f1c9f992b0ef93eab38157ebe235a3989307a043eabc7d0da20596905503ae967b148661b1b3cc4ac5aab76fe268e16ed9c2404fe293e7f02fee2c550
6
+ metadata.gz: b66b076fc13a4bf18ba416fda0e5814502626f11ea2df0cded4e2249b7224b34369b6af49ea232949bd9512657a4c7ec7715d77449ed8ca41f6c2c6342b1691d
7
+ data.tar.gz: ed153dc93c8b70c45e28add1315d2472e2933c23a086c0db431740d3e2693f4c5d2061d69eafc5174c0c432391ed0b6c8f89b8689d4d4b430d70e9ecee794456
@@ -2,4 +2,4 @@ rvm:
2
2
  - 2.0.0
3
3
  - 2.1.8
4
4
  - 2.2.4
5
- - 2.3.0
5
+ - 2.3.1
data/README.md CHANGED
@@ -267,13 +267,13 @@ page = MetaInspector.new('www.google', :connection_timeout => 10, :read_timeout
267
267
  ```
268
268
 
269
269
  If MetaInspector fails to fetch the page after it has exhausted its retries,
270
- it will raise `Faraday::TimeoutError`, which you can rescue in your
270
+ it will raise `MetaInspector::TimeoutError`, which you can rescue in your
271
271
  application code.
272
272
 
273
273
  ```ruby
274
274
  begin
275
275
  page = MetaInspector.new(url)
276
- rescue Faraday::TimeoutError
276
+ rescue MetaInspector::TimeoutError
277
277
  enqueue_for_future_fetch_attempt(url)
278
278
  render_simple(url)
279
279
  else
@@ -28,7 +28,7 @@ module MetaInspector
28
28
  delegate :url => :@url
29
29
 
30
30
  def read
31
- response.body if response
31
+ response.body.tr("\000", '') if response
32
32
  end
33
33
 
34
34
  def content_type
@@ -1,3 +1,3 @@
1
1
  module MetaInspector
2
- VERSION = '5.2.1'
2
+ VERSION = '5.2.2'
3
3
  end
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
5
5
  gem.email = ["jaimeiniesta@gmail.com"]
6
6
  gem.description = %q{MetaInspector lets you scrape a web page and get its links, images, texts, meta tags...}
7
7
  gem.summary = %q{MetaInspector is a ruby gem for web scraping purposes, that returns metadata from a given URL}
8
- gem.homepage = "http://jaimeiniesta.github.io/metainspector/"
8
+ gem.homepage = "https://github.com/jaimeiniesta/metainspector"
9
9
  gem.license = "MIT"
10
10
 
11
11
  gem.files = `git ls-files`.split("\n")
@@ -137,5 +137,13 @@ describe MetaInspector::Document do
137
137
  it 'should encode description according to the charset' do
138
138
  expect(MetaInspector.new('http://example-rtl.com/').description).to eq('أعلن النائب مصطفى بكري انسحابه من ائتلاف دعم مصر بعد اعتراضه على نتيجة الانتخابات الداخلية للائتلاف، وخسارته فيها، وقال إنه سيترشح غدا على منصب الوكيل بالمجلس')
139
139
  end
140
+
141
+ it 'should replace NULL characters' do
142
+ doc = MetaInspector.new('http://example-rtl.com/').parsed
143
+
144
+ image_src = doc.css('.some_class').first.attribute('src').value
145
+
146
+ expect(image_src).to eq('/path/to/image.jpg')
147
+ end
140
148
  end
141
149
  end
@@ -41,7 +41,7 @@ FakeWeb.register_uri(:get, "http://example.com/10x10", :response => fixture_file
41
41
  FakeWeb.register_uri(:get, "http://example.com/100x100", :response => fixture_file("100x100.jpg.response"))
42
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
43
 
44
- #Used to test canonical URLs in head
44
+ # Used to test canonical URLs in head
45
45
  FakeWeb.register_uri(:get, "http://example.com/head_links", :response => fixture_file("head_links.response"))
46
46
  FakeWeb.register_uri(:get, "https://example.com/head_links", :response => fixture_file("head_links.response"))
47
47
  FakeWeb.register_uri(:get, "http://example.com/broken_head_links", :response => fixture_file("broken_head_links.response"))
metadata CHANGED
@@ -1,153 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metainspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 5.2.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: 2016-04-30 00:00:00.000000000 Z
11
+ date: 2016-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.9'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.9'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: faraday_middleware
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.10'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.10'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: faraday-cookie_jar
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: faraday-http-cache
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.2'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.2'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: faraday-encoding
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.0.3
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.0.3
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: addressable
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
103
  version: '2.4'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: '2.4'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: fastimage
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
117
  version: '2.0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
124
  version: '2.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: nesty
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ~>
130
130
  - !ruby/object:Gem::Version
131
131
  version: '1.0'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ~>
137
137
  - !ruby/object:Gem::Version
138
138
  version: '1.0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ~>
144
144
  - !ruby/object:Gem::Version
145
145
  version: '3.0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ~>
151
151
  - !ruby/object:Gem::Version
152
152
  version: '3.0'
153
153
  - !ruby/object:Gem::Dependency
@@ -168,70 +168,70 @@ dependencies:
168
168
  name: webmock
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - '>='
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - '>='
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: awesome_print
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - '>='
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ">="
192
+ - - '>='
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rake
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - "~>"
199
+ - - ~>
200
200
  - !ruby/object:Gem::Version
201
201
  version: 10.1.0
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - "~>"
206
+ - - ~>
207
207
  - !ruby/object:Gem::Version
208
208
  version: 10.1.0
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: pry
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - ">="
213
+ - - '>='
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ">="
220
+ - - '>='
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: rubocop
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - ">="
227
+ - - '>='
228
228
  - !ruby/object:Gem::Version
229
229
  version: '0'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
- - - ">="
234
+ - - '>='
235
235
  - !ruby/object:Gem::Version
236
236
  version: '0'
237
237
  description: MetaInspector lets you scrape a web page and get its links, images, texts,
@@ -242,10 +242,10 @@ executables: []
242
242
  extensions: []
243
243
  extra_rdoc_files: []
244
244
  files:
245
- - ".gitignore"
246
- - ".rspec.example"
247
- - ".rubocop.yml.example"
248
- - ".travis.yml"
245
+ - .gitignore
246
+ - .rspec.example
247
+ - .rubocop.yml.example
248
+ - .travis.yml
249
249
  - CHANGELOG.md
250
250
  - Gemfile
251
251
  - MIT-LICENSE
@@ -334,7 +334,7 @@ files:
334
334
  - spec/request_spec.rb
335
335
  - spec/spec_helper.rb
336
336
  - spec/url_spec.rb
337
- homepage: http://jaimeiniesta.github.io/metainspector/
337
+ homepage: https://github.com/jaimeiniesta/metainspector
338
338
  licenses:
339
339
  - MIT
340
340
  metadata: {}
@@ -344,12 +344,12 @@ require_paths:
344
344
  - lib
345
345
  required_ruby_version: !ruby/object:Gem::Requirement
346
346
  requirements:
347
- - - ">="
347
+ - - '>='
348
348
  - !ruby/object:Gem::Version
349
349
  version: '0'
350
350
  required_rubygems_version: !ruby/object:Gem::Requirement
351
351
  requirements:
352
- - - ">="
352
+ - - '>='
353
353
  - !ruby/object:Gem::Version
354
354
  version: '0'
355
355
  requirements: []