mechanize 2.7.3 → 2.7.4

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.

Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +15 -0
  3. data/.travis.yml +5 -6
  4. data/CHANGELOG.rdoc +22 -0
  5. data/EXAMPLES.rdoc +1 -1
  6. data/Gemfile +3 -0
  7. data/Manifest.txt +0 -1
  8. data/README.rdoc +11 -17
  9. data/Rakefile +22 -38
  10. data/examples/{rubyforge.rb → rubygems.rb} +5 -4
  11. data/lib/mechanize.rb +72 -31
  12. data/lib/mechanize/directory_saver.rb +14 -2
  13. data/lib/mechanize/element_matcher.rb +24 -13
  14. data/lib/mechanize/file_response.rb +1 -3
  15. data/lib/mechanize/form.rb +8 -2
  16. data/lib/mechanize/http/agent.rb +38 -30
  17. data/lib/mechanize/http/auth_store.rb +2 -0
  18. data/lib/mechanize/http/www_authenticate_parser.rb +1 -1
  19. data/lib/mechanize/page.rb +162 -54
  20. data/lib/mechanize/page/image.rb +2 -0
  21. data/lib/mechanize/page/link.rb +5 -0
  22. data/lib/mechanize/pluggable_parsers.rb +13 -1
  23. data/lib/mechanize/test_case.rb +5 -0
  24. data/lib/mechanize/unsupported_scheme_error.rb +4 -2
  25. data/lib/mechanize/util.rb +88 -43
  26. data/lib/mechanize/version.rb +3 -0
  27. data/mechanize.gemspec +61 -0
  28. data/test/test_mechanize.rb +55 -41
  29. data/test/test_mechanize_form.rb +19 -0
  30. data/test/test_mechanize_form_encoding.rb +2 -7
  31. data/test/test_mechanize_http_agent.rb +61 -12
  32. data/test/test_mechanize_http_www_authenticate_parser.rb +8 -0
  33. data/test/test_mechanize_link.rb +14 -1
  34. data/test/test_mechanize_page.rb +53 -6
  35. data/test/test_mechanize_page_encoding.rb +2 -3
  36. data/test/test_mechanize_page_link.rb +17 -2
  37. data/test/test_mechanize_util.rb +45 -10
  38. metadata +147 -72
  39. data/.gemtest +0 -0
  40. data/lib/mechanize/monkey_patch.rb +0 -17
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.3
4
+ version: 2.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -12,192 +12,212 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-11-14 00:00:00.000000000 Z
15
+ date: 2015-12-31 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: net-http-digest_auth
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - ~>
22
- - !ruby/object:Gem::Version
23
- version: '1.1'
24
- - - '>='
21
+ - - ">="
25
22
  - !ruby/object:Gem::Version
26
23
  version: 1.1.1
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
27
27
  type: :runtime
28
28
  prerelease: false
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
32
- - !ruby/object:Gem::Version
33
- version: '1.1'
34
- - - '>='
31
+ - - ">="
35
32
  - !ruby/object:Gem::Version
36
33
  version: 1.1.1
34
+ - - "~>"
35
+ - !ruby/object:Gem::Version
36
+ version: '1.1'
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: net-http-persistent
39
39
  requirement: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ~>
42
- - !ruby/object:Gem::Version
43
- version: '2.5'
44
- - - '>='
41
+ - - ">="
45
42
  - !ruby/object:Gem::Version
46
43
  version: 2.5.2
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '2.5'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ~>
52
- - !ruby/object:Gem::Version
53
- version: '2.5'
54
- - - '>='
51
+ - - ">="
55
52
  - !ruby/object:Gem::Version
56
53
  version: 2.5.2
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '2.5'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: mime-types
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ~>
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 1.17.2
64
+ - - "<"
62
65
  - !ruby/object:Gem::Version
63
- version: '2.0'
66
+ version: '3'
64
67
  type: :runtime
65
68
  prerelease: false
66
69
  version_requirements: !ruby/object:Gem::Requirement
67
70
  requirements:
68
- - - ~>
71
+ - - ">="
69
72
  - !ruby/object:Gem::Version
70
- version: '2.0'
73
+ version: 1.17.2
74
+ - - "<"
75
+ - !ruby/object:Gem::Version
76
+ version: '3'
71
77
  - !ruby/object:Gem::Dependency
72
78
  name: http-cookie
73
79
  requirement: !ruby/object:Gem::Requirement
74
80
  requirements:
75
- - - ~>
81
+ - - "~>"
76
82
  - !ruby/object:Gem::Version
77
83
  version: '1.0'
78
84
  type: :runtime
79
85
  prerelease: false
80
86
  version_requirements: !ruby/object:Gem::Requirement
81
87
  requirements:
82
- - - ~>
88
+ - - "~>"
83
89
  - !ruby/object:Gem::Version
84
90
  version: '1.0'
85
91
  - !ruby/object:Gem::Dependency
86
92
  name: nokogiri
87
93
  requirement: !ruby/object:Gem::Requirement
88
94
  requirements:
89
- - - ~>
95
+ - - "~>"
90
96
  - !ruby/object:Gem::Version
91
- version: '1.4'
97
+ version: '1.6'
92
98
  type: :runtime
93
99
  prerelease: false
94
100
  version_requirements: !ruby/object:Gem::Requirement
95
101
  requirements:
96
- - - ~>
102
+ - - "~>"
97
103
  - !ruby/object:Gem::Version
98
- version: '1.4'
104
+ version: '1.6'
99
105
  - !ruby/object:Gem::Dependency
100
106
  name: ntlm-http
101
107
  requirement: !ruby/object:Gem::Requirement
102
108
  requirements:
103
- - - ~>
104
- - !ruby/object:Gem::Version
105
- version: '0.1'
106
- - - '>='
109
+ - - ">="
107
110
  - !ruby/object:Gem::Version
108
111
  version: 0.1.1
112
+ - - "~>"
113
+ - !ruby/object:Gem::Version
114
+ version: '0.1'
109
115
  type: :runtime
110
116
  prerelease: false
111
117
  version_requirements: !ruby/object:Gem::Requirement
112
118
  requirements:
113
- - - ~>
114
- - !ruby/object:Gem::Version
115
- version: '0.1'
116
- - - '>='
119
+ - - ">="
117
120
  - !ruby/object:Gem::Version
118
121
  version: 0.1.1
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.1'
119
125
  - !ruby/object:Gem::Dependency
120
126
  name: webrobots
121
127
  requirement: !ruby/object:Gem::Requirement
122
128
  requirements:
123
- - - <
129
+ - - "<"
124
130
  - !ruby/object:Gem::Version
125
131
  version: '0.2'
126
- - - '>='
132
+ - - ">="
127
133
  - !ruby/object:Gem::Version
128
134
  version: 0.0.9
129
135
  type: :runtime
130
136
  prerelease: false
131
137
  version_requirements: !ruby/object:Gem::Requirement
132
138
  requirements:
133
- - - <
139
+ - - "<"
134
140
  - !ruby/object:Gem::Version
135
141
  version: '0.2'
136
- - - '>='
142
+ - - ">="
137
143
  - !ruby/object:Gem::Version
138
144
  version: 0.0.9
139
145
  - !ruby/object:Gem::Dependency
140
146
  name: domain_name
141
147
  requirement: !ruby/object:Gem::Requirement
142
148
  requirements:
143
- - - ~>
144
- - !ruby/object:Gem::Version
145
- version: '0.5'
146
- - - '>='
149
+ - - ">="
147
150
  - !ruby/object:Gem::Version
148
151
  version: 0.5.1
152
+ - - "~>"
153
+ - !ruby/object:Gem::Version
154
+ version: '0.5'
149
155
  type: :runtime
150
156
  prerelease: false
151
157
  version_requirements: !ruby/object:Gem::Requirement
152
158
  requirements:
153
- - - ~>
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ version: 0.5.1
162
+ - - "~>"
154
163
  - !ruby/object:Gem::Version
155
164
  version: '0.5'
156
- - - '>='
165
+ - !ruby/object:Gem::Dependency
166
+ name: rake
167
+ requirement: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - ">="
157
170
  - !ruby/object:Gem::Version
158
- version: 0.5.1
171
+ version: '0'
172
+ type: :development
173
+ prerelease: false
174
+ version_requirements: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
159
179
  - !ruby/object:Gem::Dependency
160
- name: minitest
180
+ name: bundler
161
181
  requirement: !ruby/object:Gem::Requirement
162
182
  requirements:
163
- - - ~>
183
+ - - "~>"
164
184
  - !ruby/object:Gem::Version
165
- version: '5.0'
185
+ version: '1.3'
166
186
  type: :development
167
187
  prerelease: false
168
188
  version_requirements: !ruby/object:Gem::Requirement
169
189
  requirements:
170
- - - ~>
190
+ - - "~>"
171
191
  - !ruby/object:Gem::Version
172
- version: '5.0'
192
+ version: '1.3'
173
193
  - !ruby/object:Gem::Dependency
174
194
  name: rdoc
175
195
  requirement: !ruby/object:Gem::Requirement
176
196
  requirements:
177
- - - ~>
197
+ - - "~>"
178
198
  - !ruby/object:Gem::Version
179
199
  version: '4.0'
180
200
  type: :development
181
201
  prerelease: false
182
202
  version_requirements: !ruby/object:Gem::Requirement
183
203
  requirements:
184
- - - ~>
204
+ - - "~>"
185
205
  - !ruby/object:Gem::Version
186
206
  version: '4.0'
187
207
  - !ruby/object:Gem::Dependency
188
- name: hoe
208
+ name: minitest
189
209
  requirement: !ruby/object:Gem::Requirement
190
210
  requirements:
191
- - - ~>
211
+ - - "~>"
192
212
  - !ruby/object:Gem::Version
193
- version: '3.7'
213
+ version: '5.0'
194
214
  type: :development
195
215
  prerelease: false
196
216
  version_requirements: !ruby/object:Gem::Requirement
197
217
  requirements:
198
- - - ~>
218
+ - - "~>"
199
219
  - !ruby/object:Gem::Version
200
- version: '3.7'
220
+ version: '5.0'
201
221
  description: |-
202
222
  The Mechanize library is used for automating interaction with websites.
203
223
  Mechanize automatically stores and sends cookies, follows redirects,
@@ -217,14 +237,15 @@ extra_rdoc_files:
217
237
  - EXAMPLES.rdoc
218
238
  - GUIDE.rdoc
219
239
  - LICENSE.rdoc
220
- - Manifest.txt
221
240
  - README.rdoc
222
241
  files:
223
- - .autotest
224
- - .travis.yml
242
+ - ".autotest"
243
+ - ".gitignore"
244
+ - ".travis.yml"
225
245
  - CHANGELOG.rdoc
226
246
  - EXAMPLES.rdoc
227
247
  - GUIDE.rdoc
248
+ - Gemfile
228
249
  - LICENSE.rdoc
229
250
  - Manifest.txt
230
251
  - README.rdoc
@@ -232,7 +253,7 @@ files:
232
253
  - examples/flickr_upload.rb
233
254
  - examples/mech-dump.rb
234
255
  - examples/proxy_req.rb
235
- - examples/rubyforge.rb
256
+ - examples/rubygems.rb
236
257
  - examples/spider.rb
237
258
  - examples/wikipedia_links_to_philosophy.rb
238
259
  - lib/mechanize.rb
@@ -275,7 +296,6 @@ files:
275
296
  - lib/mechanize/http/content_disposition_parser.rb
276
297
  - lib/mechanize/http/www_authenticate_parser.rb
277
298
  - lib/mechanize/image.rb
278
- - lib/mechanize/monkey_patch.rb
279
299
  - lib/mechanize/page.rb
280
300
  - lib/mechanize/page/base.rb
281
301
  - lib/mechanize/page/frame.rb
@@ -323,7 +343,9 @@ files:
323
343
  - lib/mechanize/unauthorized_error.rb
324
344
  - lib/mechanize/unsupported_scheme_error.rb
325
345
  - lib/mechanize/util.rb
346
+ - lib/mechanize/version.rb
326
347
  - lib/mechanize/xml_file.rb
348
+ - mechanize.gemspec
327
349
  - test/data/htpasswd
328
350
  - test/data/server.crt
329
351
  - test/data/server.csr
@@ -425,34 +447,86 @@ files:
425
447
  - test/test_mechanize_util.rb
426
448
  - test/test_mechanize_xml_file.rb
427
449
  - test/test_multi_select.rb
428
- - .gemtest
429
- homepage: http://mechanize.rubyforge.org
450
+ homepage: http://docs.seattlerb.org/mechanize/
430
451
  licenses:
431
452
  - MIT
432
453
  metadata: {}
433
454
  post_install_message:
434
455
  rdoc_options:
435
- - --main
456
+ - "--main"
436
457
  - README.rdoc
437
458
  require_paths:
438
459
  - lib
439
460
  required_ruby_version: !ruby/object:Gem::Requirement
440
461
  requirements:
441
- - - '>='
462
+ - - ">="
442
463
  - !ruby/object:Gem::Version
443
- version: 1.8.7
464
+ version: 1.9.2
444
465
  required_rubygems_version: !ruby/object:Gem::Requirement
445
466
  requirements:
446
- - - '>='
467
+ - - ">="
447
468
  - !ruby/object:Gem::Version
448
469
  version: '0'
449
470
  requirements: []
450
- rubyforge_project: mechanize
451
- rubygems_version: 2.0.2
471
+ rubyforge_project:
472
+ rubygems_version: 2.4.6
452
473
  signing_key:
453
474
  specification_version: 4
454
475
  summary: The Mechanize library is used for automating interaction with websites
455
476
  test_files:
477
+ - test/data/htpasswd
478
+ - test/data/server.crt
479
+ - test/data/server.csr
480
+ - test/data/server.key
481
+ - test/data/server.pem
482
+ - test/htdocs/alt_text.html
483
+ - test/htdocs/bad_form_test.html
484
+ - test/htdocs/button.jpg
485
+ - test/htdocs/canonical_uri.html
486
+ - test/htdocs/dir with spaces/foo.html
487
+ - test/htdocs/empty_form.html
488
+ - test/htdocs/file_upload.html
489
+ - test/htdocs/find_link.html
490
+ - test/htdocs/form_multi_select.html
491
+ - test/htdocs/form_multival.html
492
+ - test/htdocs/form_no_action.html
493
+ - test/htdocs/form_no_input_name.html
494
+ - test/htdocs/form_order_test.html
495
+ - test/htdocs/form_select.html
496
+ - test/htdocs/form_set_fields.html
497
+ - test/htdocs/form_test.html
498
+ - test/htdocs/frame_referer_test.html
499
+ - test/htdocs/frame_test.html
500
+ - test/htdocs/google.html
501
+ - test/htdocs/index.html
502
+ - test/htdocs/link with space.html
503
+ - test/htdocs/meta_cookie.html
504
+ - test/htdocs/no_title_test.html
505
+ - test/htdocs/noindex.html
506
+ - test/htdocs/rails_3_encoding_hack_form_test.html
507
+ - test/htdocs/relative/tc_relative_links.html
508
+ - test/htdocs/robots.html
509
+ - test/htdocs/robots.txt
510
+ - test/htdocs/tc_bad_charset.html
511
+ - test/htdocs/tc_bad_links.html
512
+ - test/htdocs/tc_base_link.html
513
+ - test/htdocs/tc_blank_form.html
514
+ - test/htdocs/tc_charset.html
515
+ - test/htdocs/tc_checkboxes.html
516
+ - test/htdocs/tc_encoded_links.html
517
+ - test/htdocs/tc_field_precedence.html
518
+ - test/htdocs/tc_follow_meta.html
519
+ - test/htdocs/tc_follow_meta_loop_1.html
520
+ - test/htdocs/tc_follow_meta_loop_2.html
521
+ - test/htdocs/tc_form_action.html
522
+ - test/htdocs/tc_links.html
523
+ - test/htdocs/tc_meta_in_body.html
524
+ - test/htdocs/tc_pretty_print.html
525
+ - test/htdocs/tc_referer.html
526
+ - test/htdocs/tc_relative_links.html
527
+ - test/htdocs/tc_textarea.html
528
+ - test/htdocs/test_click.html
529
+ - test/htdocs/unusual______.html
456
530
  - test/test_mechanize.rb
457
531
  - test/test_mechanize_cookie.rb
458
532
  - test/test_mechanize_cookie_jar.rb
@@ -501,3 +575,4 @@ test_files:
501
575
  - test/test_mechanize_util.rb
502
576
  - test/test_mechanize_xml_file.rb
503
577
  - test/test_multi_select.rb
578
+ has_rdoc:
data/.gemtest DELETED
File without changes
@@ -1,17 +0,0 @@
1
- module Net # :nodoc:
2
- end
3
-
4
- class Net::HTTP # :nodoc:
5
- alias old_keep_alive? keep_alive?
6
-
7
- def keep_alive?(req, res)
8
- return false if /close/i =~ req['connection'].to_s
9
- return false if @seems_1_0_server
10
- return false if /close/i =~ res['connection'].to_s
11
- return true if /keep-alive/i =~ res['connection'].to_s
12
- return false if /close/i =~ res['proxy-connection'].to_s
13
- return true if /keep-alive/i =~ res['proxy-connection'].to_s
14
- (@curr_http_version == '1.1')
15
- end
16
- end if RUBY_VERSION < '1.9'
17
-