Browse files

+ 1.6.0, more lenient splitting, adds an arbitrary number (+10) to th…

…e #split DSL method.

E.g. split(3,4) behaves like split(3,4+10)
     This allows for call-through numbers.
  • Loading branch information...
1 parent 0134cb8 commit 4270bcd6405e36532f4526bc7cf6ac147d9ce47f @floere committed Oct 26, 2011
Showing with 13 additions and 2 deletions.
  1. +9 −0 history.textile
  2. +1 −0 lib/phony/dsl.rb
  3. +1 −1 phony.gemspec
  4. +2 −1 spec/lib/phony_spec.rb
View
9 history.textile
@@ -1,5 +1,14 @@
h2. Upcoming Version.
+h2. Version 1.6.0
+
+* hanke: Phony's API is now much more lenient by always rendering 10 more numbers. If @split(3, 4)@ is defined in the DSL, it actually behaves as if @split(3, 4 + 10)@ was defined, allowing for irregularities in a country's scheme that Phony did not cover yet.
+* hanke: The above change also allows for call-through numbers into offices etc.
+
+h2. Version 1.5.2
+
+* hanke: Fix for argentine republic's numbers (with input by vilcsak, thanks!).
+
h2. Version 1.5.1
* hanke: Fix for korean service codes incorrectly formatting korean mobile numbers (by vilcsak, thanks!).
View
1 lib/phony/dsl.rb
@@ -83,6 +83,7 @@ def todo
#
#
def split *local
+ local << local.pop + 10 # Allow for call-through numbers with an arbitrary size.
LocalSplitters::Fixed.instance_for local
end
def matched_split options = {}
View
2 phony.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'phony'
- s.version = '1.5.2'
+ s.version = '1.6.0'
s.authors = ['Florian Hanke']
s.email = 'florian.hanke+phony@gmail.com'
s.homepage = 'http://github.com/floere/phony'
View
3 spec/lib/phony_spec.rb
@@ -270,7 +270,8 @@
describe 'vanity_to_number' do
it {Phony.vanity_to_number('41800WEGGLI').should == '41800934454'}
it {Phony.vanity_to_number('41800weggli').should == '41800934454'}
- it {Phony.vanity_to_number('41800SUCCESSMATCH').should == '41800782237'} # Cut off according to the swiss norms.
+ # it {Phony.vanity_to_number('41800SUCCESSMATCH').should == '41800782237'} # Cut off according to the swiss norms.
+ it {Phony.vanity_to_number('41800SUCCESSMATCH').should == '41800782237762824'} # Allow for call-through numbers (>= 1.6.0)
it {Phony.vanity_to_number('4180BLA').should == '4180252'} # Does not check for validity of number.
end
end

0 comments on commit 4270bcd

Please sign in to comment.