flash_validators 3.0.4 → 3.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34f5cbfc9a87282bcc4fa119a4ab58804ddcb509
4
- data.tar.gz: a07ef2eeeef5e42b5151d8fb35d2d264848d4678
3
+ metadata.gz: f39adfbb3c4bcf87f498a72690d187c8991c1a7d
4
+ data.tar.gz: d3df54977cb19298f77f416c4be1c98aa34c5889
5
5
  SHA512:
6
- metadata.gz: e4078df459b4291ca1d1d984b74674c10aae8951be5d68e3935780f66dc090ec97dfb64e36d2aded821532f300d1d4320c3be360e7264b451c3120f459d123fb
7
- data.tar.gz: 84862f4d15bce3fc2d922656e1f1ed85498ee9bcbca94b4d2b296ce3d5a7539dc7cb5be43f7275b7609fd4f5751394e86d84a960095a42ec6f2d41f7fbed06b3
6
+ metadata.gz: d4c5fe49a6245d196a41e96f9b65b16a6cc1842c6bc93f7ef0a086feb459bd9410dcbe475e257fe4364e046f20b2d79b66e544f63950c15365b959281dfda295
7
+ data.tar.gz: 35a8b32136849d7b3d76f9bf81b110c30abeed85c7e58e13d1925300685ed015b0228371c71cefdd26512595f4a76e917ef7e3eb4bb1c295d72fb866e6c1179f
@@ -64,30 +64,26 @@ if defined?(Rails)
64
64
  require 'rails'
65
65
 
66
66
  module FlashValidators
67
- class Railtie < ::Rails::Railtie #:nodoc:
67
+ class Railtie < ::Rails::Railtie
68
68
  initializer 'flash_validators' do |app|
69
69
  FlashValidators::Railtie.instance_eval do
70
- pattern = pattern_from(app.config.i18n.available_locales)
70
+ locales = locales_from(app.config.i18n.available_locales)
71
71
 
72
- if pattern.blank?
73
- add('*')
74
- else
75
- pattern.each do |locale|
76
- add(locale)
77
- end
78
- end
72
+ locales.each do |locale|
73
+ add(locale)
74
+ end
79
75
  end
80
76
  end
81
77
 
82
78
  protected
83
79
 
84
- def self.add(pattern)
85
- I18n.load_path << File.expand_path("../../config/locales/#{pattern}.yml", __FILE__)
80
+ def self.add(locale)
81
+ I18n.load_path << File.expand_path("../../config/locales/#{locale}.yml", __FILE__)
86
82
  end
87
83
 
88
- def self.pattern_from(args)
84
+ def self.locales_from(args)
89
85
  array = Array(args || [])
90
- array.blank? ? '*' : "{#{array.join ','}}"
86
+ array.blank? ? '*' : array
91
87
  end
92
88
  end
93
89
  end
@@ -1,3 +1,3 @@
1
1
  module FlashValidators
2
- VERSION = "3.0.4"
2
+ VERSION = "3.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flash_validators
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
4
+ version: 3.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez