Skip to content

Commit

Permalink
Merge c3478b1 into 7c6dd8f
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot-preview[bot] committed Aug 7, 2020
2 parents 7c6dd8f + c3478b1 commit 9c0dd9d
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .rubocop.yml
Expand Up @@ -19,7 +19,7 @@ Layout/LineLength:
Enabled: false

Metrics/AbcSize:
Max: 18.36
Max: 21.91

Metrics/BlockLength:
Exclude:
Expand Down Expand Up @@ -73,3 +73,7 @@ Style/FormatStringToken:

Style/IfUnlessModifier:
Enabled: false

Style/StringConcatenation:
Exclude:
- 'test/**/*'
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -16,7 +16,7 @@ namespace :test do
desc %(Test Ruby code)
Rake::TestTask.new(:ruby) do |test|
test.libs << 'lib' << 'test'
test.test_files = Dir.glob("#{File.dirname(__FILE__)}/test/**/test_*.rb").sort
test.test_files = Dir.glob("#{__dir__}/test/**/test_*.rb").sort
test.warning = false
end

Expand Down
2 changes: 1 addition & 1 deletion client_side_validations.gemspec
Expand Up @@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.14'
spec.add_development_dependency 'mocha', '~> 1.11'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 0.88.0'
spec.add_development_dependency 'rubocop', '~> 0.89.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.7'
spec.add_development_dependency 'rubocop-rails', '~> 2.7'
spec.add_development_dependency 'simplecov', '~> 0.18.5'
Expand Down
2 changes: 1 addition & 1 deletion dist/client-side-validations.js
Expand Up @@ -7,7 +7,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
(global = global || self, global.ClientSideValidations = factory(global.$));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ClientSideValidations = factory(global.$));
}(this, (function ($) { 'use strict';

$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
Expand Down
2 changes: 1 addition & 1 deletion lib/client_side_validations/action_view/form_builder.rb
Expand Up @@ -4,7 +4,7 @@ module ClientSideValidations
module ActionView
module Helpers
module FormBuilder
def self.prepended(base)
def self.prepended(base) # rubocop:disable Lint/MissingSuper
(base.field_helpers - %i[label check_box radio_button fields_for hidden_field file_field]).each do |selector|
base.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
# Cannot call super here, rewrite all
Expand Down
1 change: 1 addition & 0 deletions lib/client_side_validations/active_model/numericality.rb
Expand Up @@ -7,6 +7,7 @@ module Numericality

def self.included(base)
@@option_map.merge!(base::CHECKS.keys.inject({}) { |acc, elem| acc.merge!(elem => elem) })
super
end

def client_side_hash(model, attribute, force = nil)
Expand Down
4 changes: 2 additions & 2 deletions lib/client_side_validations/files.rb
Expand Up @@ -4,7 +4,7 @@

module ClientSideValidations
module Files
Initializer = File.expand_path(File.dirname(__FILE__) + '/../generators/templates/client_side_validations/initializer.rb')
Javascript = File.expand_path(File.dirname(__FILE__) + '/../../vendor/assets/javascripts/rails.validations.js')
Initializer = File.expand_path('../generators/templates/client_side_validations/initializer.rb', __dir__)
Javascript = File.expand_path('../../vendor/assets/javascripts/rails.validations.js', __dir__)
end
end
4 changes: 2 additions & 2 deletions test/action_view/cases/helper.rb
Expand Up @@ -150,7 +150,7 @@ def form_field(tag, id: nil, name: nil, type: nil, value: nil, multiple: false,
txt
end

def form_for_text(action = 'http://www.example.com', id = nil, html_class = nil, _remote = nil, validators = nil, file = nil, custom_id = false)
def form_for_text(action = 'http://www.example.com', id = nil, html_class = nil, _remote = nil, validators = nil, file = nil, custom_id: false)
txt = +%(<form action="#{action}" accept-charset="UTF-8" method="post")

if validators
Expand All @@ -176,7 +176,7 @@ def whole_form_for(action = 'http://www.example.com', id = nil, html_class = nil
method = options
end

form_for_text(action, id, html_class, remote, (validators || no_validate), file, custom_id) + snowman(method) + (contents || '') + '</form>'
form_for_text(action, id, html_class, remote, (validators || no_validate), file, custom_id: custom_id) + snowman(method) + (contents || '') + '</form>'
end

def form_with_text(action = 'http://www.example.com', id = nil, html_class = nil, local = nil, validators = nil, file = nil)
Expand Down
2 changes: 1 addition & 1 deletion test/base_helper.rb
Expand Up @@ -23,7 +23,7 @@

module TestApp
class Application < Rails::Application
config.root = File.dirname(__FILE__)
config.root = __dir__
config.active_support.deprecation = :log
config.active_support.test_order = :random
config.eager_load = false
Expand Down
2 changes: 1 addition & 1 deletion test/javascript/server.rb
Expand Up @@ -46,7 +46,7 @@ def script_tag(src)

def test(*types)
types.map do |type|
Dir.glob(File.expand_path("public/test/#{type}", settings.root) + '/*.js').map { |file| File.basename(file) }.map do |file|
Dir.glob(File.expand_path("public/test/#{type}/*.js", settings.root)).map { |file| File.basename(file) }.map do |file|
script_tag "/test/#{type}/#{file}"
end.join("\n")
end.join("\n")
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/rails.validations.js
Expand Up @@ -7,7 +7,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
(global = global || self, global.ClientSideValidations = factory(global.$));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ClientSideValidations = factory(global.$));
}(this, (function ($) { 'use strict';

$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
Expand Down

0 comments on commit 9c0dd9d

Please sign in to comment.