Skip to content

Commit

Permalink
Merge pull request #117 from twingly/update-addressable-and-public-su…
Browse files Browse the repository at this point in the history
…ffix

Update PublicSuffix and Addressable
  • Loading branch information
dentarg authored Feb 14, 2018
2 parents c5fb131 + e93ffad commit 9d4a26a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions lib/twingly/public_suffix_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ def self.with_punycoded_names(encoding: Encoding::UTF_8)

punycoded_names(list).each do |punycoded_name|
new_rule = PublicSuffix::Rule.factory(punycoded_name)
list.add(new_rule, reindex: false)
list.add(new_rule)
end

list.reindex!

list
end

private_class_method \
def self.punycoded_names(list)
names = list.map { |rule| Addressable::IDNA.to_ascii(rule.value) }
names = list.each.map { |rule| Addressable::IDNA.to_ascii(rule.value) }
names.select { |name| punycoded_name?(name) }
end

Expand Down
4 changes: 2 additions & 2 deletions twingly-url.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Gem::Specification.new do |s|
s.license = "MIT"
s.required_ruby_version = "~> 2.2"

s.add_dependency "addressable", "= 2.5.0"
s.add_dependency "public_suffix", "= 2.0.3"
s.add_dependency "addressable", "= 2.5.2"
s.add_dependency "public_suffix", "= 3.0.1"

s.add_development_dependency "rake", "~> 10"
s.add_development_dependency "rspec", "~> 3"
Expand Down

0 comments on commit 9d4a26a

Please sign in to comment.