sinatra-param-validator 0.16.0 → 0.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/sinatra/param_validator/helpers.rb +10 -2
- data/lib/sinatra/param_validator/version.rb +1 -1
- data/sinatra-param-validator.gemspec +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78acd25fda0c630a67c5ce3e2b24a9300c70432b40621a1ebd2822e4d63a549b
|
4
|
+
data.tar.gz: 6ad51ab220feb9b3ec422532d1ae46bc2b812ec9969eec4e3b7a5b6b0387f4a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 224a086b11dc650444326980951756850ae049e4f09b17dac6ae73881327ae694ca2c38f3855887300ebeeed6a9fc36d61651d61884cbe237f057d964858e6e2
|
7
|
+
data.tar.gz: 1b80d184a2e078f22a265cfcc3d38aa083f4cb6ad0e0850d193b5c39ef2bbe190ea87c7edbd628c9b3121472b7704367d58e9e9a8c4b357338daf14c0e70d8cf
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -59,11 +59,19 @@ module Sinatra
|
|
59
59
|
|
60
60
|
def _update_params_hash(key, parameter, default)
|
61
61
|
if params.key?(key) && !params[key].nil?
|
62
|
-
|
62
|
+
_set_param_to_coerced key, parameter
|
63
63
|
elsif !default.nil?
|
64
|
-
|
64
|
+
_set_param_to_default key, default
|
65
65
|
end
|
66
66
|
end
|
67
|
+
|
68
|
+
def _set_param_to_coerced(key, parameter)
|
69
|
+
params[key] = parameter.coerced unless parameter.coerced.nil?
|
70
|
+
end
|
71
|
+
|
72
|
+
def _set_param_to_default(key, default)
|
73
|
+
params[key] = default.respond_to?(:call) ? default.call : default
|
74
|
+
end
|
67
75
|
end
|
68
76
|
end
|
69
77
|
end
|
@@ -9,13 +9,13 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ['rick@selby-family.co.uk']
|
10
10
|
|
11
11
|
spec.summary = 'Validation of parameters for Sinatra'
|
12
|
-
spec.homepage = 'https://github.com/rickselby/sinatra-
|
12
|
+
spec.homepage = 'https://github.com/rickselby/sinatra-param-validator'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
spec.required_ruby_version = '>= 2.6.0'
|
15
15
|
|
16
|
-
spec.metadata['changelog_uri'] = 'https://github.com/rickselby/sinatra-
|
16
|
+
spec.metadata['changelog_uri'] = 'https://github.com/rickselby/sinatra-para-validator/CHANGELOG.md'
|
17
17
|
spec.metadata['homepage_uri'] = spec.homepage
|
18
|
-
spec.metadata['source_code_uri'] = 'https://github.com/rickselby/sinatra-
|
18
|
+
spec.metadata['source_code_uri'] = 'https://github.com/rickselby/sinatra-param-validator'
|
19
19
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
20
20
|
|
21
21
|
# Specify which files should be added to the gem when it is released.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-param-validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rick Selby
|
@@ -166,13 +166,13 @@ files:
|
|
166
166
|
- lib/sinatra/param_validator/validator/url_param.rb
|
167
167
|
- lib/sinatra/param_validator/version.rb
|
168
168
|
- sinatra-param-validator.gemspec
|
169
|
-
homepage: https://github.com/rickselby/sinatra-
|
169
|
+
homepage: https://github.com/rickselby/sinatra-param-validator
|
170
170
|
licenses:
|
171
171
|
- MIT
|
172
172
|
metadata:
|
173
|
-
changelog_uri: https://github.com/rickselby/sinatra-
|
174
|
-
homepage_uri: https://github.com/rickselby/sinatra-
|
175
|
-
source_code_uri: https://github.com/rickselby/sinatra-
|
173
|
+
changelog_uri: https://github.com/rickselby/sinatra-para-validator/CHANGELOG.md
|
174
|
+
homepage_uri: https://github.com/rickselby/sinatra-param-validator
|
175
|
+
source_code_uri: https://github.com/rickselby/sinatra-param-validator
|
176
176
|
rubygems_mfa_required: 'true'
|
177
177
|
post_install_message:
|
178
178
|
rdoc_options: []
|