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 +5 -0
- data/lib/phony_rails.rb +3 -1
- data/lib/phony_rails/version.rb +1 -1
- metadata +62 -43
data/README.md
CHANGED
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.
|
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}/
|
data/lib/phony_rails/version.rb
CHANGED
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
|
-
|
5
|
-
|
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
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
17
|
-
|
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
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
26
35
|
name: activerecord
|
27
|
-
|
28
|
-
|
29
|
-
requirements:
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
30
39
|
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 3
|
43
|
+
- 0
|
44
|
+
version: "3.0"
|
33
45
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
|
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
|
-
|
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
|
-
|
66
|
+
has_rdoc: true
|
67
|
+
homepage: ""
|
54
68
|
licenses: []
|
69
|
+
|
55
70
|
post_install_message:
|
56
71
|
rdoc_options: []
|
57
|
-
|
72
|
+
|
73
|
+
require_paths:
|
58
74
|
- lib
|
59
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
|
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.
|
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
|
+
|