mechanize 2.7.0 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of mechanize might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +0 -5
- data/CHANGELOG.rdoc +5 -0
- data/README.rdoc +6 -5
- data/lib/mechanize.rb +1 -1
- data/lib/mechanize/http/agent.rb +6 -10
- data/lib/mechanize/page/image.rb +2 -2
- data/test/test_mechanize_page_image.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a97a6fd7fb8b0c358b45a7f457fb0e6fa3878e41
|
4
|
+
data.tar.gz: 4476cd31d79931fe29635bdd34491b2b90ae1663
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb4c0755690791b5747e2ff4b44bd063088ee7481cced3ae15a4f7dbe19f70ed74837a5c0e90bb4da387be85012169455374dd00b5b3f0464134aad7ff3aa08d
|
7
|
+
data.tar.gz: de0b415c13d960df9bc6fb732a7eecd85b188e081b0123e61edfec37c868ef6a029a69f8dc394c4aa679d9becf29e3c0a50d557b3ba0a08e5d7c7407dfb54dd8
|
data/.travis.yml
CHANGED
@@ -11,22 +11,17 @@ notifications:
|
|
11
11
|
- ljjarvis@gmail.com
|
12
12
|
- knu@idaemons.org
|
13
13
|
rvm:
|
14
|
-
- 1.8.7
|
15
14
|
- 1.9.2
|
16
15
|
- 1.9.3
|
17
16
|
- 2.0.0
|
18
17
|
- ruby-head
|
19
|
-
- jruby-18mode
|
20
18
|
- jruby-19mode
|
21
19
|
- jruby-head
|
22
|
-
- rbx-18mode
|
23
20
|
- rbx-19mode
|
24
21
|
script: rake travis
|
25
22
|
matrix:
|
26
23
|
allow_failures:
|
27
24
|
- rvm: ruby-head
|
28
|
-
- rvm: jruby-18mode
|
29
25
|
- rvm: jruby-19mode
|
30
26
|
- rvm: jruby-head
|
31
|
-
- rvm: rbx-18mode
|
32
27
|
- rvm: rbx-19mode
|
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= Mechanize
|
1
|
+
= Mechanize {<img src="https://secure.travis-ci.org/sparklemotion/mechanize.png?rvm=1.9.3" />}[http://travis-ci.org/sparklemotion/mechanize]
|
2
2
|
|
3
3
|
* http://mechanize.rubyforge.org
|
4
4
|
* https://github.com/sparklemotion/mechanize
|
@@ -13,7 +13,7 @@ a history.
|
|
13
13
|
|
14
14
|
== Dependencies
|
15
15
|
|
16
|
-
* ruby 1.
|
16
|
+
* ruby 1.9.2 or newer
|
17
17
|
* nokogiri[http://nokogiri.rubyforge.org]
|
18
18
|
|
19
19
|
== Support:
|
@@ -28,8 +28,8 @@ The bug tracker is available here:
|
|
28
28
|
|
29
29
|
== Examples
|
30
30
|
|
31
|
-
If you are just starting, check out the GUIDE[http://mechanize.rubyforge.org/GUIDE_rdoc.html]
|
32
|
-
file.
|
31
|
+
If you are just starting, check out the GUIDE[http://mechanize.rubyforge.org/GUIDE_rdoc.html] or
|
32
|
+
the EXAMPLES[http://mechanize.rubyforge.org/EXAMPLES_rdoc.html] file.
|
33
33
|
|
34
34
|
== Developers
|
35
35
|
|
@@ -57,10 +57,11 @@ Copyright (c) 2006-2011:
|
|
57
57
|
* {Aaron Patterson}[http://tenderlovemaking.com] (aaronp@rubyforge.org)
|
58
58
|
* {Mike Dalessio}[http://mike.daless.io] (mike@csa.net)
|
59
59
|
|
60
|
-
Copyright (c) 2011-
|
60
|
+
Copyright (c) 2011-2013:
|
61
61
|
|
62
62
|
* {Eric Hodel}[http://blog.segment7.net] (drbrain@segment7.net)
|
63
63
|
* {Akinori MUSHA}[http://blog.akinori.org] (knu@idaemons.org)
|
64
|
+
* {Lee Jarvis}[http://aeroproof.com] (ljjarvis@gmail.com)
|
64
65
|
|
65
66
|
This library comes with a shameless plug for employing me
|
66
67
|
(Aaron[http://tenderlovemaking.com/]) programming Ruby, my favorite language!
|
data/lib/mechanize.rb
CHANGED
data/lib/mechanize/http/agent.rb
CHANGED
@@ -216,28 +216,22 @@ class Mechanize::HTTP::Agent
|
|
216
216
|
|
217
217
|
def fetch uri, method = :get, headers = {}, params = [],
|
218
218
|
referer = current_page, redirects = 0
|
219
|
-
referer_uri = referer ? referer.uri : nil
|
220
|
-
|
221
|
-
uri = resolve uri, referer
|
222
219
|
|
220
|
+
referer_uri = referer ? referer.uri : nil
|
221
|
+
uri = resolve uri, referer
|
223
222
|
uri, params = resolve_parameters uri, method, params
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
connection = connection_for uri
|
223
|
+
request = http_request uri, method, params
|
224
|
+
connection = connection_for uri
|
228
225
|
|
229
226
|
request_auth request, uri
|
230
|
-
|
231
227
|
disable_keep_alive request
|
232
228
|
enable_gzip request
|
233
|
-
|
234
229
|
request_language_charset request
|
235
230
|
request_cookies request, uri
|
236
231
|
request_host request, uri
|
237
232
|
request_referer request, uri, referer_uri
|
238
233
|
request_user_agent request
|
239
234
|
request_add_headers request, headers
|
240
|
-
|
241
235
|
pre_connect request
|
242
236
|
|
243
237
|
# Consult robots.txt
|
@@ -353,10 +347,12 @@ class Mechanize::HTTP::Agent
|
|
353
347
|
@history.last
|
354
348
|
end
|
355
349
|
|
350
|
+
# Returns the maximum size for the history stack.
|
356
351
|
def max_history
|
357
352
|
@history.max_size
|
358
353
|
end
|
359
354
|
|
355
|
+
# Set the maximum size for the history stack.
|
360
356
|
def max_history=(length)
|
361
357
|
@history.max_size = length
|
362
358
|
end
|
data/lib/mechanize/page/image.rb
CHANGED
@@ -160,9 +160,9 @@ class Mechanize::Page::Image
|
|
160
160
|
def url
|
161
161
|
if relative? then
|
162
162
|
if page.bases[0] then
|
163
|
-
page.bases[0].href + src
|
163
|
+
page.bases[0].href + src.to_s
|
164
164
|
else
|
165
|
-
page.uri + Mechanize::Util.uri_escape(src)
|
165
|
+
page.uri + Mechanize::Util.uri_escape(src.to_s)
|
166
166
|
end
|
167
167
|
else
|
168
168
|
URI Mechanize::Util.uri_escape(src)
|
@@ -180,5 +180,11 @@ class TestMechanizePageImage < Mechanize::TestCase
|
|
180
180
|
assert_equal URI('https://example/'), page.images.first.image_referer.uri
|
181
181
|
end
|
182
182
|
|
183
|
+
def test_no_src_attribute
|
184
|
+
page = html_page '<img width="10" height="10" class="foo" />'
|
185
|
+
page.uri = URI 'https://example/'
|
186
|
+
assert_equal URI('https://example/'), page.images.first.url
|
187
|
+
end
|
188
|
+
|
183
189
|
end
|
184
190
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mechanize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Hodel
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-05-
|
15
|
+
date: 2013-05-27 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: net-http-digest_auth
|