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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 697096d6b8d2bd29662a4a9e2241b5bc22ccb70d
4
- data.tar.gz: 1a4348dbc2f838ee019917249e7f0c4348035a9a
3
+ metadata.gz: a97a6fd7fb8b0c358b45a7f457fb0e6fa3878e41
4
+ data.tar.gz: 4476cd31d79931fe29635bdd34491b2b90ae1663
5
5
  SHA512:
6
- metadata.gz: 3a9802905e414093174c09110703e042cde32de5abfde18c8f7bd1d02b6f414dda4dfb897792a7e7201fa3ed52923fdbeb777059ca6075d7c9bb0469cad96cbb
7
- data.tar.gz: 5f93e7092082c7cd7c33701e566f621299f4604360e85a61e9f900cb9f81a8971ebf2a2e21cdeeb9e00f9bf582b7bc8db7252fe4dea180e6ace8dc04523f466f
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
@@ -1,5 +1,10 @@
1
1
  = Mechanize CHANGELOG
2
2
 
3
+ === 2.7.1
4
+
5
+ * Bug fix
6
+ * Ensure images with no "src" attribute still return correct URLs. #317
7
+
3
8
  === 2.7.0
4
9
 
5
10
  * New Features
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.8.7, 1.9.2, 1.9.3, or 2.0.0
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]. Also, check out the EXAMPLES[http://mechanize.rubyforge.org/EXAMPLES_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-2012:
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
@@ -73,7 +73,7 @@ class Mechanize
73
73
  ##
74
74
  # The version of Mechanize you are using.
75
75
 
76
- VERSION = '2.7.0'
76
+ VERSION = '2.7.1'
77
77
 
78
78
  ##
79
79
  # Base mechanize error class
@@ -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
- request = http_request uri, method, params
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
@@ -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.0
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-21 00:00:00.000000000 Z
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