phony_rails 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -27,8 +27,8 @@ In your model add:
27
27
 
28
28
  class SomeModel < ActiveRecord::Base
29
29
 
30
- # Normalizes the attribute itself before
31
- phony_normalize :phone_number, :default_country_code => 'US'validation
30
+ # Normalizes the attribute itself before validation
31
+ phony_normalize :phone_number, :default_country_code => 'US'
32
32
 
33
33
  # Normalizes attribute before validation and saves into other attribute
34
34
  phony_normalize :phone_number, :as => :phone_number_normalized_version, :default_country_code => 'US'
@@ -41,6 +41,14 @@ The `:default_country_code` options is used to specify a country_code when norma
41
41
 
42
42
  PhonyRails will also check your model for a country_code method to use when normalizing the number. So `'070-12341234'` with `country_code` 'NL' will get normalized to `'317012341234'`.
43
43
 
44
+ You can also do-it-yourself and call:
45
+
46
+ # Options:
47
+ # :country_code => The country code we should use.
48
+ # :default_country_code => Some fallback code (eg. 'NL') that can be used as default (comes from phony_normalize_numbers method).
49
+
50
+ PhonyRails.normalize_number('some number', :country_code => 'NL')
51
+
44
52
  ### Validation
45
53
 
46
54
  In your model use the Phony.plausible method to validate an attribute:
@@ -78,6 +86,9 @@ Say you want to find a record by a phone number. Best is to normalize user input
78
86
 
79
87
  ## Changelog
80
88
 
89
+ 0.1.11
90
+ * Better gemspec dependency versions by rjhaveri.
91
+
81
92
  0.1.10
82
93
  * Changes from henning-koch.
83
94
  * Some pending fixes.
@@ -1,3 +1,3 @@
1
1
  module PhonyRails
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = PhonyRails::VERSION
17
17
 
18
- gem.add_dependency "phony", "~> 1.7.7"
18
+ gem.add_dependency "phony", ">= 1.7.7"
19
19
  gem.add_dependency "countries", "~> 0.8.2"
20
20
  gem.add_dependency "activerecord", "~> 3.0"
21
21
  end
metadata CHANGED
@@ -1,73 +1,72 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: phony_rails
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- - 10
9
- version: 0.1.10
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.11
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Joost Hietbrink
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2012-10-18 00:00:00 +02:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-12-04 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: phony
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 1
29
- - 7
30
- - 7
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
31
21
  version: 1.7.7
32
22
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: countries
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- requirements:
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.7.7
30
+ - !ruby/object:Gem::Dependency
31
+ name: countries
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
39
35
  - - ~>
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
- - 8
44
- - 2
36
+ - !ruby/object:Gem::Version
45
37
  version: 0.8.2
46
38
  type: :runtime
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: activerecord
50
39
  prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
52
- requirements:
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.8.2
46
+ - !ruby/object:Gem::Dependency
47
+ name: activerecord
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
53
51
  - - ~>
54
- - !ruby/object:Gem::Version
55
- segments:
56
- - 3
57
- - 0
58
- version: "3.0"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.0'
59
54
  type: :runtime
60
- version_requirements: *id003
61
- description: This Gem adds useful methods to your Rails app to validate, display and save phone numbers.
62
- email:
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ description: This Gem adds useful methods to your Rails app to validate, display and
63
+ save phone numbers.
64
+ email:
63
65
  - joost@joopp.com
64
66
  executables: []
65
-
66
67
  extensions: []
67
-
68
68
  extra_rdoc_files: []
69
-
70
- files:
69
+ files:
71
70
  - .gitignore
72
71
  - .rspec
73
72
  - Gemfile
@@ -86,37 +85,33 @@ files:
86
85
  - spec/lib/phony_rails_spec.rb
87
86
  - spec/lib/validators/phony_validator_spec.rb
88
87
  - spec/spec_helper.rb
89
- has_rdoc: true
90
88
  homepage: https://github.com/joost/phony_rails
91
89
  licenses: []
92
-
93
90
  post_install_message:
94
91
  rdoc_options: []
95
-
96
- require_paths:
92
+ require_paths:
97
93
  - lib
98
- required_ruby_version: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- segments:
103
- - 0
104
- version: "0"
105
- required_rubygems_version: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- segments:
110
- - 0
111
- version: "0"
94
+ required_ruby_version: !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ! '>='
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ! '>='
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
112
106
  requirements: []
113
-
114
107
  rubyforge_project:
115
- rubygems_version: 1.3.6
108
+ rubygems_version: 1.8.24
116
109
  signing_key:
117
110
  specification_version: 3
118
- summary: This Gem adds useful methods to your Rails app to validate, display and save phone numbers.
119
- test_files:
111
+ summary: This Gem adds useful methods to your Rails app to validate, display and save
112
+ phone numbers.
113
+ test_files:
120
114
  - spec/lib/phony_rails_spec.rb
121
115
  - spec/lib/validators/phony_validator_spec.rb
122
116
  - spec/spec_helper.rb
117
+ has_rdoc: