phony_rails 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -40,6 +40,11 @@ In your views use:
40
40
 
41
41
  <%= "some number string variable".phony_formatted(:format => :international, :spaces => '-') %>
42
42
 
43
+ ## Changelog
44
+
45
+ 0.0.6
46
+ * Fixed problem with '070-4157134'
47
+
43
48
  ## Contributing
44
49
 
45
50
  1. Fork it
data/lib/phony_rails.rb CHANGED
@@ -23,9 +23,11 @@ module PhonyRails
23
23
  # Options:
24
24
  # :country_code => The country code we should use.
25
25
  # :default_country_code => Some fallback code (eg. 'NL') that can be used as default (comes from phony_normalize_numbers method).
26
+ # This idea came from:
27
+ # http://www.redguava.com.au/2011/06/rails-convert-phone-numbers-to-international-format-for-sms/
26
28
  def self.normalize_number(number, options = {})
27
29
  return if number.blank?
28
- number = Phony.normalize(number) # TODO: Catch errors
30
+ number = Phony::CountryCodes.instance.clean(number) # Strips weird stuff from the number
29
31
  if country_number = COUNTRY_NUMBER[options[:country_code] || options[:default_country_code]]
30
32
  # Add country_number if missing
31
33
  number = "#{country_number}#{number}" if not number =~ /^(00|\+)?#{country_number}/
@@ -1,3 +1,3 @@
1
1
  module PhonyRails
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,46 +1,59 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: phony_rails
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.5
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 6
9
+ version: 0.0.6
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Joost Hietbrink
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2012-05-07 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2012-05-16 00:00:00 +02:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: phony
16
- requirement: &70102155596920 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
19
25
  - - ~>
20
- - !ruby/object:Gem::Version
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 6
30
+ - 7
21
31
  version: 1.6.7
22
32
  type: :runtime
23
- prerelease: false
24
- version_requirements: *70102155596920
25
- - !ruby/object:Gem::Dependency
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
26
35
  name: activerecord
27
- requirement: &70102155596420 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
30
39
  - - ~>
31
- - !ruby/object:Gem::Version
32
- version: '3.0'
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 3
43
+ - 0
44
+ version: "3.0"
33
45
  type: :runtime
34
- prerelease: false
35
- version_requirements: *70102155596420
36
- description: This Gem adds useful methods to your Rails app to validate, display and
37
- save phone numbers.
38
- email:
46
+ version_requirements: *id002
47
+ description: This Gem adds useful methods to your Rails app to validate, display and save phone numbers.
48
+ email:
39
49
  - joost@joopp.com
40
50
  executables: []
51
+
41
52
  extensions: []
53
+
42
54
  extra_rdoc_files: []
43
- files:
55
+
56
+ files:
44
57
  - Gemfile
45
58
  - LICENSE
46
59
  - README.md
@@ -50,29 +63,35 @@ files:
50
63
  - lib/phony_rails/version.rb
51
64
  - lib/validators/phony_validator.rb
52
65
  - phony_rails.gemspec
53
- homepage: ''
66
+ has_rdoc: true
67
+ homepage: ""
54
68
  licenses: []
69
+
55
70
  post_install_message:
56
71
  rdoc_options: []
57
- require_paths:
72
+
73
+ require_paths:
58
74
  - lib
59
- required_ruby_version: !ruby/object:Gem::Requirement
60
- none: false
61
- requirements:
62
- - - ! '>='
63
- - !ruby/object:Gem::Version
64
- version: '0'
65
- required_rubygems_version: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ! '>='
69
- - !ruby/object:Gem::Version
70
- version: '0'
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ segments:
80
+ - 0
81
+ version: "0"
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ segments:
87
+ - 0
88
+ version: "0"
71
89
  requirements: []
90
+
72
91
  rubyforge_project:
73
- rubygems_version: 1.8.15
92
+ rubygems_version: 1.3.6
74
93
  signing_key:
75
94
  specification_version: 3
76
- summary: This Gem adds useful methods to your Rails app to validate, display and save
77
- phone numbers.
95
+ summary: This Gem adds useful methods to your Rails app to validate, display and save phone numbers.
78
96
  test_files: []
97
+