request_handler 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -14
- data/CHANGELOG.md +3 -1
- data/CODE_OF_CONDUCT.md +69 -0
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +39 -30
- data/lib/request_handler.rb +6 -0
- data/lib/request_handler/fieldsets_parser.rb +4 -4
- data/lib/request_handler/include_option_parser.rb +2 -2
- data/lib/request_handler/option_parser.rb +3 -3
- data/lib/request_handler/schema_parser.rb +3 -21
- data/lib/request_handler/sort_option_parser.rb +2 -2
- data/lib/request_handler/validation/definition_engine.rb +26 -0
- data/lib/request_handler/validation/dry_engine.rb +42 -0
- data/lib/request_handler/validation/engine.rb +24 -0
- data/lib/request_handler/validation/errors.rb +5 -0
- data/lib/request_handler/validation/result.rb +17 -0
- data/lib/request_handler/version.rb +1 -1
- data/request_handler.gemspec +7 -4
- metadata +44 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb27be2f216ddde5e61c75588e2fcd838ec4d252919fac9761372f63d1187c80
|
4
|
+
data.tar.gz: dbac14a26b2de68aa1d7cf506622f849bc77a2b949424db1ffa33d70a9bbf76c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fac2d974663982067de6d60c16e47e63bca678925f29b6d4ccbc4e25857929ca85f7da1512c61215bd01b502c145846d738c6aa3590b21f395e39eadd6f119d6
|
7
|
+
data.tar.gz: 7656a364baaa0ccc75a179682541e0fe3052972b4272f1f6ced7dedf7ba06e925cbc0936f41d9cadff6b984666e04add629ea96f0d282c25e31bc871090f57d9
|
data/.travis.yml
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
3
|
rvm:
|
4
|
-
- 2.2.10
|
5
|
-
- 2.3.7
|
6
4
|
- 2.4.4
|
7
|
-
- 2.5.
|
8
|
-
- jruby-9.1.17.0
|
5
|
+
- 2.5.3
|
9
6
|
- jruby-9.2.0.0
|
7
|
+
- jruby-9.2.7.0
|
10
8
|
jdk:
|
11
9
|
- oraclejdk8
|
12
10
|
env:
|
@@ -14,27 +12,22 @@ env:
|
|
14
12
|
- "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
15
13
|
matrix:
|
16
14
|
exclude:
|
17
|
-
- rvm: 2.2.10
|
18
|
-
jdk: oraclejdk8
|
19
|
-
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
20
|
-
- rvm: 2.3.7
|
21
|
-
jdk: oraclejdk8
|
22
|
-
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
23
15
|
- rvm: 2.4.4
|
24
16
|
jdk: oraclejdk8
|
25
17
|
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
26
|
-
- rvm: 2.5.
|
18
|
+
- rvm: 2.5.3
|
27
19
|
jdk: oraclejdk8
|
28
20
|
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
29
21
|
allow_failures:
|
30
|
-
- rvm: jruby-9.
|
22
|
+
- rvm: jruby-9.2.0.0
|
31
23
|
jdk: oraclejdk8
|
32
24
|
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
33
|
-
- rvm: jruby-9.2.
|
25
|
+
- rvm: jruby-9.2.7.0
|
34
26
|
jdk: oraclejdk8
|
35
27
|
env: "JRUBY_OPTS='-Xcompile.invokedynamic=true --debug'"
|
28
|
+
- rvm: 2.6.2
|
36
29
|
before_install:
|
37
30
|
- gem update --system
|
38
|
-
- gem install bundler -v
|
31
|
+
- gem install bundler -v 2.0.1
|
39
32
|
before_script:
|
40
33
|
- bundle exec danger
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,9 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [
|
7
|
+
## [1.2.0] - 2019-04-15
|
8
|
+
### Added
|
9
|
+
- Apart from dry-validation, now definition or any other validation library can be used
|
8
10
|
|
9
11
|
## [1.1.0] - 2018-07-13
|
10
12
|
### Changed
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
58
|
+
faith may face temporary or permanent repercussions as determined by other
|
59
|
+
members of the project's leadership.
|
60
|
+
|
61
|
+
## Attribution
|
62
|
+
|
63
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
64
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
65
|
+
|
66
|
+
[homepage]: https://www.contributor-covenant.org
|
67
|
+
|
68
|
+
For answers to common questions about this code of conduct, see
|
69
|
+
https://www.contributor-covenant.org/faq
|
data/{LICENSE.txt → LICENSE}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -8,12 +8,6 @@ This gem allows easy and dry handling of requests based on the dry-validation
|
|
8
8
|
gem for validation and data coersion. It allows to handle headers, filters,
|
9
9
|
include_options, sorting and of course to validate the body.
|
10
10
|
|
11
|
-
## dry-gem dependency
|
12
|
-
|
13
|
-
Version 1.1 removes the strict dependency to dry-types v0.11 & dry-validation v0.11 and allows usage of newer versions of dry-gems. This gem uses these gems but only a very small interface with them therefore this gem itself is usually not impacted by smaller breaking changes each minor version of the dry-gems might introduce.
|
14
|
-
|
15
|
-
**Please check your applications compatibility with each dry-types version and pin versions as necessary**
|
16
|
-
|
17
11
|
## Installation
|
18
12
|
|
19
13
|
Add this line to your application's Gemfile:
|
@@ -30,6 +24,33 @@ Or install it yourself as:
|
|
30
24
|
|
31
25
|
$ gem install request_handler
|
32
26
|
|
27
|
+
## Configuration
|
28
|
+
|
29
|
+
The default logger and separator can be changed globally:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
RequestHandler.configure do
|
33
|
+
logger Logger.new(STDERR)
|
34
|
+
separator '____'
|
35
|
+
validation_engine RequestHandler::Validation::DryEngine
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
39
|
+
### Validation Engine
|
40
|
+
Per default this gem uses the `DryEngine` which relies on dry-validation. All
|
41
|
+
examples in this Readme assume you are using this default engine. However
|
42
|
+
you can also use the builtin `DefinitionEngine`, which uses [Definition](https://github.com/Goltergaul/definition) as validation library:
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
RequestHandler.configure do
|
46
|
+
require 'request_handler/validation/definition_engine'
|
47
|
+
validation_engine RequestHandler::Validation::DefinitionEngine
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
You can also implement your own engine to use any other library, by implementing
|
52
|
+
the abstract class `RequestHandler::Validation::Engine`
|
53
|
+
|
33
54
|
## Usage
|
34
55
|
|
35
56
|
To set up a handler, you need create a class which inherits from
|
@@ -235,18 +256,6 @@ and an additional file `image.png`, the resulting `multipart_params` will be the
|
|
235
256
|
|
236
257
|
Please note that each part's content has to be uploaded as a separate file currently.
|
237
258
|
|
238
|
-
### Configuration
|
239
|
-
|
240
|
-
The default logger and separator can be changed globally by using
|
241
|
-
`RequestHandler.configure {}`.
|
242
|
-
|
243
|
-
```ruby
|
244
|
-
RequestHandler.configure do
|
245
|
-
logger Logger.new(STDERR)
|
246
|
-
separator '____'
|
247
|
-
end
|
248
|
-
```
|
249
|
-
|
250
259
|
### Caveats
|
251
260
|
|
252
261
|
It is currently expected that _url_ parameter are already parsed and included in
|
@@ -263,23 +272,23 @@ end
|
|
263
272
|
|
264
273
|
## Development
|
265
274
|
|
266
|
-
After checking out the repo, run `bin/setup` to install dependencies.
|
267
|
-
|
268
|
-
|
275
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can
|
276
|
+
also run `bin/console` for an interactive prompt that will allow you to experiment.
|
277
|
+
|
278
|
+
Run `bundle exec rspec` to run the tests.
|
269
279
|
|
270
280
|
To install this gem onto your local machine, run `bundle exec rake install`. To
|
271
281
|
release a new version, update the version number in `version.rb`, and then run
|
272
|
-
`bundle exec rake release`, which will create a git tag for the version, push
|
273
|
-
|
274
|
-
to [rubygems.org](https://rubygems.org).
|
282
|
+
`bundle exec rake release`, which will create a git tag for the version, push git
|
283
|
+
commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
275
284
|
|
276
285
|
## Contributing
|
277
|
-
Bug reports and pull requests are welcome on GitHub at
|
278
|
-
|
279
|
-
|
280
|
-
to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
286
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/runtastic/request_handler.
|
287
|
+
This project is intended to be a safe, welcoming space for collaboration, and
|
288
|
+
contributors are expected to adhere to the [code of conduct][cc].
|
281
289
|
|
282
290
|
## License
|
291
|
+
The gem is available as open source under [the terms of the MIT License][mit].
|
283
292
|
|
284
|
-
|
285
|
-
|
293
|
+
[mit]: https://choosealicense.com/licenses/mit/
|
294
|
+
[cc]: ../CODE_OF_CONDUCT.md
|
data/lib/request_handler.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'request_handler/version'
|
4
4
|
require 'request_handler/base'
|
5
|
+
require 'request_handler/validation/dry_engine'
|
5
6
|
require 'confstruct'
|
6
7
|
require 'dry-validation'
|
7
8
|
require 'multi_json'
|
@@ -17,11 +18,16 @@ module RequestHandler
|
|
17
18
|
@configuration ||= ::Confstruct::Configuration.new do
|
18
19
|
logger Logger.new(STDOUT)
|
19
20
|
separator '__'
|
21
|
+
validation_engine Validation::DryEngine
|
20
22
|
end
|
21
23
|
end
|
22
24
|
|
23
25
|
def separator
|
24
26
|
configuration.separator
|
25
27
|
end
|
28
|
+
|
29
|
+
def engine
|
30
|
+
configuration.validation_engine
|
31
|
+
end
|
26
32
|
end
|
27
33
|
end
|
@@ -8,8 +8,8 @@ module RequestHandler
|
|
8
8
|
@params = params
|
9
9
|
allowed.reject! { |_k, v| v == false }
|
10
10
|
allowed.each_value do |option|
|
11
|
-
raise InternalArgumentError, allowed: 'must be a
|
12
|
-
|
11
|
+
raise InternalArgumentError, allowed: 'must be a Schema or a Boolean' unless
|
12
|
+
RequestHandler.engine.valid_schema?(option) || option.is_a?(TrueClass)
|
13
13
|
end
|
14
14
|
@allowed = allowed
|
15
15
|
raise InternalArgumentError, required: 'must be an Array' unless required.is_a?(Array)
|
@@ -39,9 +39,9 @@ module RequestHandler
|
|
39
39
|
if allowed[type] == true
|
40
40
|
option.to_sym
|
41
41
|
else
|
42
|
-
allowed[type]
|
42
|
+
RequestHandler.engine.validate!(option, allowed[type]).output.to_sym
|
43
43
|
end
|
44
|
-
rescue
|
44
|
+
rescue Validation::Error
|
45
45
|
raise FieldsetsParamsError, fieldsets: "invalid field: <#{option}> for type: #{type}"
|
46
46
|
end
|
47
47
|
|
@@ -15,8 +15,8 @@ module RequestHandler
|
|
15
15
|
options.map do |option|
|
16
16
|
option.gsub!('.', ::RequestHandler.separator)
|
17
17
|
begin
|
18
|
-
|
19
|
-
rescue
|
18
|
+
RequestHandler.engine.validate!(option, allowed_options_type).output.to_sym
|
19
|
+
rescue Validation::Error
|
20
20
|
raise OptionNotAllowedError, option.to_sym => 'is not an allowed include option'
|
21
21
|
end
|
22
22
|
end
|
@@ -6,13 +6,13 @@ module RequestHandler
|
|
6
6
|
def initialize(params:, allowed_options_type:)
|
7
7
|
@params = params
|
8
8
|
@allowed_options_type = allowed_options_type
|
9
|
-
raise InternalArgumentError, allowed_options_type: 'must be a
|
9
|
+
raise InternalArgumentError, allowed_options_type: 'must be a Schema' unless schema?
|
10
10
|
end
|
11
11
|
|
12
12
|
private
|
13
13
|
|
14
|
-
def
|
15
|
-
|
14
|
+
def schema?
|
15
|
+
RequestHandler.engine.valid_schema?(@allowed_options_type)
|
16
16
|
end
|
17
17
|
|
18
18
|
def empty_param?(param)
|
@@ -8,7 +8,7 @@ module RequestHandler
|
|
8
8
|
missing_arguments << { schema: 'is missing' } if schema.nil?
|
9
9
|
missing_arguments << { schema_options: 'is missing' } if schema_options.nil?
|
10
10
|
raise MissingArgumentError, missing_arguments unless missing_arguments.empty?
|
11
|
-
raise InternalArgumentError, schema: 'must be a Schema' unless
|
11
|
+
raise InternalArgumentError, schema: 'must be a Schema' unless RequestHandler.engine.valid_schema?(schema)
|
12
12
|
@schema = schema
|
13
13
|
@schema_options = schema_options
|
14
14
|
end
|
@@ -17,22 +17,17 @@ module RequestHandler
|
|
17
17
|
|
18
18
|
def validate_schema(data, with: schema)
|
19
19
|
raise MissingArgumentError, data: 'is missing' if data.nil?
|
20
|
-
data = deep_symbolize_keys(data) if with.rules.keys.first.is_a?(Symbol)
|
21
20
|
validator = validate(data, schema: with)
|
22
21
|
validation_failure?(validator)
|
23
22
|
validator.output
|
24
23
|
end
|
25
24
|
|
26
25
|
def validate(data, schema:)
|
27
|
-
|
28
|
-
schema.call(data)
|
29
|
-
else
|
30
|
-
schema.with(schema_options).call(data)
|
31
|
-
end
|
26
|
+
RequestHandler.engine.validate(data, schema, options: schema_options)
|
32
27
|
end
|
33
28
|
|
34
29
|
def validation_failure?(validator)
|
35
|
-
return
|
30
|
+
return if validator.valid?
|
36
31
|
errors = validator.errors.each_with_object({}) do |(k, v), memo|
|
37
32
|
add_note(v, k, memo)
|
38
33
|
end
|
@@ -48,19 +43,6 @@ module RequestHandler
|
|
48
43
|
memo
|
49
44
|
end
|
50
45
|
|
51
|
-
def deep_symbolize_keys(hash)
|
52
|
-
mem = {}
|
53
|
-
hash.map do |key, value|
|
54
|
-
if value.is_a?(Hash)
|
55
|
-
value = deep_symbolize_keys(value)
|
56
|
-
elsif value.is_a?(Array)
|
57
|
-
value.map! { |v| v.is_a?(Hash) ? deep_symbolize_keys(v) : v }
|
58
|
-
end
|
59
|
-
mem[key.to_sym] = value
|
60
|
-
end
|
61
|
-
mem
|
62
|
-
end
|
63
|
-
|
64
46
|
attr_reader :schema, :schema_options
|
65
47
|
end
|
66
48
|
end
|
@@ -36,8 +36,8 @@ module RequestHandler
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def allowed_option(name)
|
39
|
-
|
40
|
-
rescue
|
39
|
+
RequestHandler.engine.validate!(name, allowed_options_type).output
|
40
|
+
rescue Validation::Error
|
41
41
|
raise OptionNotAllowedError, name.to_sym => 'is not an allowed sort option'
|
42
42
|
end
|
43
43
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative 'errors'
|
2
|
+
require_relative 'engine'
|
3
|
+
require_relative 'result'
|
4
|
+
require 'active_support/core_ext/hash/keys'
|
5
|
+
|
6
|
+
module RequestHandler
|
7
|
+
module Validation
|
8
|
+
class DefinitionEngine < Engine
|
9
|
+
def self.valid_schema?(definition)
|
10
|
+
definition.is_a?(::Definition::Types::Base)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.validate(value, schema, options: {}) # rubocop:disable Lint/UnusedMethodArgument
|
14
|
+
value = value.deep_symbolize_keys if value.is_a?(Hash)
|
15
|
+
result = schema.conform(value)
|
16
|
+
Result.new(output: result.value, errors: result.error_hash)
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.validate!(value, schema, options: {})
|
20
|
+
validate(value, schema, options).tap do |result|
|
21
|
+
raise Validation::Error unless result.valid?
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require_relative 'errors'
|
2
|
+
require_relative 'engine'
|
3
|
+
require_relative 'result'
|
4
|
+
require 'active_support/core_ext/hash/keys'
|
5
|
+
|
6
|
+
module RequestHandler
|
7
|
+
module Validation
|
8
|
+
class DryEngine < Engine
|
9
|
+
def self.valid_schema?(schema)
|
10
|
+
schema.respond_to?(:call)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.validate(value, schema, options: {})
|
14
|
+
value = value.deep_symbolize_keys if schema.respond_to?(:rules) &&
|
15
|
+
schema.rules.keys.first.is_a?(Symbol)
|
16
|
+
result = if options.empty?
|
17
|
+
schema.call(value)
|
18
|
+
else
|
19
|
+
schema.with(options).call(value)
|
20
|
+
end
|
21
|
+
|
22
|
+
to_result(result)
|
23
|
+
rescue Dry::Types::ConstraintError => e
|
24
|
+
Result.new(output: nil, errors: { '' => e })
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.validate!(value, schema, options: {})
|
28
|
+
validate(value, schema, options).tap do |result|
|
29
|
+
raise Validation::Error unless result.valid?
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.to_result(result)
|
34
|
+
if result.is_a?(Dry::Validation::Result)
|
35
|
+
Result.new(output: result.output, errors: result.errors)
|
36
|
+
else
|
37
|
+
Result.new(output: result, errors: {})
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
require_relative 'errors'
|
3
|
+
|
4
|
+
module RequestHandler
|
5
|
+
module Validation
|
6
|
+
class Engine
|
7
|
+
def self.valid_schema?(_schema)
|
8
|
+
raise NotImplementedError
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.validate(_value, _schema, options: {}) # rubocop:disable Lint/UnusedMethodArgument
|
12
|
+
raise NotImplementedError
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.validate!(_value, _schema, options: {}) # rubocop:disable Lint/UnusedMethodArgument
|
16
|
+
raise NotImplementedError
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
attr_accessor :value, :schema, :options
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/request_handler.gemspec
CHANGED
@@ -7,14 +7,14 @@ require 'request_handler/version'
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = 'request_handler'
|
9
9
|
spec.version = RequestHandler::VERSION
|
10
|
-
spec.authors = ['Andreas Eger', '
|
11
|
-
spec.email = ['andreas.eger@runtastic.com', '
|
10
|
+
spec.authors = ['Andreas Eger', 'Dominik Goltermann']
|
11
|
+
spec.email = ['andreas.eger@runtastic.com', 'dominik.goltermann@runtastic.com']
|
12
12
|
|
13
13
|
spec.summary = 'shared base for request_handler using dry-* gems'
|
14
14
|
spec.description = 'shared base for request_handler using dry-* gems'
|
15
15
|
spec.homepage = 'https://github.com/runtastic/request_handler'
|
16
16
|
spec.license = 'MIT'
|
17
|
-
spec.required_ruby_version = '~> 2.
|
17
|
+
spec.required_ruby_version = '~> 2.4'
|
18
18
|
|
19
19
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
20
20
|
f.match(%r{^(test|spec|features)/})
|
@@ -28,8 +28,9 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.add_dependency 'confstruct', '~> 1.0.2'
|
30
30
|
spec.add_dependency 'multi_json', '~> 1.12'
|
31
|
+
spec.add_dependency 'activesupport', '> 4.0'
|
31
32
|
|
32
|
-
spec.add_development_dependency 'bundler'
|
33
|
+
spec.add_development_dependency 'bundler'
|
33
34
|
spec.add_development_dependency 'rake', '~> 10.0'
|
34
35
|
spec.add_development_dependency 'rspec', '~> 3.5'
|
35
36
|
spec.add_development_dependency 'fuubar', '~> 2.2'
|
@@ -44,4 +45,6 @@ Gem::Specification.new do |spec|
|
|
44
45
|
spec.add_development_dependency 'guard-rubocop'
|
45
46
|
|
46
47
|
spec.add_development_dependency 'rack'
|
48
|
+
|
49
|
+
spec.add_development_dependency 'definition', '~> 0.5'
|
47
50
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: request_handler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Eger
|
8
|
-
-
|
8
|
+
- Dominik Goltermann
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-validation
|
@@ -79,20 +79,34 @@ dependencies:
|
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '1.12'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: activesupport
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '4.0'
|
89
|
+
type: :runtime
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '4.0'
|
82
96
|
- !ruby/object:Gem::Dependency
|
83
97
|
name: bundler
|
84
98
|
requirement: !ruby/object:Gem::Requirement
|
85
99
|
requirements:
|
86
|
-
- - "
|
100
|
+
- - ">="
|
87
101
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
102
|
+
version: '0'
|
89
103
|
type: :development
|
90
104
|
prerelease: false
|
91
105
|
version_requirements: !ruby/object:Gem::Requirement
|
92
106
|
requirements:
|
93
|
-
- - "
|
107
|
+
- - ">="
|
94
108
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
109
|
+
version: '0'
|
96
110
|
- !ruby/object:Gem::Dependency
|
97
111
|
name: rake
|
98
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -247,10 +261,24 @@ dependencies:
|
|
247
261
|
- - ">="
|
248
262
|
- !ruby/object:Gem::Version
|
249
263
|
version: '0'
|
264
|
+
- !ruby/object:Gem::Dependency
|
265
|
+
name: definition
|
266
|
+
requirement: !ruby/object:Gem::Requirement
|
267
|
+
requirements:
|
268
|
+
- - "~>"
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
version: '0.5'
|
271
|
+
type: :development
|
272
|
+
prerelease: false
|
273
|
+
version_requirements: !ruby/object:Gem::Requirement
|
274
|
+
requirements:
|
275
|
+
- - "~>"
|
276
|
+
- !ruby/object:Gem::Version
|
277
|
+
version: '0.5'
|
250
278
|
description: shared base for request_handler using dry-* gems
|
251
279
|
email:
|
252
280
|
- andreas.eger@runtastic.com
|
253
|
-
-
|
281
|
+
- dominik.goltermann@runtastic.com
|
254
282
|
executables: []
|
255
283
|
extensions: []
|
256
284
|
extra_rdoc_files: []
|
@@ -260,10 +288,11 @@ files:
|
|
260
288
|
- ".rubocop.yml"
|
261
289
|
- ".travis.yml"
|
262
290
|
- CHANGELOG.md
|
291
|
+
- CODE_OF_CONDUCT.md
|
263
292
|
- Dangerfile
|
264
293
|
- Gemfile
|
265
294
|
- Guardfile
|
266
|
-
- LICENSE
|
295
|
+
- LICENSE
|
267
296
|
- README.md
|
268
297
|
- Rakefile
|
269
298
|
- bin/ci
|
@@ -288,6 +317,11 @@ files:
|
|
288
317
|
- lib/request_handler/schema_parser.rb
|
289
318
|
- lib/request_handler/sort_option.rb
|
290
319
|
- lib/request_handler/sort_option_parser.rb
|
320
|
+
- lib/request_handler/validation/definition_engine.rb
|
321
|
+
- lib/request_handler/validation/dry_engine.rb
|
322
|
+
- lib/request_handler/validation/engine.rb
|
323
|
+
- lib/request_handler/validation/errors.rb
|
324
|
+
- lib/request_handler/validation/result.rb
|
291
325
|
- lib/request_handler/version.rb
|
292
326
|
- request_handler.gemspec
|
293
327
|
homepage: https://github.com/runtastic/request_handler
|
@@ -302,7 +336,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
302
336
|
requirements:
|
303
337
|
- - "~>"
|
304
338
|
- !ruby/object:Gem::Version
|
305
|
-
version: '2.
|
339
|
+
version: '2.4'
|
306
340
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
307
341
|
requirements:
|
308
342
|
- - ">="
|