Skip to content

Commit

Permalink
Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
dentarg committed Sep 14, 2016
1 parent d9d2fb5 commit ba6c5a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/twingly/public_suffix_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ def self.with_punycoded_names
list
end

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

private_class_method def self.punycoded_name?(name)
private_class_method \
def self.punycoded_name?(name)
PublicSuffix::Domain.name_to_labels(name).any? do |label|
label =~ ACE_PREFIX
end
Expand Down

0 comments on commit ba6c5a4

Please sign in to comment.