Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
language: ruby
rvm:
- 1.8.7
- ree
- 1.9.3
- 2.0.0
- 2.1.9
- 2.2.5
- 2.3.1
- ruby-head
Expand Down
6 changes: 3 additions & 3 deletions domain_name.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ Suffix List.
gem.licenses = ["BSD-2-Clause", "BSD-3-Clause", "MPL-2.0"]

gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.test_files = gem.files.grep(%r{^test/})
gem.require_paths = ["lib"]

gem.extra_rdoc_files = [
"LICENSE.txt",
"README.md"
]

gem.add_runtime_dependency("unf", ["< 1.0.0", ">= 0.0.5"])
gem.required_ruby_version = ">= 2.2"

gem.add_development_dependency("test-unit", "~> 2.5.5")
gem.add_development_dependency("bundler", [">= 1.2.0"])
gem.add_development_dependency("rake", [">= 0.9.2.2", *("< 11" if RUBY_VERSION < "1.9")])
Expand Down
4 changes: 2 additions & 2 deletions lib/domain_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require 'domain_name/version'
require 'domain_name/punycode'
require 'domain_name/etld_data'
require 'unf'
require 'unicode_normalize/normalize'
require 'ipaddr'

# Represents a domain name ready for extracting its registered domain
Expand Down Expand Up @@ -286,7 +286,7 @@ class << self
# Normalizes a _domain_ using the Punycode algorithm as necessary.
# The result will be a downcased, ASCII-only string.
def normalize(domain)
DomainName::Punycode.encode_hostname(domain.chomp(DOT).to_nfc).downcase
DomainName::Punycode.encode_hostname(domain.chomp(DOT).unicode_normalize).downcase
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_domain_name-punycode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class TestDomainName < Test::Unit::TestCase
'-> $1.00 <--']
].each { |title, cps, punycode|
assert_equal punycode, DomainName::Punycode.encode(cps.pack('U*')), title
assert_equal cps.pack('U*').to_nfc, DomainName::Punycode.decode(punycode), title
assert_equal cps.pack('U*').unicode_normalize, DomainName::Punycode.decode(punycode), title
}
end
end