phony_rails 0.14.10 → 0.14.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/phony_rails/locales/ko.yml +4 -0
- data/lib/phony_rails/version.rb +1 -1
- data/spec/lib/phony_rails_spec.rb +10 -0
- data/spec/lib/validators/phony_validator_spec.rb +8 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bb21cdef27d6696f003b5d1b60a5c6df7365845366eb36769ee17b11d809e277
|
4
|
+
data.tar.gz: 35e3206fe90042f14332eac06e3e27060ed8cd6fda339863009d55c0f7962291
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23cee7e1e1d089117a4519c45fd52c456786d92a783f85acc45be269917008b9b50985767fcc630fba544e1a806622e3a37297fad2ed3499a2ab08d5495a36cc
|
7
|
+
data.tar.gz: 6badf776d61071abf152dfe03ff90a585bbc1c13ae83c2cabf6d2c93ea76ee7773455ffe0a03c8615a9865b23cff001b3b56018d8a50c6f95d59ce7ab0423fc0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -133,7 +133,7 @@ validates_plausible_phone :phone_number, without: /\A\+\d+/
|
|
133
133
|
validates_plausible_phone :phone_number, presence: true, with: /\A\+\d+/
|
134
134
|
```
|
135
135
|
|
136
|
-
the i18n key is `:improbable_phone`. Languages supported by default: de, en, es, fr, it, ja, kh, nl, tr, ua and ru.
|
136
|
+
the i18n key is `:improbable_phone`. Languages supported by default: de, en, es, fr, it, ja, kh, ko, nl, tr, ua and ru.
|
137
137
|
|
138
138
|
You can also validate if a number has the correct country number:
|
139
139
|
|
data/lib/phony_rails/version.rb
CHANGED
@@ -236,6 +236,16 @@ describe PhonyRails do
|
|
236
236
|
phone = PhonyRails.normalize_number(phone, default_country_code: 'DE')
|
237
237
|
expect(phone).to eq('+12604379123')
|
238
238
|
end
|
239
|
+
|
240
|
+
it 'should pass Github issue #187' do
|
241
|
+
phone1 = '0037253400030'
|
242
|
+
phone1 = PhonyRails.normalize_number(phone1, default_country_code: 'EE')
|
243
|
+
expect(phone1).to eq('+37253400030')
|
244
|
+
|
245
|
+
phone2 = '0037275016183'
|
246
|
+
phone2 = PhonyRails.normalize_number(phone2, default_country_code: 'EE')
|
247
|
+
expect(phone2).to eq('+37275016183')
|
248
|
+
end
|
239
249
|
end
|
240
250
|
|
241
251
|
it 'should not change original String' do
|
@@ -273,6 +273,14 @@ describe PhonyPlausibleValidator do
|
|
273
273
|
end
|
274
274
|
end
|
275
275
|
|
276
|
+
it 'should translate the error message in Korean' do
|
277
|
+
I18n.with_locale(:ko) do
|
278
|
+
@home.phone_number = INVALID_NUMBER
|
279
|
+
@home.valid?
|
280
|
+
expect(@home.errors.messages).to include(phone_number: ['는 올바른 전화번호가 아닙니다'])
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
276
284
|
it 'should translate the error message in Ukrainian' do
|
277
285
|
I18n.with_locale(:uk) do
|
278
286
|
@home.phone_number = INVALID_NUMBER
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phony_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joost Hietbrink
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/phony_rails/locales/it.yml
|
97
97
|
- lib/phony_rails/locales/ja.yml
|
98
98
|
- lib/phony_rails/locales/km.yml
|
99
|
+
- lib/phony_rails/locales/ko.yml
|
99
100
|
- lib/phony_rails/locales/nl.yml
|
100
101
|
- lib/phony_rails/locales/ru.yml
|
101
102
|
- lib/phony_rails/locales/tr.yml
|
@@ -128,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
129
|
version: '0'
|
129
130
|
requirements: []
|
130
131
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
132
|
+
rubygems_version: 2.7.7
|
132
133
|
signing_key:
|
133
134
|
specification_version: 4
|
134
135
|
summary: This Gem adds useful methods to your Rails app to validate, display and save
|