mechanize 2.8.5 → 2.9.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: 6464b4f3e7e1248feaca2b3d335d6e1c079895317d6ceb8e3999924b53d1ace0
4
- data.tar.gz: 16fb65c1b39a57c312ca1a45002c89e266fb2cd8720f4239b98c13ffa3629830
3
+ metadata.gz: 3090de20e06b18db1768b33b3f446a039d69b653002a03fc2576f8f821e996b5
4
+ data.tar.gz: 69f38522fee7861b2c39130a67e168b6b78c0d3d301e6f6d640d5cb175586486
5
5
  SHA512:
6
- metadata.gz: 5d853dddbc85ec4a87d708ea2a970a3cecb11c868da9673f38d75bff6c6449e2b4ec32881fcb4066ee6d53d96812e6620adb9c8bf4a33e825ced05d7890bc057
7
- data.tar.gz: b688fb7da123ee2768dc3f7772dfa943373c80d7e7ce8daeb5ceff772992f6f781db61e71515b24b7efe020180a6990b32aceeb1bcf4750f0328d20c3eced009
6
+ metadata.gz: a11a74bb5118f20cd4a31673f40595882192b8c84d33d6bf6d116e007afe6e369ce7ae7f1dc832f34a94d6dc7a2732c82462351f62b53bdaab0ed6bcf2ea8bd6
7
+ data.tar.gz: 2bc5af7fb18fcdffa84f255777317f1729b454dc3f8539de27ad172991c49c250de457464691d63c85c32006ecb4105137b653f1c78ea948425e54aa562b2b98
@@ -1,5 +1,9 @@
1
1
  name: "ci"
2
2
 
3
+ concurrency:
4
+ group: "${{github.workflow}}-${{github.ref}}"
5
+ cancel-in-progress: true
6
+
3
7
  on:
4
8
  push:
5
9
  branches:
@@ -8,15 +12,17 @@ on:
8
12
  types: [opened, synchronize]
9
13
  branches:
10
14
  - main
15
+ schedule:
16
+ - cron: "0 8 * * 5" # At 08:00 on Friday # https://crontab.guru/#0_8_*_*_5
11
17
 
12
18
  jobs:
13
19
  rubocop:
14
20
  runs-on: ubuntu-latest
15
21
  steps:
16
- - uses: actions/checkout@v2
22
+ - uses: actions/checkout@v3
17
23
  - uses: ruby/setup-ruby@v1
18
24
  with:
19
- ruby-version: "3.1"
25
+ ruby-version: "3.2"
20
26
  bundler-cache: true
21
27
  - run: bundle exec rake rubocop
22
28
 
@@ -25,15 +31,16 @@ jobs:
25
31
  strategy:
26
32
  fail-fast: false
27
33
  matrix:
28
- ruby-version: ["2.5", "2.6", "2.7", "3.0", "3.1", "head", "jruby", "truffleruby-head"]
34
+ ruby-version: ["2.6", "2.7", "3.0", "3.1", "3.2", "head", "jruby-9.4", "truffleruby-head"]
29
35
 
30
36
  runs-on: ubuntu-latest
31
37
  steps:
32
- - uses: actions/checkout@v2
38
+ - uses: actions/checkout@v3
33
39
  - uses: ruby/setup-ruby@v1
34
40
  with:
35
41
  ruby-version: ${{matrix.ruby-version}}
36
42
  bundler-cache: true
43
+ bundler: 2.3.26 # https://github.com/rubygems/rubygems/issues/6435
37
44
  - run: bundle exec rake test
38
45
 
39
46
  test-platform:
@@ -45,9 +52,10 @@ jobs:
45
52
 
46
53
  runs-on: ${{matrix.platform}}
47
54
  steps:
48
- - uses: actions/checkout@v2
55
+ - uses: actions/checkout@v3
49
56
  - uses: ruby/setup-ruby@v1
50
57
  with:
51
- ruby-version: "3.1"
58
+ ruby-version: "3.2"
52
59
  bundler-cache: true
60
+ bundler: latest
53
61
  - run: bundle exec rake test
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Mechanize CHANGELOG
2
2
 
3
+ ## 2.9.1 / 2023-04-17
4
+
5
+ ### Update
6
+
7
+ * Updated User-Agent strings to represent modern browser versions. (#612) Thank you, @takatea!
8
+
9
+
10
+ ## 2.9.0 / 2023-04-07
11
+
12
+ ### Requirements
13
+
14
+ * Mechanize now requires Ruby 2.6 or newer.
15
+
16
+
17
+ ### Improvement
18
+
19
+ * Mechanize can now parse frozen strings. (#610)
20
+
21
+
3
22
  ## 2.8.5 / 2022-06-09
4
23
 
5
24
  ### Security
data/README.md CHANGED
@@ -13,7 +13,7 @@ The Mechanize library is used for automating interaction with websites. Mechaniz
13
13
 
14
14
  ## Dependencies
15
15
 
16
- * Ruby >= 2.5
16
+ * Ruby >= 2.6
17
17
  * Gems:
18
18
  * `addressable`
19
19
  * `domain_name`
@@ -0,0 +1,91 @@
1
+ require 'mechanize'
2
+
3
+ class LatestUAFetcher
4
+ attr_reader :user_agents
5
+
6
+ BASE_URL = 'https://www.whatismybrowser.com/guides/the-latest-user-agent'
7
+
8
+ def initialize
9
+ @agent = Mechanize.new.tap { |a| a.user_agent_alias = 'Mac Firefox' }
10
+ @user_agents = {}
11
+ end
12
+
13
+ def run
14
+ sleep_time = 1
15
+
16
+ puts 'get chrome UA...'
17
+ chrome
18
+ puts "sleeping... (#{sleep_time}s)"
19
+ sleep 1
20
+
21
+ puts 'get firefox UA...'
22
+ firefox
23
+ puts "sleeping... (#{sleep_time}s)"
24
+ sleep 1
25
+
26
+ puts 'get safari UA...'
27
+ safari
28
+ puts "sleeping... (#{sleep_time}s)"
29
+ sleep 1
30
+
31
+ puts 'get edge UA...'
32
+ edge
33
+ end
34
+
35
+ private
36
+
37
+ def edge
38
+ page = @agent.get("#{BASE_URL}/edge")
39
+
40
+ windows_dom = page.css("h2:contains('Latest Edge on Windows User Agents')")
41
+ @user_agents[:edge] = {
42
+ windows: windows_dom.css('+ .listing-of-useragents .code').first.text
43
+ }
44
+ end
45
+
46
+ def firefox
47
+ page = @agent.get("#{BASE_URL}/firefox")
48
+
49
+ desktop_dom = page.css("h2:contains('Latest Firefox on Desktop User Agents')")
50
+ table_dom = desktop_dom.css('+ .listing-of-useragents')
51
+
52
+ @user_agents[:firefox] = {
53
+ windows: table_dom.css('td:contains("Windows")').css('+ td .code').text,
54
+ macOS: table_dom.css('td:contains("Macos")').css('+ td .code').text,
55
+ linux: table_dom.css('td:contains("Linux")').css("+ td .code:contains('Ubuntu; Linux x86_64')").text
56
+ }
57
+ end
58
+
59
+ def safari
60
+ page = @agent.get("#{BASE_URL}/safari")
61
+
62
+ macos_dom = page.css("h2:contains('Latest Safari on macOS User Agents')")
63
+ ios_dom = page.css("h2:contains('Latest Safari on iOS User Agents')")
64
+
65
+ @user_agents[:safari] = {
66
+ mac_os: macos_dom.css('+ .listing-of-useragents .code').first.text,
67
+ iphone: ios_dom.css('+ .listing-of-useragents').css("tr:contains('Iphone') .code").text,
68
+ ipad: ios_dom.css('+ .listing-of-useragents').css("tr:contains('Ipad') .code").text
69
+ }
70
+ end
71
+
72
+ def chrome
73
+ page = @agent.get("#{BASE_URL}/chrome")
74
+
75
+ windows_dom = page.css("h2:contains('Latest Chrome on Windows 10 User Agents')")
76
+ linux_dom = page.css("h2:contains('Latest Chrome on Linux User Agents')")
77
+ macos_dom = page.css("h2:contains('Latest Chrome on macOS User Agents')")
78
+ android_dom = page.css("h2:contains('Latest Chrome on Android User Agents')")
79
+
80
+ @user_agents[:chrome] = {
81
+ windows: windows_dom.css('+ .listing-of-useragents .code').first.text,
82
+ linux: linux_dom.css('+ .listing-of-useragents .code').first.text,
83
+ mac_os: macos_dom.css('+ .listing-of-useragents .code').first.text,
84
+ android: android_dom.css('+ .listing-of-useragents .code').first.text
85
+ }
86
+ end
87
+ end
88
+
89
+ agent = LatestUAFetcher.new
90
+ agent.run
91
+ p agent.user_agents
@@ -58,10 +58,10 @@ class WikipediaLinksToPhilosophy
58
58
  # the article.
59
59
 
60
60
  def follow_first_link
61
- puts @title
61
+ puts "#{@title} (#{@page.uri})"
62
62
 
63
63
  # > p > a rejects italics
64
- links = @page.root.css('.mw-content-ltr > p > a[href^="/wiki/"]')
64
+ links = @page.root.css('.mw-content-ltr p > a[href^="/wiki/"]')
65
65
 
66
66
  # reject disambiguation and special pages, images and files
67
67
  links = links.reject do |link_node|
@@ -74,10 +74,9 @@ class WikipediaLinksToPhilosophy
74
74
 
75
75
  link = links.first
76
76
 
77
- unless link then
78
- # disambiguation page? try the first item in the list
79
- link =
80
- @page.root.css('.mw-content-ltr > ul > li > a[href^="/wiki/"]').first
77
+ if link.nil?
78
+ puts "Could not parse #{@page.uri}"
79
+ exit 1
81
80
  end
82
81
 
83
82
  # convert a Nokogiri HTML element back to a mechanize link
@@ -41,10 +41,6 @@ class Mechanize::Page < Mechanize::File
41
41
  @encodings.concat self.class.response_header_charset(response)
42
42
 
43
43
  if body
44
- # Force the encoding to be 8BIT so we can perform regular expressions.
45
- # We'll set it to the detected encoding later
46
- body.force_encoding(Encoding::ASCII_8BIT)
47
-
48
44
  @encodings.concat self.class.meta_charset body
49
45
 
50
46
  meta_content_type = self.class.meta_content_type body
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  class Mechanize
3
- VERSION = "2.8.5"
3
+ VERSION = "2.9.1"
4
4
  end
data/lib/mechanize.rb CHANGED
@@ -87,54 +87,73 @@ class Mechanize
87
87
  # description in parenthesis is for informative purposes and is not part of
88
88
  # the alias name.
89
89
  #
90
- # * Linux Firefox (43.0 on Ubuntu Linux)
91
- # * Linux Konqueror (3)
92
- # * Linux Mozilla
93
- # * Mac Firefox (43.0)
94
- # * Mac Mozilla
95
- # * Mac Safari (9.0 on OS X 10.11.2)
96
- # * Mac Safari 4
97
- # * Mechanize (default)
98
- # * Windows IE 6
99
- # * Windows IE 7
100
- # * Windows IE 8
101
- # * Windows IE 9
102
- # * Windows IE 10 (Windows 8 64bit)
103
- # * Windows IE 11 (Windows 8.1 64bit)
104
- # * Windows Edge
105
- # * Windows Mozilla
106
- # * Windows Firefox (43.0)
107
- # * iPhone (iOS 9.1)
108
- # * iPad (iOS 9.1)
109
- # * Android (5.1.1)
90
+ # The default User-Agent alias:
91
+ #
92
+ # * "Mechanize"
93
+ #
94
+ # Linux User-Agent aliases:
95
+ #
96
+ # * "Linux Firefox"
97
+ # * "Linux Konqueror"
98
+ # * "Linux Mozilla"
99
+ #
100
+ # Mac User-Agent aliases:
101
+ #
102
+ # * "Mac Firefox"
103
+ # * "Mac Mozilla"
104
+ # * "Mac Safari 4"
105
+ # * "Mac Safari"
106
+ #
107
+ # Windows User-Agent aliases:
108
+ #
109
+ # * "Windows Edge"
110
+ # * "Windows Firefox"
111
+ # * "Windows IE 6"
112
+ # * "Windows IE 7"
113
+ # * "Windows IE 8"
114
+ # * "Windows IE 9"
115
+ # * "Windows IE 10"
116
+ # * "Windows IE 11"
117
+ # * "Windows Mozilla"
118
+ #
119
+ # Mobile User-Agent aliases:
120
+ #
121
+ # * "Android"
122
+ # * "iPad"
123
+ # * "iPhone"
110
124
  #
111
125
  # Example:
112
126
  #
113
127
  # agent = Mechanize.new
114
128
  # agent.user_agent_alias = 'Mac Safari'
115
-
129
+ #
116
130
  AGENT_ALIASES = {
131
+ # TODO: use output from examples/latest_user_agents.rb as the underling data structure
117
132
  'Mechanize' => "Mechanize/#{VERSION} Ruby/#{ruby_version} (http://github.com/sparklemotion/mechanize/)",
118
- 'Linux Firefox' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0',
133
+
134
+ 'Linux Firefox' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:112.0) Gecko/20100101 Firefox/112.0',
119
135
  'Linux Konqueror' => 'Mozilla/5.0 (compatible; Konqueror/3; Linux)',
120
136
  'Linux Mozilla' => 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624',
121
- 'Mac Firefox' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:43.0) Gecko/20100101 Firefox/43.0',
137
+
138
+ 'Mac Firefox' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 13.3; rv:112.0) Gecko/20100101 Firefox/112.0',
122
139
  'Mac Mozilla' => 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4a) Gecko/20030401',
123
140
  'Mac Safari 4' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; de-at) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10',
124
- 'Mac Safari' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9',
125
- 'Windows Chrome' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.125 Safari/537.36',
141
+ 'Mac Safari' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 13_3_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15',
142
+
143
+ 'Windows Chrome' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36',
144
+ 'Windows Edge' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.46',
145
+ 'Windows Firefox' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:112.0) Gecko/20100101 Firefox/112.0',
126
146
  'Windows IE 6' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)',
127
147
  'Windows IE 7' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
128
148
  'Windows IE 8' => 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
129
149
  'Windows IE 9' => 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
130
150
  'Windows IE 10' => 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)',
131
151
  'Windows IE 11' => 'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko',
132
- 'Windows Edge' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586',
133
152
  'Windows Mozilla' => 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6',
134
- 'Windows Firefox' => 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0',
135
- 'iPhone' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B5110e Safari/601.1',
136
- 'iPad' => 'Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1',
137
- 'Android' => 'Mozilla/5.0 (Linux; Android 5.1.1; Nexus 7 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.76 Safari/537.36',
153
+
154
+ 'Android' => 'Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.5615.48 Mobile Safari/537.36',
155
+ 'iPad' => 'Mozilla/5.0 (iPad; CPU OS 16_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Mobile/15E148 Safari/604.1',
156
+ 'iPhone' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Mobile/15E148 Safari/604.1',
138
157
  }
139
158
 
140
159
  AGENT_ALIASES.default_proc = proc { |hash, key|
data/mechanize.gemspec CHANGED
@@ -51,7 +51,7 @@ Gem::Specification.new do |spec|
51
51
  spec.extra_rdoc_files += Dir['*.rdoc', '*.md']
52
52
  spec.rdoc_options = ["--main", "README.md"]
53
53
 
54
- spec.required_ruby_version = ">= 2.5.0"
54
+ spec.required_ruby_version = ">= 2.6.0"
55
55
 
56
56
  spec.add_runtime_dependency("addressable", "~> 2.8")
57
57
  spec.add_runtime_dependency("domain_name", ">= 0.5.20190701", "~> 0.5")
@@ -27,13 +27,10 @@ class TestMechanizeHttpAgent < Mechanize::TestCase
27
27
  realm
28
28
  end
29
29
 
30
- def jruby_zlib?
30
+ def skip_if_jruby_zlib
31
31
  if RUBY_ENGINE == 'jruby'
32
32
  meth = caller[0][/`(\w+)/, 1]
33
- warn "#{meth}: skipped because how Zlib handles error is different in JRuby"
34
- true
35
- else
36
- false
33
+ skip "#{meth}: skipped because how Zlib handles error is different in JRuby"
37
34
  end
38
35
  end
39
36
 
@@ -823,7 +820,11 @@ class TestMechanizeHttpAgent < Mechanize::TestCase
823
820
  @res.instance_variable_set(:@header,
824
821
  'www-authenticate' => ['Negotiate, NTLM'])
825
822
 
826
- page = @agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
823
+ begin
824
+ page = @agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
825
+ rescue OpenSSL::Digest::DigestError
826
+ skip "It looks like OpenSSL is not configured to support MD4"
827
+ end
827
828
 
828
829
  assert_equal 'ok', page.body # lame test
829
830
  end
@@ -931,7 +932,7 @@ class TestMechanizeHttpAgent < Mechanize::TestCase
931
932
  body_io = StringIO.new \
932
933
  "\037\213\b\0002\002\225M\000\003+H,*\001"
933
934
 
934
- skip if jruby_zlib?
935
+ skip_if_jruby_zlib
935
936
 
936
937
  e = assert_raises Mechanize::Error do
937
938
  @agent.response_content_encoding @res, body_io
@@ -965,7 +966,8 @@ class TestMechanizeHttpAgent < Mechanize::TestCase
965
966
 
966
967
  assert_match %r%invalid compressed data -- crc error%, log.string
967
968
  rescue IOError
968
- raise unless jruby_zlib?
969
+ skip_if_jruby_zlib
970
+ raise
969
971
  end
970
972
 
971
973
  def test_response_content_encoding_gzip_checksum_corrupt_length
@@ -983,7 +985,8 @@ class TestMechanizeHttpAgent < Mechanize::TestCase
983
985
 
984
986
  assert_match %r%invalid compressed data -- length error%, log.string
985
987
  rescue IOError
986
- raise unless jruby_zlib?
988
+ skip_if_jruby_zlib
989
+ raise
987
990
  end
988
991
 
989
992
  def test_response_content_encoding_gzip_checksum_truncated
@@ -1001,7 +1004,8 @@ class TestMechanizeHttpAgent < Mechanize::TestCase
1001
1004
 
1002
1005
  assert_match %r%unable to gunzip response: footer is not found%, log.string
1003
1006
  rescue IOError
1004
- raise unless jruby_zlib?
1007
+ skip_if_jruby_zlib
1008
+ raise
1005
1009
  end
1006
1010
 
1007
1011
  def test_response_content_encoding_gzip_empty
@@ -1042,7 +1046,8 @@ class TestMechanizeHttpAgent < Mechanize::TestCase
1042
1046
 
1043
1047
  assert body_io.closed?
1044
1048
  rescue IOError
1045
- raise unless jruby_zlib?
1049
+ skip_if_jruby_zlib
1050
+ raise
1046
1051
  end
1047
1052
 
1048
1053
  def test_response_content_encoding_none
@@ -276,5 +276,19 @@ class TestMechanizePage < Mechanize::TestCase
276
276
  assert_equal page.title, "HTML>TITLE"
277
277
  end
278
278
 
279
+ def test_frozen_string_body
280
+ html = (<<~HTML).freeze
281
+ <html>
282
+ <head>
283
+ <title>Page Title</title>
284
+ </head>
285
+ <body>
286
+ <p>Hello World</p>
287
+ </body>
288
+ </html>
289
+ HTML
290
+
291
+ html_page(html) # refute_raises
292
+ end
279
293
  end
280
294
 
@@ -51,13 +51,10 @@ class TestMechanizePageLink < Mechanize::TestCase
51
51
  Mechanize::Page.new @uri, res, body && body.force_encoding(Encoding::BINARY), 200, @mech
52
52
  end
53
53
 
54
- def nkf_dependency?
55
- if RUBY_ENGINE == 'ruby'
56
- false
57
- else
54
+ def skip_if_nkf_dependency
55
+ if RUBY_ENGINE == 'jruby'
58
56
  meth = caller[0][/`(\w+)/, 1]
59
- warn "#{meth}: skipped because this feature currently depends on NKF"
60
- true
57
+ skip "#{meth}: skipped because this feature currently depends on NKF"
61
58
  end
62
59
  end
63
60
 
@@ -112,7 +109,7 @@ class TestMechanizePageLink < Mechanize::TestCase
112
109
  end
113
110
 
114
111
  def test_encoding_charset_after_title_bad
115
- return if nkf_dependency?
112
+ skip_if_nkf_dependency
116
113
 
117
114
  page = util_page UTF8
118
115
 
@@ -122,7 +119,7 @@ class TestMechanizePageLink < Mechanize::TestCase
122
119
  end
123
120
 
124
121
  def test_encoding_charset_after_title_double_bad
125
- return if nkf_dependency?
122
+ skip_if_nkf_dependency
126
123
 
127
124
  page = util_page SJIS_BAD_AFTER_TITLE
128
125
 
@@ -132,7 +129,7 @@ class TestMechanizePageLink < Mechanize::TestCase
132
129
  end
133
130
 
134
131
  def test_encoding_charset_bad
135
- return if nkf_dependency?
132
+ skip_if_nkf_dependency
136
133
 
137
134
  page = util_page "<title>#{UTF8_TITLE}</title>"
138
135
  page.encodings.replace %w[
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.8.5
4
+ version: 2.9.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: 2022-06-09 00:00:00.000000000 Z
15
+ date: 2023-04-17 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: addressable
@@ -279,6 +279,7 @@ files:
279
279
  - README.md
280
280
  - Rakefile
281
281
  - examples/flickr_upload.rb
282
+ - examples/latest_user_agents.rb
282
283
  - examples/mech-dump.rb
283
284
  - examples/proxy_req.rb
284
285
  - examples/rubygems.rb
@@ -495,14 +496,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
495
496
  requirements:
496
497
  - - ">="
497
498
  - !ruby/object:Gem::Version
498
- version: 2.5.0
499
+ version: 2.6.0
499
500
  required_rubygems_version: !ruby/object:Gem::Requirement
500
501
  requirements:
501
502
  - - ">="
502
503
  - !ruby/object:Gem::Version
503
504
  version: '0'
504
505
  requirements: []
505
- rubygems_version: 3.3.5
506
+ rubygems_version: 3.4.10
506
507
  signing_key:
507
508
  specification_version: 4
508
509
  summary: The Mechanize library is used for automating interaction with websites