addressable 2.8.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # encoding:utf-8
4
3
  #--
5
4
  # Copyright (C) Bob Aman
6
5
  #
@@ -23,7 +22,7 @@ if !defined?(Addressable::VERSION)
23
22
  module Addressable
24
23
  module VERSION
25
24
  MAJOR = 2
26
- MINOR = 8
25
+ MINOR = 9
27
26
  TINY = 0
28
27
 
29
28
  STRING = [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: addressable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Aman
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-07-03 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: public_suffix
@@ -19,7 +18,7 @@ dependencies:
19
18
  version: 2.0.2
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
- version: '5.0'
21
+ version: '8.0'
23
22
  type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,27 +28,7 @@ dependencies:
29
28
  version: 2.0.2
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
- version: '5.0'
33
- - !ruby/object:Gem::Dependency
34
- name: bundler
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: '1.0'
40
- - - "<"
41
- - !ruby/object:Gem::Version
42
- version: '3.0'
43
- type: :development
44
- prerelease: false
45
- version_requirements: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: '1.0'
50
- - - "<"
51
- - !ruby/object:Gem::Version
52
- version: '3.0'
31
+ version: '8.0'
53
32
  description: |
54
33
  Addressable is an alternative implementation to the URI implementation that is
55
34
  part of Ruby's standard library. It is flexible, offers heuristic parsing, and
@@ -61,12 +40,8 @@ extra_rdoc_files:
61
40
  - README.md
62
41
  files:
63
42
  - CHANGELOG.md
64
- - Gemfile
65
43
  - LICENSE.txt
66
44
  - README.md
67
- - Rakefile
68
- - addressable.gemspec
69
- - data/unicode.data
70
45
  - lib/addressable.rb
71
46
  - lib/addressable/idna.rb
72
47
  - lib/addressable/idna/native.rb
@@ -74,24 +49,11 @@ files:
74
49
  - lib/addressable/template.rb
75
50
  - lib/addressable/uri.rb
76
51
  - lib/addressable/version.rb
77
- - spec/addressable/idna_spec.rb
78
- - spec/addressable/net_http_compat_spec.rb
79
- - spec/addressable/security_spec.rb
80
- - spec/addressable/template_spec.rb
81
- - spec/addressable/uri_spec.rb
82
- - spec/spec_helper.rb
83
- - tasks/clobber.rake
84
- - tasks/gem.rake
85
- - tasks/git.rake
86
- - tasks/metrics.rake
87
- - tasks/profile.rake
88
- - tasks/rspec.rake
89
- - tasks/yard.rake
90
52
  homepage: https://github.com/sporkmonger/addressable
91
53
  licenses:
92
54
  - Apache-2.0
93
- metadata: {}
94
- post_install_message:
55
+ metadata:
56
+ changelog_uri: https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md#v2.9.0
95
57
  rdoc_options:
96
58
  - "--main"
97
59
  - README.md
@@ -101,15 +63,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
63
  requirements:
102
64
  - - ">="
103
65
  - !ruby/object:Gem::Version
104
- version: '2.0'
66
+ version: '2.2'
105
67
  required_rubygems_version: !ruby/object:Gem::Requirement
106
68
  requirements:
107
69
  - - ">="
108
70
  - !ruby/object:Gem::Version
109
71
  version: '0'
110
72
  requirements: []
111
- rubygems_version: 3.0.3
112
- signing_key:
73
+ rubygems_version: 4.0.6
113
74
  specification_version: 4
114
75
  summary: URI Implementation
115
76
  test_files: []
data/Gemfile DELETED
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec(path: __FILE__ == "(eval)" ? ".." : ".")
6
-
7
- group :test do
8
- gem 'rspec', '~> 3.8'
9
- gem 'rspec-its', '~> 1.3'
10
- end
11
-
12
- group :coverage do
13
- gem "coveralls", "> 0.7", require: false, platforms: :mri
14
- gem "simplecov", require: false
15
- end
16
-
17
- group :development do
18
- gem 'launchy', '~> 2.4', '>= 2.4.3'
19
- gem 'redcarpet', :platform => :mri_19
20
- gem 'yard'
21
- end
22
-
23
- group :test, :development do
24
- gem 'memory_profiler'
25
- gem "rake", ">= 12.3.3"
26
- end
27
-
28
- gem "idn-ruby", platform: :mri
data/Rakefile DELETED
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rubygems'
4
- require 'rake'
5
-
6
- require File.join(File.dirname(__FILE__), 'lib', 'addressable', 'version')
7
-
8
- PKG_DISPLAY_NAME = 'Addressable'
9
- PKG_NAME = PKG_DISPLAY_NAME.downcase
10
- PKG_VERSION = Addressable::VERSION::STRING
11
- PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12
-
13
- RELEASE_NAME = "REL #{PKG_VERSION}"
14
-
15
- PKG_SUMMARY = "URI Implementation"
16
- PKG_DESCRIPTION = <<-TEXT
17
- Addressable is an alternative implementation to the URI implementation that is
18
- part of Ruby's standard library. It is flexible, offers heuristic parsing, and
19
- additionally provides extensive support for IRIs and URI templates.
20
- TEXT
21
-
22
- PKG_FILES = FileList[
23
- "lib/**/*", "spec/**/*", "vendor/**/*", "data/**/*",
24
- "tasks/**/*",
25
- "[A-Z]*", "Rakefile"
26
- ].exclude(/pkg/).exclude(/database\.yml/).
27
- exclude(/Gemfile\.lock/).exclude(/[_\.]git$/)
28
-
29
- task :default => "spec"
30
-
31
- WINDOWS = (RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/) rescue false
32
- SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
33
-
34
- Dir['tasks/**/*.rake'].each { |rake| load rake }
data/addressable.gemspec DELETED
@@ -1,37 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- # stub: addressable 2.8.0 ruby lib
3
-
4
- Gem::Specification.new do |s|
5
- s.name = "addressable".freeze
6
- s.version = "2.8.0"
7
-
8
- s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
- s.require_paths = ["lib".freeze]
10
- s.authors = ["Bob Aman".freeze]
11
- s.date = "2021-07-03"
12
- s.description = "Addressable is an alternative implementation to the URI implementation that is\npart of Ruby's standard library. It is flexible, offers heuristic parsing, and\nadditionally provides extensive support for IRIs and URI templates.\n".freeze
13
- s.email = "bob@sporkmonger.com".freeze
14
- s.extra_rdoc_files = ["README.md".freeze]
15
- s.files = ["CHANGELOG.md".freeze, "Gemfile".freeze, "LICENSE.txt".freeze, "README.md".freeze, "Rakefile".freeze, "addressable.gemspec".freeze, "data/unicode.data".freeze, "lib/addressable.rb".freeze, "lib/addressable/idna.rb".freeze, "lib/addressable/idna/native.rb".freeze, "lib/addressable/idna/pure.rb".freeze, "lib/addressable/template.rb".freeze, "lib/addressable/uri.rb".freeze, "lib/addressable/version.rb".freeze, "spec/addressable/idna_spec.rb".freeze, "spec/addressable/net_http_compat_spec.rb".freeze, "spec/addressable/security_spec.rb".freeze, "spec/addressable/template_spec.rb".freeze, "spec/addressable/uri_spec.rb".freeze, "spec/spec_helper.rb".freeze, "tasks/clobber.rake".freeze, "tasks/gem.rake".freeze, "tasks/git.rake".freeze, "tasks/metrics.rake".freeze, "tasks/profile.rake".freeze, "tasks/rspec.rake".freeze, "tasks/yard.rake".freeze]
16
- s.homepage = "https://github.com/sporkmonger/addressable".freeze
17
- s.licenses = ["Apache-2.0".freeze]
18
- s.rdoc_options = ["--main".freeze, "README.md".freeze]
19
- s.required_ruby_version = Gem::Requirement.new(">= 2.0".freeze)
20
- s.rubygems_version = "3.0.3".freeze
21
- s.summary = "URI Implementation".freeze
22
-
23
- if s.respond_to? :specification_version then
24
- s.specification_version = 4
25
-
26
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
27
- s.add_runtime_dependency(%q<public_suffix>.freeze, [">= 2.0.2", "< 5.0"])
28
- s.add_development_dependency(%q<bundler>.freeze, [">= 1.0", "< 3.0"])
29
- else
30
- s.add_dependency(%q<public_suffix>.freeze, [">= 2.0.2", "< 5.0"])
31
- s.add_dependency(%q<bundler>.freeze, [">= 1.0", "< 3.0"])
32
- end
33
- else
34
- s.add_dependency(%q<public_suffix>.freeze, [">= 2.0.2", "< 5.0"])
35
- s.add_dependency(%q<bundler>.freeze, [">= 1.0", "< 3.0"])
36
- end
37
- end
data/data/unicode.data DELETED
Binary file
@@ -1,302 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # coding: utf-8
4
- # Copyright (C) Bob Aman
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
-
18
-
19
- require "spec_helper"
20
-
21
- # Have to use RubyGems to load the idn gem.
22
- require "rubygems"
23
-
24
- require "addressable/idna"
25
-
26
- shared_examples_for "converting from unicode to ASCII" do
27
- it "should convert 'www.google.com' correctly" do
28
- expect(Addressable::IDNA.to_ascii("www.google.com")).to eq("www.google.com")
29
- end
30
-
31
- long = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com'
32
- it "should convert '#{long}' correctly" do
33
- expect(Addressable::IDNA.to_ascii(long)).to eq(long)
34
- end
35
-
36
- it "should convert 'www.詹姆斯.com' correctly" do
37
- expect(Addressable::IDNA.to_ascii(
38
- "www.詹姆斯.com"
39
- )).to eq("www.xn--8ws00zhy3a.com")
40
- end
41
-
42
- it "should convert 'www.Iñtërnâtiônàlizætiøn.com' correctly" do
43
- "www.Iñtërnâtiônàlizætiøn.com"
44
- expect(Addressable::IDNA.to_ascii(
45
- "www.I\xC3\xB1t\xC3\xABrn\xC3\xA2ti\xC3\xB4" +
46
- "n\xC3\xA0liz\xC3\xA6ti\xC3\xB8n.com"
47
- )).to eq("www.xn--itrntinliztin-vdb0a5exd8ewcye.com")
48
- end
49
-
50
- it "should convert 'www.Iñtërnâtiônàlizætiøn.com' correctly" do
51
- expect(Addressable::IDNA.to_ascii(
52
- "www.In\xCC\x83te\xCC\x88rna\xCC\x82tio\xCC\x82n" +
53
- "a\xCC\x80liz\xC3\xA6ti\xC3\xB8n.com"
54
- )).to eq("www.xn--itrntinliztin-vdb0a5exd8ewcye.com")
55
- end
56
-
57
- it "should convert " +
58
- "'www.ほんとうにながいわけのわからないどめいんめいのらべるまだながくしないとたりない.w3.mag.keio.ac.jp' " +
59
- "correctly" do
60
- expect(Addressable::IDNA.to_ascii(
61
- "www.\343\201\273\343\202\223\343\201\250\343\201\206\343\201\253\343" +
62
- "\201\252\343\201\214\343\201\204\343\202\217\343\201\221\343\201\256" +
63
- "\343\202\217\343\201\213\343\202\211\343\201\252\343\201\204\343\201" +
64
- "\251\343\202\201\343\201\204\343\202\223\343\202\201\343\201\204\343" +
65
- "\201\256\343\202\211\343\201\271\343\202\213\343\201\276\343\201\240" +
66
- "\343\201\252\343\201\214\343\201\217\343\201\227\343\201\252\343\201" +
67
- "\204\343\201\250\343\201\237\343\202\212\343\201\252\343\201\204." +
68
- "w3.mag.keio.ac.jp"
69
- )).to eq(
70
- "www.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3" +
71
- "fg11amb5gzdb4wi9bya3kc6lra.w3.mag.keio.ac.jp"
72
- )
73
- end
74
-
75
- it "should convert " +
76
- "'www.ほんとうにながいわけのわからないどめいんめいのらべるまだながくしないとたりない.w3.mag.keio.ac.jp' " +
77
- "correctly" do
78
- expect(Addressable::IDNA.to_ascii(
79
- "www.\343\201\273\343\202\223\343\201\250\343\201\206\343\201\253\343" +
80
- "\201\252\343\201\213\343\202\231\343\201\204\343\202\217\343\201\221" +
81
- "\343\201\256\343\202\217\343\201\213\343\202\211\343\201\252\343\201" +
82
- "\204\343\201\250\343\202\231\343\202\201\343\201\204\343\202\223\343" +
83
- "\202\201\343\201\204\343\201\256\343\202\211\343\201\270\343\202\231" +
84
- "\343\202\213\343\201\276\343\201\237\343\202\231\343\201\252\343\201" +
85
- "\213\343\202\231\343\201\217\343\201\227\343\201\252\343\201\204\343" +
86
- "\201\250\343\201\237\343\202\212\343\201\252\343\201\204." +
87
- "w3.mag.keio.ac.jp"
88
- )).to eq(
89
- "www.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3" +
90
- "fg11amb5gzdb4wi9bya3kc6lra.w3.mag.keio.ac.jp"
91
- )
92
- end
93
-
94
- it "should convert '点心和烤鸭.w3.mag.keio.ac.jp' correctly" do
95
- expect(Addressable::IDNA.to_ascii(
96
- "点心和烤鸭.w3.mag.keio.ac.jp"
97
- )).to eq("xn--0trv4xfvn8el34t.w3.mag.keio.ac.jp")
98
- end
99
-
100
- it "should convert '가각갂갃간갅갆갇갈갉힢힣.com' correctly" do
101
- expect(Addressable::IDNA.to_ascii(
102
- "가각갂갃간갅갆갇갈갉힢힣.com"
103
- )).to eq("xn--o39acdefghijk5883jma.com")
104
- end
105
-
106
- it "should convert " +
107
- "'\347\242\274\346\250\231\346\272\226\350" +
108
- "\220\254\345\234\213\347\242\274.com' correctly" do
109
- expect(Addressable::IDNA.to_ascii(
110
- "\347\242\274\346\250\231\346\272\226\350" +
111
- "\220\254\345\234\213\347\242\274.com"
112
- )).to eq("xn--9cs565brid46mda086o.com")
113
- end
114
-
115
- it "should convert 'リ宠퐱〹.com' correctly" do
116
- expect(Addressable::IDNA.to_ascii(
117
- "\357\276\230\345\256\240\355\220\261\343\200\271.com"
118
- )).to eq("xn--eek174hoxfpr4k.com")
119
- end
120
-
121
- it "should convert 'リ宠퐱卄.com' correctly" do
122
- expect(Addressable::IDNA.to_ascii(
123
- "\343\203\252\345\256\240\355\220\261\345\215\204.com"
124
- )).to eq("xn--eek174hoxfpr4k.com")
125
- end
126
-
127
- it "should convert 'ᆵ' correctly" do
128
- expect(Addressable::IDNA.to_ascii(
129
- "\341\206\265"
130
- )).to eq("xn--4ud")
131
- end
132
-
133
- it "should convert 'ᆵ' correctly" do
134
- expect(Addressable::IDNA.to_ascii(
135
- "\357\276\257"
136
- )).to eq("xn--4ud")
137
- end
138
-
139
- it "should convert '🌹🌹🌹.ws' correctly" do
140
- expect(Addressable::IDNA.to_ascii(
141
- "\360\237\214\271\360\237\214\271\360\237\214\271.ws"
142
- )).to eq("xn--2h8haa.ws")
143
- end
144
-
145
- it "should handle two adjacent '.'s correctly" do
146
- expect(Addressable::IDNA.to_ascii(
147
- "example..host"
148
- )).to eq("example..host")
149
- end
150
- end
151
-
152
- shared_examples_for "converting from ASCII to unicode" do
153
- long = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com'
154
- it "should convert '#{long}' correctly" do
155
- expect(Addressable::IDNA.to_unicode(long)).to eq(long)
156
- end
157
-
158
- it "should return the identity conversion when punycode decode fails" do
159
- expect(Addressable::IDNA.to_unicode("xn--zckp1cyg1.sblo.jp")).to eq(
160
- "xn--zckp1cyg1.sblo.jp")
161
- end
162
-
163
- it "should return the identity conversion when the ACE prefix has no suffix" do
164
- expect(Addressable::IDNA.to_unicode("xn--...-")).to eq("xn--...-")
165
- end
166
-
167
- it "should convert 'www.google.com' correctly" do
168
- expect(Addressable::IDNA.to_unicode("www.google.com")).to eq(
169
- "www.google.com")
170
- end
171
-
172
- it "should convert 'www.詹姆斯.com' correctly" do
173
- expect(Addressable::IDNA.to_unicode(
174
- "www.xn--8ws00zhy3a.com"
175
- )).to eq("www.詹姆斯.com")
176
- end
177
-
178
- it "should convert '詹姆斯.com' correctly" do
179
- expect(Addressable::IDNA.to_unicode(
180
- "xn--8ws00zhy3a.com"
181
- )).to eq("詹姆斯.com")
182
- end
183
-
184
- it "should convert 'www.iñtërnâtiônàlizætiøn.com' correctly" do
185
- expect(Addressable::IDNA.to_unicode(
186
- "www.xn--itrntinliztin-vdb0a5exd8ewcye.com"
187
- )).to eq("www.iñtërnâtiônàlizætiøn.com")
188
- end
189
-
190
- it "should convert 'iñtërnâtiônàlizætiøn.com' correctly" do
191
- expect(Addressable::IDNA.to_unicode(
192
- "xn--itrntinliztin-vdb0a5exd8ewcye.com"
193
- )).to eq("iñtërnâtiônàlizætiøn.com")
194
- end
195
-
196
- it "should convert " +
197
- "'www.ほんとうにながいわけのわからないどめいんめいのらべるまだながくしないとたりない.w3.mag.keio.ac.jp' " +
198
- "correctly" do
199
- expect(Addressable::IDNA.to_unicode(
200
- "www.xn--n8jaaaaai5bhf7as8fsfk3jnknefdde3" +
201
- "fg11amb5gzdb4wi9bya3kc6lra.w3.mag.keio.ac.jp"
202
- )).to eq(
203
- "www.ほんとうにながいわけのわからないどめいんめいのらべるまだながくしないとたりない.w3.mag.keio.ac.jp"
204
- )
205
- end
206
-
207
- it "should convert '点心和烤鸭.w3.mag.keio.ac.jp' correctly" do
208
- expect(Addressable::IDNA.to_unicode(
209
- "xn--0trv4xfvn8el34t.w3.mag.keio.ac.jp"
210
- )).to eq("点心和烤鸭.w3.mag.keio.ac.jp")
211
- end
212
-
213
- it "should convert '가각갂갃간갅갆갇갈갉힢힣.com' correctly" do
214
- expect(Addressable::IDNA.to_unicode(
215
- "xn--o39acdefghijk5883jma.com"
216
- )).to eq("가각갂갃간갅갆갇갈갉힢힣.com")
217
- end
218
-
219
- it "should convert " +
220
- "'\347\242\274\346\250\231\346\272\226\350" +
221
- "\220\254\345\234\213\347\242\274.com' correctly" do
222
- expect(Addressable::IDNA.to_unicode(
223
- "xn--9cs565brid46mda086o.com"
224
- )).to eq(
225
- "\347\242\274\346\250\231\346\272\226\350" +
226
- "\220\254\345\234\213\347\242\274.com"
227
- )
228
- end
229
-
230
- it "should convert 'リ宠퐱卄.com' correctly" do
231
- expect(Addressable::IDNA.to_unicode(
232
- "xn--eek174hoxfpr4k.com"
233
- )).to eq("\343\203\252\345\256\240\355\220\261\345\215\204.com")
234
- end
235
-
236
- it "should convert 'ᆵ' correctly" do
237
- expect(Addressable::IDNA.to_unicode(
238
- "xn--4ud"
239
- )).to eq("\341\206\265")
240
- end
241
-
242
- it "should convert '🌹🌹🌹.ws' correctly" do
243
- expect(Addressable::IDNA.to_unicode(
244
- "xn--2h8haa.ws"
245
- )).to eq("\360\237\214\271\360\237\214\271\360\237\214\271.ws")
246
- end
247
-
248
- it "should handle two adjacent '.'s correctly" do
249
- expect(Addressable::IDNA.to_unicode(
250
- "example..host"
251
- )).to eq("example..host")
252
- end
253
-
254
- it "should normalize 'string' correctly" do
255
- expect(Addressable::IDNA.unicode_normalize_kc(:'string')).to eq("string")
256
- expect(Addressable::IDNA.unicode_normalize_kc("string")).to eq("string")
257
- end
258
- end
259
-
260
- describe Addressable::IDNA, "when using the pure-Ruby implementation" do
261
- before do
262
- Addressable.send(:remove_const, :IDNA)
263
- load "addressable/idna/pure.rb"
264
- end
265
-
266
- it_should_behave_like "converting from unicode to ASCII"
267
- it_should_behave_like "converting from ASCII to unicode"
268
-
269
- begin
270
- require "fiber"
271
-
272
- it "should not blow up inside fibers" do
273
- f = Fiber.new do
274
- Addressable.send(:remove_const, :IDNA)
275
- load "addressable/idna/pure.rb"
276
- end
277
- f.resume
278
- end
279
- rescue LoadError
280
- # Fibers aren't supported in this version of Ruby, skip this test.
281
- warn('Fibers unsupported.')
282
- end
283
- end
284
-
285
- begin
286
- require "idn"
287
-
288
- describe Addressable::IDNA, "when using the native-code implementation" do
289
- before do
290
- Addressable.send(:remove_const, :IDNA)
291
- load "addressable/idna/native.rb"
292
- end
293
-
294
- it_should_behave_like "converting from unicode to ASCII"
295
- it_should_behave_like "converting from ASCII to unicode"
296
- end
297
- rescue LoadError => error
298
- raise error if ENV["CI"] && TestHelper.native_supported?
299
-
300
- # Cannot test the native implementation without libidn support.
301
- warn('Could not load native IDN implementation.')
302
- end
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # coding: utf-8
4
- # Copyright (C) Bob Aman
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
-
18
-
19
- require "spec_helper"
20
-
21
- require "addressable/uri"
22
- require "net/http"
23
-
24
- describe Net::HTTP do
25
- it "should be compatible with Addressable" do
26
- response_body =
27
- Net::HTTP.get(Addressable::URI.parse('http://www.google.com/'))
28
- expect(response_body).not_to be_nil
29
- end
30
- end
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # coding: utf-8
4
- # Copyright (C) Bob Aman
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
-
18
-
19
- require "spec_helper"
20
-
21
- require "addressable/uri"
22
-
23
- describe Addressable::URI, "when created with a URI known to cause crashes " +
24
- "in certain browsers" do
25
- it "should parse correctly" do
26
- uri = Addressable::URI.parse('%%30%30')
27
- expect(uri.path).to eq('%%30%30')
28
- expect(uri.normalize.path).to eq('%2500')
29
- end
30
-
31
- it "should parse correctly as a full URI" do
32
- uri = Addressable::URI.parse('http://www.example.com/%%30%30')
33
- expect(uri.path).to eq('/%%30%30')
34
- expect(uri.normalize.path).to eq('/%2500')
35
- end
36
- end
37
-
38
- describe Addressable::URI, "when created with a URI known to cause crashes " +
39
- "in certain browsers" do
40
- it "should parse correctly" do
41
- uri = Addressable::URI.parse('لُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ 冗')
42
- expect(uri.path).to eq('لُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ 冗')
43
- expect(uri.normalize.path).to eq(
44
- '%D9%84%D9%8F%D8%B5%D9%91%D8%A8%D9%8F%D9%84%D9%8F%D9%84%D8%B5%D9%91' +
45
- '%D8%A8%D9%8F%D8%B1%D8%B1%D9%8B%20%E0%A5%A3%20%E0%A5%A3h%20%E0%A5' +
46
- '%A3%20%E0%A5%A3%20%E5%86%97'
47
- )
48
- end
49
-
50
- it "should parse correctly as a full URI" do
51
- uri = Addressable::URI.parse('http://www.example.com/لُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ 冗')
52
- expect(uri.path).to eq('/لُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ 冗')
53
- expect(uri.normalize.path).to eq(
54
- '/%D9%84%D9%8F%D8%B5%D9%91%D8%A8%D9%8F%D9%84%D9%8F%D9%84%D8%B5%D9%91' +
55
- '%D8%A8%D9%8F%D8%B1%D8%B1%D9%8B%20%E0%A5%A3%20%E0%A5%A3h%20%E0%A5' +
56
- '%A3%20%E0%A5%A3%20%E5%86%97'
57
- )
58
- end
59
- end