Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 9 additions and 2 deletions.
  1. +5 −0 README.md
  2. +3 −1 lib/phony_rails.rb
  3. +1 −1  lib/phony_rails/version.rb
View
5 README.md
@@ -40,6 +40,11 @@ In your views use:
<%= "some number string variable".phony_formatted(:format => :international, :spaces => '-') %>
+## Changelog
+
+0.0.6
+* Fixed problem with '070-4157134'
+
## Contributing
1. Fork it
View
4 lib/phony_rails.rb
@@ -23,9 +23,11 @@ module PhonyRails
# Options:
# :country_code => The country code we should use.
# :default_country_code => Some fallback code (eg. 'NL') that can be used as default (comes from phony_normalize_numbers method).
+ # This idea came from:
+ # http://www.redguava.com.au/2011/06/rails-convert-phone-numbers-to-international-format-for-sms/
def self.normalize_number(number, options = {})
return if number.blank?
- number = Phony.normalize(number) # TODO: Catch errors
+ number = Phony::CountryCodes.instance.clean(number) # Strips weird stuff from the number
if country_number = COUNTRY_NUMBER[options[:country_code] || options[:default_country_code]]
# Add country_number if missing
number = "#{country_number}#{number}" if not number =~ /^(00|\+)?#{country_number}/
View
2  lib/phony_rails/version.rb
@@ -1,3 +1,3 @@
module PhonyRails
- VERSION = "0.0.5"
+ VERSION = "0.0.6"
end

No commit comments for this range

Something went wrong with that request. Please try again.