active_validation 4.0.4 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fa33ee5eaf935e3e4ad2534df237304c5645bb7
4
- data.tar.gz: 5e7832cfa49cc05eb16efd14203e868bef8edac6
3
+ metadata.gz: 9ff5f0f171d58eb1aef241aef85f4d4e201a2b0f
4
+ data.tar.gz: 74f0b459cbbee160ad936388ae51033afa1f7b9f
5
5
  SHA512:
6
- metadata.gz: 932cecc243591dfcf9e06812777db97804de73b749f4f8b8a1b7cd33a014fb4347add0004a4969c0eb82971c3949185b8a2a0efe59a589e37b9f25072dd5c88f
7
- data.tar.gz: cd8e2c138de7b7c570b5df5a892ae89182fa76df860d9fc41b7edaae09ad4b1ad0b9a4fa02008ce37bfd47be52b0121a6076513cd6fe07325e024c344a2fbc3d
6
+ metadata.gz: 8ed76c3d3a02038791088b23129dfdef94ec95c5a5dcab7497b7e25282c84549bc81180d8f794fbf8783e3e52bbd718ac91e92245d2c2f65145224831e0c95fd
7
+ data.tar.gz: 2a28bc6f07d48db9e69fe0c87592493ddb6ee44d33cfac822b5ca395ef796dbc2a292d3ee8abc2226e54529b6968899a5dd8d37b456518d67bc0e0b03052ed0d
data/.rubocop.yml CHANGED
@@ -25,7 +25,7 @@ Style/Alias:
25
25
  Style/BracesAroundHashParameters:
26
26
  Enabled: false
27
27
  Style/ClassAndModuleChildren:
28
- EnforcedStyle: compact
28
+ Enabled: false
29
29
  Style/ClassVars:
30
30
  Enabled: false
31
31
  Style/ClosingParenthesisIndentation:
@@ -1,16 +1,34 @@
1
1
  require 'active_model'
2
2
  require 'active_support'
3
-
4
- %w(version railtie)
5
- .each do |file_name|
6
- require "active_validation/#{file_name}"
7
- end
3
+ require 'active_validation/version'
8
4
 
9
5
  ACTIVE_VALIDATION_VALIDATORS ||= %w(
10
6
  alpha alpha_numeric base64 boolean coordinate credit_card currency cusip email equality hex imei
11
7
  ip isbn isin mac_address name password phone sedol slug ssn tracking_number type url username uuid
12
- )
8
+ ).freeze
13
9
 
14
10
  ACTIVE_VALIDATION_VALIDATORS.each do |file_name|
15
11
  require "active_validation/validators/#{file_name}_validator"
16
12
  end
13
+
14
+ if defined?(Rails)
15
+ require 'rails'
16
+
17
+ module ActiveValidation
18
+ class Railtie < ::Rails::Railtie
19
+
20
+ initializer 'active_validation' do |app|
21
+ ActiveValidation::Railtie.instance_eval do
22
+ [app.config.i18n.available_locales].flatten.each do |locale|
23
+ (I18n.load_path << path(locale)) if File.file?(path(locale))
24
+ end
25
+ end
26
+ end
27
+
28
+ def self.path(locale)
29
+ File.expand_path("../../config/locales/#{locale}.yml", __FILE__)
30
+ end
31
+
32
+ end
33
+ end
34
+ end
@@ -1,3 +1,3 @@
1
1
  module ActiveValidation
2
- VERSION = '4.0.4'.freeze
2
+ VERSION = '4.0.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_validation
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.4
4
+ version: 4.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
@@ -178,7 +178,6 @@ files:
178
178
  - lib/.DS_Store
179
179
  - lib/active_validation.rb
180
180
  - lib/active_validation/.DS_Store
181
- - lib/active_validation/railtie.rb
182
181
  - lib/active_validation/validators/alpha_numeric_validator.rb
183
182
  - lib/active_validation/validators/alpha_validator.rb
184
183
  - lib/active_validation/validators/base64_validator.rb
@@ -1,23 +0,0 @@
1
- if defined?(Rails)
2
- require 'rails'
3
-
4
- module ActiveValidation
5
- class Railtie < ::Rails::Railtie
6
-
7
- initializer 'active_validation' do |app|
8
- ActiveValidation::Railtie.instance_eval do
9
- [app.config.i18n.available_locales].flatten.each do |locale|
10
- (I18n.load_path << path(locale)) if File.file?(path(locale))
11
- end
12
- end
13
- end
14
-
15
- def self.path(locale)
16
- File.expand_path("../../config/locales/#{locale}.yml", __FILE__)
17
- end
18
-
19
- private_class_method :path
20
-
21
- end
22
- end
23
- end