client_side_validations 9.2.0 → 9.3.0

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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/lib/client_side_validations.rb +1 -0
  4. data/lib/client_side_validations/action_view.rb +1 -0
  5. data/lib/client_side_validations/action_view/form_builder.rb +3 -2
  6. data/lib/client_side_validations/action_view/form_helper.rb +1 -0
  7. data/lib/client_side_validations/active_model.rb +4 -3
  8. data/lib/client_side_validations/active_model/absence.rb +1 -0
  9. data/lib/client_side_validations/active_model/acceptance.rb +1 -0
  10. data/lib/client_side_validations/active_model/conditionals.rb +1 -0
  11. data/lib/client_side_validations/active_model/exclusion.rb +1 -0
  12. data/lib/client_side_validations/active_model/format.rb +1 -0
  13. data/lib/client_side_validations/active_model/inclusion.rb +1 -0
  14. data/lib/client_side_validations/active_model/length.rb +1 -0
  15. data/lib/client_side_validations/active_model/numericality.rb +1 -0
  16. data/lib/client_side_validations/active_model/presence.rb +1 -0
  17. data/lib/client_side_validations/active_record.rb +2 -1
  18. data/lib/client_side_validations/active_record/uniqueness.rb +1 -0
  19. data/lib/client_side_validations/config.rb +1 -0
  20. data/lib/client_side_validations/core_ext.rb +1 -0
  21. data/lib/client_side_validations/core_ext/range.rb +1 -0
  22. data/lib/client_side_validations/core_ext/regexp.rb +1 -0
  23. data/lib/client_side_validations/engine.rb +1 -0
  24. data/lib/client_side_validations/extender.rb +1 -0
  25. data/lib/client_side_validations/files.rb +1 -0
  26. data/lib/client_side_validations/generators.rb +1 -0
  27. data/lib/client_side_validations/generators/rails_validations.rb +1 -0
  28. data/lib/client_side_validations/version.rb +2 -1
  29. data/lib/generators/client_side_validations/copy_assets_generator.rb +1 -0
  30. data/lib/generators/client_side_validations/install_generator.rb +1 -0
  31. data/vendor/assets/javascripts/rails.validations.js +1 -1
  32. metadata +10 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c97aaa7e427726552ee50a3c5ef04aefb79df5d
4
- data.tar.gz: 01ba6bb6c9d6219ee83a27cf2615c6571680f6d0
3
+ metadata.gz: c6b77331b3536bcd7e1214fd8e05f8d4dfe91a89
4
+ data.tar.gz: 75fb4f99e2e07497749b04f3a317d627c139d632
5
5
  SHA512:
6
- metadata.gz: 21557913adad69294d2b05244bdf6b317f40cb38fe355335133b8e615b18e7c29d1828db4feb4565d1af955132b6f0c246b36821b8475bed3de791ef699eb699
7
- data.tar.gz: 16c28cb2b54cc7ea8a961e21b25781dbb6fd14d243f2baac9e95a2bf6626b308ab78b63518e0626bd92a2815e78de04c18dc9f76320d5c055e240cbae2d7bd9a
6
+ metadata.gz: 156e5c0aca368ed98b822936b0a7f5dee806e486e52665c7f3e3cb6ad810564cd7f3977abb5cad9aea5519b2f928679d5e29592fe1f97a5772b948c71e9a7d68
7
+ data.tar.gz: 21ac1feb8a8fc5ecae7d04f504e07f1129faa04e487236f9f7a75c77f6a2bb2b278558f9dbabf1bb21d0af9958eb012c3f68008edce9044432133f6312d8104d
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 9.3.0 / 2017-04-24
4
+
5
+ * [ENHANCEMENT] Code cleanup
6
+ * [ENHANCEMENT] Test against Ruby 2.2.7 and 2.3.4, Rails 5.1.0.rc2
7
+ * [ENHANCEMENT] Update development dependencies
8
+
3
9
  ## 9.2.0 / 2017-03-23
4
10
 
5
11
  * [ENHANCEMENT] Use Ruby 2.3's Frozen String Literal Pragma
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'client_side_validations/config'
3
4
  require 'client_side_validations/active_model' if defined?(::ActiveModel)
4
5
  require 'client_side_validations/active_record' if defined?(::ActiveRecord)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActionView
4
5
  module Helpers
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActionView
4
5
  module Helpers
5
6
  module FormBuilder
6
7
  def self.prepended(base)
7
- (base.field_helpers - %i(label check_box radio_button fields_for hidden_field file_field)).each do |selector|
8
+ (base.field_helpers - %i[label check_box radio_button fields_for hidden_field file_field]).each do |selector|
8
9
  base.class_eval <<-RUBY_EVAL
9
10
  def #{selector}(method, options = {})
10
11
  build_validation_options(method, options)
@@ -71,7 +72,7 @@ module ClientSideValidations
71
72
  super(method, collection, value_method, text_method, options, html_options)
72
73
  end
73
74
 
74
- %i(collection_check_boxes collection_radio_buttons).each do |method_name|
75
+ %i[collection_check_boxes collection_radio_buttons].each do |method_name|
75
76
  define_method method_name do |method, collection, value_method, text_method, options = {}, html_options = {}, &block|
76
77
  build_validation_options(method, html_options.merge(name: options[:name]))
77
78
  html_options.delete(:validate)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActionView
4
5
  module Helpers
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'client_side_validations/core_ext'
3
4
  require 'client_side_validations/extender'
4
5
  require 'client_side_validations/active_model/conditionals'
@@ -11,13 +12,13 @@ module ClientSideValidations
11
12
  end
12
13
 
13
14
  def copy_conditional_attributes(to, from)
14
- [:if, :unless].each { |key| to[key] = from[key] if from[key].present? }
15
+ %i[if unless].each { |key| to[key] = from[key] if from[key].present? }
15
16
  end
16
17
 
17
18
  private
18
19
 
19
20
  def build_client_side_hash(model, attribute, options)
20
- { message: model.errors.generate_message(attribute, message_type, options) }.merge(options.except(*::ActiveModel::Errors::CALLBACKS_OPTIONS - [:allow_blank, :if, :unless]))
21
+ { message: model.errors.generate_message(attribute, message_type, options) }.merge(options.except(*::ActiveModel::Errors::CALLBACKS_OPTIONS - %i[allow_blank if unless]))
21
22
  end
22
23
 
23
24
  def message_type
@@ -161,4 +162,4 @@ end
161
162
  ActiveModel::Validator.send(:include, ClientSideValidations::ActiveModel::Validator)
162
163
  ActiveModel::Validations.send(:include, ClientSideValidations::ActiveModel::Validations)
163
164
 
164
- ClientSideValidations::Extender.extend 'ActiveModel', %w(Absence Acceptance Exclusion Format Inclusion Length Numericality Presence)
165
+ ClientSideValidations::Extender.extend 'ActiveModel', %w[Absence Acceptance Exclusion Format Inclusion Length Numericality Presence]
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActiveModel
4
5
  module Absence
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActiveModel
4
5
  module Acceptance
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActiveModel
4
5
  module Conditionals
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActiveModel
4
5
  module Exclusion
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActiveModel
4
5
  module Format
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActiveModel
4
5
  module Inclusion
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActiveModel
4
5
  module Length
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActiveModel
4
5
  module Numericality
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActiveModel
4
5
  module Presence
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'client_side_validations/active_model'
3
4
  require 'client_side_validations/extender'
4
5
 
5
6
  ActiveRecord::Base.send(:include, ClientSideValidations::ActiveModel::Validations)
6
7
 
7
- ClientSideValidations::Extender.extend 'ActiveRecord', %w(Uniqueness)
8
+ ClientSideValidations::Extender.extend 'ActiveRecord', %w[Uniqueness]
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module ActiveRecord
4
5
  module Uniqueness
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module Config
4
5
  class << self
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'active_support/json'
3
4
  require 'client_side_validations/core_ext/range'
4
5
  require 'client_side_validations/core_ext/regexp'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class Range
3
4
  def as_json(*)
4
5
  [first, last]
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'js_regex'
3
4
 
4
5
  class Regexp
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  class Engine < ::Rails::Engine
4
5
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module Extender
4
5
  module_function
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # This is only used by dependant libraries that need to find the files
3
4
 
4
5
  module ClientSideValidations
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module Generators
4
5
  @@assets = []
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module Generators
4
5
  class RailsValidations
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
- VERSION = '9.2.0'.freeze
4
+ VERSION = '9.3.0'.freeze
4
5
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ClientSideValidations
3
4
  module Generators
4
5
  class CopyAssetsGenerator < Rails::Generators::Base
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'generators/client_side_validations/copy_assets_generator'
3
4
 
4
5
  module ClientSideValidations
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * Client Side Validations - v9.2.0 (https://github.com/DavyJonesLocker/client_side_validations)
3
+ * Client Side Validations - v9.3.0 (https://github.com/DavyJonesLocker/client_side_validations)
4
4
  * Copyright (c) 2017 Geremia Taglialatela, Brian Cardarella
5
5
  * Licensed under MIT (http://opensource.org/licenses/mit-license.php)
6
6
  */
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: client_side_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.2.0
4
+ version: 9.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geremia Taglialatela
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-03-23 00:00:00.000000000 Z
12
+ date: 2017-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -65,14 +65,14 @@ dependencies:
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.1'
68
+ version: '2.2'
69
69
  type: :development
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '2.1'
75
+ version: '2.2'
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: byebug
78
78
  requirement: !ruby/object:Gem::Requirement
@@ -93,14 +93,14 @@ dependencies:
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.8.19
96
+ version: 0.8.20
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.8.19
103
+ version: 0.8.20
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: m
106
106
  requirement: !ruby/object:Gem::Requirement
@@ -163,28 +163,28 @@ dependencies:
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 0.47.1
166
+ version: 0.48.1
167
167
  type: :development
168
168
  prerelease: false
169
169
  version_requirements: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 0.47.1
173
+ version: 0.48.1
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: simplecov
176
176
  requirement: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 0.12.0
180
+ version: 0.14.1
181
181
  type: :development
182
182
  prerelease: false
183
183
  version_requirements: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.12.0
187
+ version: 0.14.1
188
188
  - !ruby/object:Gem::Dependency
189
189
  name: sqlite3
190
190
  requirement: !ruby/object:Gem::Requirement