Skip to content

Commit

Permalink
* Remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
franckverrot committed Mar 12, 2014
1 parent 700ac4a commit 5f85380
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
4 changes: 1 addition & 3 deletions lib/phony/countries/ireland.rb
Expand Up @@ -9,8 +9,6 @@
# http://www.comreg.ie/_fileupload/publications/ComReg03147.pdf
# http://en.wikipedia.org/wiki/Telephone_numbers_in_the_Republic_of_Ireland
#
handlers = []

ndcs_with_5_subscriber_digits = [
('22'..'29').to_a, # Mallow, Bandon, Youghal, Fermoy, Macroom, Bantry, Skibbereen, Kanturk
'402', # Arklow
Expand Down Expand Up @@ -73,4 +71,4 @@
match(/^(8\d).+$/) >> split(3,4) | # mobile
fixed(3) >> split(6) # Fallback

end
end
4 changes: 2 additions & 2 deletions lib/phony/countries/malaysia.rb
Expand Up @@ -12,7 +12,7 @@
'9', # Kelantan, Pahang (except Cameron Highlands & Genting Highlands) & Terengganu
]
mobile = %w{ 10 11 12 13 14 153 154 156 158 16 17 18 19 }
service = %w{ 100 101 102 103 104 108 991 994 995 999 } # Emergeny and Service numbers, only 3 digits long
# service = %w{ 100 101 102 103 104 108 991 994 995 999 } # Emergeny and Service numbers, only 3 digits long
freephone = %w{ 300 700 800 }

Phony.define do
Expand All @@ -21,4 +21,4 @@
one_of(mobile) >> split(3,4) | # Mobile
one_of(ndcs) >> split(8) | # 1-digit NDCs
fixed(2) >> split(8) # 2-digit NDCs (Also, fallback)
end
end
4 changes: 2 additions & 2 deletions lib/phony/country.rb
Expand Up @@ -112,10 +112,10 @@ def vanity? national_number
#
#
def vanity_to_number vanity_number
zero, ndc, *rest = split vanity_number
_, ndc, *rest = split vanity_number
"#{ndc}#{Vanity.replace(rest.join)}"
end

end

end
end
8 changes: 4 additions & 4 deletions lib/phony/country_codes.rb
Expand Up @@ -127,15 +127,15 @@ def format_local space, parts_ary
#
#
def service? number
country, cc, rest = split_cc number
country, _, rest = split_cc number
country.service? rest
end
def mobile? number
country, cc, rest = split_cc number
country, _, rest = split_cc number
country.mobile? rest
end
def landline? number
country, cc, rest = split_cc number
country, _, rest = split_cc number
country.landline? rest
end

Expand Down Expand Up @@ -179,7 +179,7 @@ def plausible? number, hints = {}
# Country specific tests.
#
country.plausible? rest, hints
rescue StandardError => e
rescue StandardError
return false
end

Expand Down
1 change: 0 additions & 1 deletion spec/functional/plausibility_spec.rb
Expand Up @@ -20,7 +20,6 @@ def self.it_is_correct_for(country_name, options={})
correct = [*sample]

shortest = correct.min_by{|x| x.scan(/\d/).length}
longest = correct.max_by{|x| x.scan(/\d/).length}
incorrect = [shortest.sub(/\d\s*\z/, '')] # , longest + '0']

correct.each do |value|
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper_extensions.rb
Expand Up @@ -12,7 +12,7 @@ module SpecHelperExtensions
#
begin
require File.expand_path '../performance_ratio', __FILE__
rescue LoadError => e
rescue LoadError
Phony::PerformanceRatio = 0 # Ignore speed tests by default.
end
def performance_of &block
Expand All @@ -22,4 +22,4 @@ def performance_of &block
result * Phony::PerformanceRatio
end

end
end

0 comments on commit 5f85380

Please sign in to comment.