flash_validators 3.0.2 → 3.0.3

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: b1eb3d9475a1a0e3d2a0bcb854ce4c6af6179731
4
- data.tar.gz: 07119e9a47963707d84812ac18155df421964907
3
+ metadata.gz: 868f39ce91250dfa8f7e3483c279d648bf55ac30
4
+ data.tar.gz: ee3618b918242696d58fb50d170b877f5f03f84a
5
5
  SHA512:
6
- metadata.gz: 664c566b3587fe6368406ef69b1674b76f5b6bf1ef569f620220815f64922114df9af71e1a8853c708574a95bec97487b6375f6fa86b03609ff734c5272770ef
7
- data.tar.gz: 9837062848e3d77ab6c57ff3834af42b3d46c9b5e99e606f0c6556334677df30367637a2929c54ec7ef35b2a00938fe819679fcf834000fd084c1bcdc2d1827d
6
+ metadata.gz: 10a61abd3c4144c795d263fb59a35bb81cf93220b81d69eea649c4d9b317014691b7d57224b46c0731a848184d938c0738643b6e0d58a0955a93f0615a44388e
7
+ data.tar.gz: d4d253c2fdb4413f872cd9de4cb288462bd60ae425b42eeba747e5fafdc1a5236686cfc03e77aacca8c2e595ae151f34f8bdfe5bf10d3ec153349338452c830b
@@ -1,3 +1,3 @@
1
1
  module FlashValidators
2
- VERSION = "3.0.2"
2
+ VERSION = "3.0.3"
3
3
  end
@@ -58,4 +58,31 @@ if defined?(RSpec)
58
58
  require 'flash_validators/matchers/ensure_valid_url_format_of'
59
59
  require 'flash_validators/matchers/ensure_valid_username_format_of'
60
60
  require 'flash_validators/matchers/ensure_valid_uuid_format_of'
61
+ end
62
+
63
+ if defined?(Rails)
64
+ require 'rails'
65
+
66
+ module FlashValidators
67
+ class Railtie < ::Rails::Railtie #:nodoc:
68
+ initializer 'flash_validators' do |app|
69
+ FlashValidators::Railtie.instance_eval do
70
+ pattern = pattern_from app.config.i18n.available_locales
71
+
72
+ add(pattern)
73
+ end
74
+ end
75
+
76
+ protected
77
+
78
+ def self.add(pattern)
79
+ I18n.load_path << File.expand_path("../../config/locales/#{pattern}.yml", __FILE__)
80
+ end
81
+
82
+ def self.pattern_from(args)
83
+ array = Array(args || [])
84
+ array.blank? ? '*' : "{#{array.join ','}}"
85
+ end
86
+ end
87
+ end
61
88
  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.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez