rack-bodyparser 0.0.2 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 743caf986aba0bf3b1de5f82ebf7939f4163cc2f
4
- data.tar.gz: 687565e7eaec8e87c5d5d17a728f3dfa800ba4c2
3
+ metadata.gz: 184b75e43e419e7d825abc63f2aa2612eeb536fd
4
+ data.tar.gz: b46e9fee21d46573d2dbecd3e09d9f3cc16d34ce
5
5
  SHA512:
6
- metadata.gz: 214c1fc24ac38fab23bfd4c2fb54435403058eb93c62fa2bd5613bc2990e3447fb2149af7afd5bc0156baae0079163ade0d51ff622e56ea3b485abbabec15df1
7
- data.tar.gz: 44c165eb469358d64021a4ee0b393925da606c5896463cb769e49158b5a6da1a844bf004b16637a74a527a79b43de6227c8333b3bd49c1cc3ae04d12dc53ab20
6
+ metadata.gz: 8a1c51c9e46fde3ee67a75aa822e91e43cda7823c752225471de4477e87eac4f8d12943636a7b107343dff3aeb945455bc0d1ecbed38b9f1d9275228fd7debec
7
+ data.tar.gz: d79f05a5e8e5e3d42df828721ed3d4a65d9ff6fec69ad4172a5a062625cd0577c895442ca1fe69e5dc0486ea3e4abc6177e7b34ba4a25e9c4e8d621f4b7f0ded
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1,8 @@
1
+ Style/BlockLength:
2
+ Exclude:
3
+ - 'spec/**/*.rb'
4
+ - 'benchmark/**/*.rb'
5
+
6
+ Metrics/LineLength:
7
+ Exclude:
8
+ - 'benchmark/**/*.rb'
data/README.md CHANGED
@@ -1,38 +1,40 @@
1
1
  # Rack::BodyParser #
2
2
 
3
- Rack middleware that provides a way to parse the request body without touching
4
- `params` or `request.params`.
3
+ Rack middleware for parsing incoming request body per content type.
5
4
 
5
+ ### Inspiration ###
6
6
 
7
- Instead the parser output is available through `env['parsed_body']` or
8
- optionally through the Rack::Request object as `request.parsed_body` and/or
9
- a custom attribute per parser.
7
+ `Rack::BodyParser` is heavily inspired by
8
+ [Rack::Parser](https://github.com/achiu/rack-parser),
9
+ but behaves a bit different. See Key Features.
10
10
 
11
- Rack::BodyParser is heavily inspired by
12
- [Rack::Parser](https://github.com/achiu/rack-parser).
11
+ ## Key Features; Differences to `Rack::Parser` ##
13
12
 
14
- ## Key Features (differences to Rack::Parser) ##
13
+ 1. `Rack::BodyParser` only parses the request **body**.
15
14
 
16
- 1. separation of `params`/`request.params` and the `parsed_body`.
17
- 1. (optional) patching of `Rack::Request`:
15
+ 1. `Rack::BodyParser` does not touch or replace the original `params` or `request.params`, and does not mix `params` and body payload. Instead the parsed result is stored in a separate key `parsed_body` in Rack's `env`.
18
16
 
19
- Access parsed payload through `request.parsed_body` with support
20
- for custom `request.#{your_key_here}` per parser.
21
- Enable with `:patch_request => true`.
17
+ 1. (optional) patching of `Rack::Request` with support for custom getter method Parsed result available as `request.parsed_body` with support for custom `request.#{your_key_here}` per parser. Enable with `:patch_request => true`.
22
18
 
23
- Note: Rack::BodyParser **does** **not** contain any parsers by out of the box.
19
+ 1. (optional) access to headers/env. If your parser `respond_to? :env=` it will be invoked with Rack's
20
+ `env` just before running `call` on your parser.
21
+
22
+ #### Batteries not included ####
23
+
24
+ `Rack::BodyParser` **does** **not** contain any parsers out of the box.
24
25
 
25
26
  ## Installation ##
26
27
 
27
- Via rubygems:
28
+ Available through [RubyGems](https://rubygems.org/gems/rack-bodyparser):
28
29
 
29
30
  `gem install rack-bodyparser`
30
31
 
31
32
  ## Usage ##
32
33
 
33
- Define your parsers per content_type.
34
+ Define your `:parsers` per [`media-type`](http://www.rubydoc.info/gems/rack/Rack/Request/Helpers#media_type-instance_method), which is the `content-type` without media type parameters;
35
+ e.g., when `content-type` is `text/plain;charset=utf-8`, the media-type is `text/plain`.
34
36
 
35
- Rack::BodyParser accepts `String` or `Regexp` keys as content_type,
37
+ Parsers configuration accepts a `String` or `Regexp` as media-type key,
36
38
  and anything that `respond_to? 'call'` as parser.
37
39
 
38
40
  Sinatra example:
@@ -43,7 +45,7 @@ Sinatra example:
43
45
  use Rack::BodyParser, :parsers => {
44
46
  'application/json' => proc { |data| JSON.parse data },
45
47
  'application/xml' => proc { |data| XML.parse data },
46
- %r{msgpack} => proc { |data| Msgpack.parse data }
48
+ /msgpack/ => proc { |data| Msgpack.parse data }
47
49
  }
48
50
 
49
51
  post '/' do
@@ -53,29 +55,32 @@ end
53
55
 
54
56
  ### Error Handling ###
55
57
 
56
- Rack::BodyParser has one default error handler that can be overridden by
57
- setting the 'default' handler. These works like `:parsers`. Use a `String` or
58
- `Regexp` as content_type key and anything that `respond_to? 'call'` as the
58
+ `Rack::BodyParser` has one default error handler that can be overridden by
59
+ setting the 'default' handler. As with parsers, you can use a `String` or
60
+ `Regexp` as media-type key and anything that `respond_to? 'call'` as the
59
61
  error handler. The error handler must accept the two parameters
60
- `Error` and `type` (the content type).
62
+ `Error` and `type` (the media type).
61
63
 
62
64
  ```ruby
63
65
  use Rack::Parser, :handlers => {
64
66
  'default' => proc { |e, type|
65
67
  [400, {}, ['[Rack::BodyParser] Failed to parse %s: %s' % [type, e.to_s]]]
66
- }
68
+ },
69
+ 'application/xml' => proc { [400, {}, 'Error: XML unsupported'] }
67
70
  }
68
71
  ```
69
72
 
70
- Rack::BodyParsers will try to `warn` of a `logger` is present.
71
-
72
- Note: the error handler rescues exceptions that are descents of `StandardError`.
73
+ __Note__: the error handler rescues exceptions that descend from `StandardError`.
73
74
  See http://www.mikeperham.com/2012/03/03/the-perils-of-rescue-exception/
74
75
 
76
+
77
+ #### Logging ####
78
+ `Rack::BodyParser` will try to `warn` if a `logger` is present.
79
+
75
80
  ## Patch Rack::Request ##
76
81
 
77
- Setting up Rack::BodyParser with `:patch_request => true` will add
78
- a `parsed_body` method to Rack::Request. Parsers can also provide a
82
+ Setting up `Rack::BodyParser` with `:patch_request => true` will add
83
+ a `parsed_body` getter method to `Rack::Request`. Parsers can also provide a
79
84
  `:rack_request_key` to define a custom key per parser:
80
85
 
81
86
  ```ruby
@@ -120,15 +125,32 @@ post '/' do
120
125
  puts request.document
121
126
  end
122
127
  ```
128
+ ## Request headers/environment ##
123
129
 
124
- ## Inspirations ##
130
+ Need headers or other data from Rack's `env` in your parser? Set up your parser
131
+ with a setter method, `respond_to? :env=`, and it will be invoked just before running
132
+ the main `call` method.
133
+
134
+ ```ruby
125
135
 
126
- This project is heavily inspired by [Rack::Parser](https://github.com/achiu/rack-parser). I built
127
- this because I did not want to mix `params` and the body payload.
136
+ module ThisParserNeedsHeaders
137
+ def self.env=(env)
138
+ @env = env
139
+ end
140
+
141
+ def self.call(body)
142
+ # @env available here for your parsing pleasure.
143
+ end
144
+ end
145
+
146
+ use Rack::BodyParser, :parsers => {
147
+ 'plain/text' => ThisParserNeedsHeaders
148
+ }
149
+ ```
128
150
 
129
151
  ## Copyright
130
152
 
131
- `Copyright © 2016 Aaron Heesakkers.`
153
+ `Copyright © 2016, 2017 Aaron Heesakkers.`
132
154
 
133
155
  See [MIT-LICENSE](https://github.com/aars/rack-bodyparser/blob/master/MIT-LICENSE) for details.
134
156
 
@@ -0,0 +1,8 @@
1
+ require 'rack/test'
2
+ require 'benchmark/ips'
3
+
4
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
6
+ require 'rack/bodyparser'
7
+
8
+
@@ -0,0 +1,62 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ require 'benchmark_helper'
3
+
4
+ # Helper method providing request options.
5
+ def req_opts(content_type = 'plain/text')
6
+ {
7
+ input: 'body',
8
+ 'CONTENT_TYPE' => content_type
9
+ }
10
+ end
11
+
12
+ # MockParser
13
+ module MockParser
14
+ def self.env=(env)
15
+ @env = env
16
+ end
17
+
18
+ def self.call(_body)
19
+ 'parsed body from mock parser'
20
+ end
21
+ end
22
+
23
+ Benchmark.ips do |x|
24
+ noop = proc { [200, {}, ['hello']] }
25
+ middleware_opts = {
26
+ parsers: {
27
+ 'plain/text' => proc { 'string matched parser' },
28
+ /regexp/ => proc { 'regexp matched parser' },
29
+ 'mock' => MockParser
30
+ }
31
+ }
32
+ middleware_opts_patched = middleware_opts.clone.update(patch_request: true)
33
+
34
+ middleware = Rack::BodyParser.new(noop, middleware_opts)
35
+ middleware_patched = Rack::BodyParser.new(noop, middleware_opts_patched)
36
+
37
+ # Compare BodyParser to a simple noop request.
38
+ noop_req = Rack::MockRequest.new(noop)
39
+ parser_req = Rack::MockRequest.new(middleware)
40
+ parser_patched_req = Rack::MockRequest.new(middleware_patched)
41
+
42
+ # And off we go!
43
+ x.config(time: 5, warmup: 1)
44
+ x.report('Without BodyParser') { noop_req.post('/', req_opts) } # baseline
45
+ # Try different setups
46
+ x.report('No parser found') do
47
+ parser_req.post('/', req_opts('x'))
48
+ end
49
+ x.report('String') do
50
+ parser_req.post('/', req_opts)
51
+ end
52
+ x.report('Regexp') do
53
+ parser_req.post('/', req_opts('regexp'))
54
+ end
55
+ x.report('Str, env') do
56
+ parser_req.post('/', req_opts('mock'))
57
+ end
58
+ x.report('Str, patch_request') do
59
+ parser_patched_req.post('/', req_opts)
60
+ end
61
+ x.compare!
62
+ end
@@ -1,62 +1,91 @@
1
1
  module Rack
2
+ # BodyParser implementation.
2
3
  class BodyParser
3
4
  # Where to get input.
4
5
  REQUEST_BODY = 'rack.input'.freeze
5
6
  # Where to store in env
6
7
  RACK_ENV_KEY = 'parsed_body'.freeze
7
- # Where to store in Rack::Request in case of options[:patch_request]
8
+ # Where to store in Rack::Request in case of opts[:patch_request]
8
9
  RACK_REQUEST_KEY = 'parsed_body'.freeze
9
10
 
10
11
  # Default error handler
11
- ERROR_MESSAGE = "[Rack::BodyParser] Failed to parse %s: %s\n"
12
- ERROR_HANDLER = proc { |e, type|
13
- [400, {}, [ERROR_MESSAGE % [type, e.to_s]]]
14
- }
12
+ ERROR_MESSAGE = "[Rack::BodyParser] Failed to parse %s: %s\n".freeze
13
+
14
+ ERROR_HANDLER = proc do |e, type|
15
+ [400, {}, format(ERROR_MESSAGE, type, e.to_s)]
16
+ end
17
+
18
+ HANDLERS = { 'default' => ERROR_HANDLER }.freeze
19
+
15
20
  attr_reader :parsers, :handlers, :logger
16
21
 
17
- def initialize(app, options = {})
22
+ def initialize(app, opts = {})
18
23
  @app = app
19
- @parsers = options.delete(:parsers) || {}
20
- @handlers = options.delete(:handlers) || {}
21
- @handlers = {'default' => ERROR_HANDLER}.merge(@handlers)
22
- @options = options
24
+ @parsers = opts.delete(:parsers) || {}
25
+ @handlers = HANDLERS.merge(opts.delete(:handlers) || {})
26
+ @logger = opts.delete(:logger)
27
+ @opts = opts
23
28
  end
24
29
 
25
30
  def call(env)
26
31
  type = Rack::Request.new(env).media_type
27
32
  parser = type && detect(parsers, type)
28
- body = parser && env[REQUEST_BODY].read; env[REQUEST_BODY].rewind
29
- if body && !body.empty?
30
- parser = parser.last
33
+
34
+ if parser
31
35
  begin
32
- parsed = parser.call body
33
- env.update RACK_ENV_KEY => parsed
34
- patch_rack_request parser, parsed if @options[:patch_request]
36
+ parse_with(parser.last, env) # parser.last is actual parser
35
37
  rescue StandardError => e
36
- warn! e, type
37
- handler = (detect(handlers, type) || detect(handlers, 'default')).last
38
- return handler.call e, type
38
+ return handle_error(e, type) # return error response
39
39
  end
40
40
  end
41
+
42
+ # return control to app
41
43
  @app.call env
42
44
  end
43
45
 
46
+ def request_body(env)
47
+ body = env[REQUEST_BODY].read
48
+ env[REQUEST_BODY].rewind
49
+
50
+ body
51
+ end
52
+
53
+ def parse_with(parser, env)
54
+ body = request_body(env)
55
+ return unless body && !body.empty?
56
+
57
+ # Give env to parser if it has a setter for it.
58
+ parser.env = env if parser.respond_to? :env=
59
+
60
+ # parse!
61
+ parsed = parser.call(body)
62
+
63
+ # store results in env, optionally in Rack::Request.
64
+ env.update(RACK_ENV_KEY => parsed)
65
+ patch_rack_request(parser, parsed) if @opts[:patch_request]
66
+ end
67
+
68
+ def handle_error(e, type)
69
+ warn!(e, type)
70
+ handler = (detect(handlers, type) || detect(handlers, 'default')).last
71
+ handler.call(e, type)
72
+ end
73
+
44
74
  def patch_rack_request(parser, parsed)
45
- if parser.respond_to?(:rack_request_key)
46
- Rack::Request.send(:define_method, parser.rack_request_key) { parsed }
47
- end
48
- Rack::Request.send(:define_method, RACK_REQUEST_KEY) { parsed }
75
+ return unless parser.respond_to?(:rack_request_key)
76
+ Rack::Request.send(:define_method, parser.rack_request_key) { parsed }
49
77
  end
50
78
 
79
+ # returns [type, parser]
51
80
  def detect(hash, what)
52
- hash.detect { |match, _|
81
+ hash.detect do |match, _|
53
82
  match.is_a?(Regexp) ? what.match(match) : what.eql?(match)
54
- }
83
+ end
55
84
  end
56
85
 
57
86
  def warn!(e, type)
58
87
  return unless logger
59
- logger.warn ERROR_MESSAGE % [type, e.to_s]
88
+ logger.warn format(ERROR_MESSAGE, type, e.to_s)
60
89
  end
61
90
  end
62
91
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class BodyParser
3
- VERSION = "0.0.2"
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
@@ -11,16 +11,19 @@ Gem::Specification.new do |s|
11
11
  s.homepage = 'https://www.github.com/aars/rack-bodyparser'
12
12
  s.summary = 'Rack Middleware for parsing request body'
13
13
  s.description = %(
14
- Rack Middleware for parsing request body without touching request.params.
15
- Allowing full separation of query_string params and body payload.
14
+ Rack Middleware for parsing request body without touching or
15
+ mixing in request.params.
16
16
  )
17
17
 
18
18
  s.files = `git ls-files`.split("\n")
19
19
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
- s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map do |f|
21
+ File.basename(f)
22
+ end
21
23
  s.require_paths = ['lib']
22
24
 
23
25
  s.add_dependency 'rack'
24
- s.add_development_dependency 'minitest'
26
+ s.add_development_dependency 'rspec'
25
27
  s.add_development_dependency 'rack-test'
28
+ s.add_development_dependency 'benchmark-ips'
26
29
  end
@@ -0,0 +1,133 @@
1
+ require 'spec_helper'
2
+
3
+ describe Rack::BodyParser do
4
+ let(:app) { ->(env) { [200, {}, env['PATH_INFO']] } }
5
+ let(:request) do
6
+ req = Rack::MockRequest.env_for('/', method: :post, input: 'plain text')
7
+ req['CONTENT_TYPE'] = 'text/plain'
8
+ req
9
+ end
10
+
11
+ context 'parsing' do
12
+ let(:parsed_env_key) { Rack::BodyParser::RACK_ENV_KEY }
13
+
14
+ it 'does nothing for unconfigured media-type' do
15
+ Rack::BodyParser.new(app).call(request)
16
+ expect(request).not_to have_key(parsed_env_key)
17
+ end
18
+
19
+ it 'uses the correct parser for configured media-type (string)' do
20
+ parsed_response = 'plain text parsed!'
21
+ opts = {
22
+ parsers: {
23
+ 'application/xml' => proc { 'not me' },
24
+ 'text/plain' => proc { parsed_response },
25
+ 'application/json' => proc { 'not me' }
26
+ }
27
+ }
28
+ Rack::BodyParser.new(app, opts).call(request)
29
+
30
+ expect(request[parsed_env_key]).to eq(parsed_response)
31
+ end
32
+
33
+ it 'uses the correct parser for configured media-type (regexp)' do
34
+ parsed_response = 'plain text parsed!'
35
+ opts = {
36
+ parsers: {
37
+ /plain/ => proc { parsed_response }
38
+ }
39
+ }
40
+ Rack::BodyParser.new(app, opts).call(request)
41
+
42
+ expect(request[parsed_env_key]).to eq(parsed_response)
43
+ end
44
+
45
+ it 'patches the request object with a custom getter' do
46
+ opts = {
47
+ patch_request: true,
48
+ parsers: {
49
+ 'text/plain' => MockParser
50
+ }
51
+ }
52
+ Rack::BodyParser.new(app, opts).call(request)
53
+
54
+ parsed_response = MockParser.call('')
55
+ custom_getter = MockParser.rack_request_key
56
+
57
+ # parser was called?
58
+ expect(request[parsed_env_key]).to eq(parsed_response)
59
+
60
+ # Rack::Request was patched with custom getter?
61
+ rack_request = Rack::Request.new('')
62
+ expect(rack_request).to respond_to(custom_getter)
63
+ expect(rack_request.send(custom_getter)).to eq(parsed_response)
64
+ end
65
+
66
+ it 'passes env to parser if it has a setter' do
67
+ opts = {
68
+ parsers: {
69
+ 'text/plain' => MockParserWithEnvSetter
70
+ }
71
+ }
72
+ Rack::BodyParser.new(app, opts).call(request)
73
+
74
+ # MockParserWithEnvSetter will return env['REQUEST_METHOD'].
75
+ expect(request[parsed_env_key]).to eq(request['REQUEST_METHOD'])
76
+ end
77
+ end
78
+
79
+ context 'handlers' do
80
+ it 'responds with default' do
81
+ err = 'it broke'
82
+ opts = {
83
+ parsers: { 'text/plain' => proc { raise StandardError, err } }
84
+ }
85
+ res = Rack::BodyParser.new(app, opts).call(request)
86
+
87
+ # test response status code and error message
88
+ expect(res[0]).to eq(Rack::BodyParser::ERROR_HANDLER.call[0])
89
+ expect(res[2]).to include(err)
90
+ end
91
+
92
+ it 'responds with custom handler' do
93
+ status = 422
94
+ err = 'you broke it'
95
+ opts = {
96
+ parsers: { 'text/plain' => proc { raise StandardError, 'it broke' } },
97
+ handlers: { 'text/plain' => proc { [status, {}, err] } }
98
+ }
99
+ res = Rack::BodyParser.new(app, opts).call(request)
100
+
101
+ # test response status code and error message
102
+ expect(res[0]).to eq(status)
103
+ expect(res[2]).to include(err)
104
+ end
105
+
106
+ it 'can override default' do
107
+ status = 418
108
+ err = 'I am a teapot'
109
+ opts = {
110
+ parsers: { 'text/plain' => proc { raise StandardError, 'it broke' } },
111
+ handlers: { 'default' => proc { [status, {}, err] } }
112
+ }
113
+ res = Rack::BodyParser.new(app, opts).call(request)
114
+
115
+ # test response status code and error message
116
+ expect(res[0]).to eq(status)
117
+ expect(res[2]).to include(err)
118
+ end
119
+ end
120
+
121
+ context 'logger' do
122
+ it 'warns on error' do
123
+ err = 'it broke'
124
+ opts = {
125
+ parsers: { 'text/plain' => proc { raise StandardError, err } },
126
+ logger: MockLogger
127
+ }
128
+
129
+ expect(MockLogger).to receive(:warn)
130
+ Rack::BodyParser.new(app, opts).call(request)
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,49 @@
1
+ ENV['RACK_ENV'] = 'test'
2
+
3
+ require 'rspec'
4
+ require 'rack/test'
5
+
6
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
7
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
8
+ require 'rack/bodyparser'
9
+
10
+ # MockParser to test :patch_request option.
11
+ module MockParser
12
+ # custom getter key
13
+ def self.rack_request_key
14
+ :mockparser_document
15
+ end
16
+
17
+ def self.call(_body)
18
+ 'mockparser called!'
19
+ end
20
+ end
21
+
22
+ # MockParser to test env setter. Will return env['REQUEST_METHOD'] when called.
23
+ module MockParserWithEnvSetter
24
+ def self.call(_body)
25
+ @env['REQUEST_METHOD']
26
+ end
27
+
28
+ def self.env=(env)
29
+ @env = env
30
+ end
31
+ end
32
+
33
+ module MockLogger
34
+ def self.warn(_msg)
35
+ 'you were warned!'
36
+ end
37
+ end
38
+
39
+ RSpec.configure do |config|
40
+ config.expect_with :rspec do |expectations|
41
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
42
+ end
43
+
44
+ config.mock_with :rspec do |mocks|
45
+ mocks.verify_partial_doubles = true
46
+ end
47
+
48
+ config.shared_context_metadata_behavior = :apply_to_host_groups
49
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-bodyparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Heesakkers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-13 00:00:00.000000000 Z
11
+ date: 2017-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: minitest
28
+ name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -52,8 +52,22 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: "\n Rack Middleware for parsing request body without touching request.params.\n
56
- \ Allowing full separation of query_string params and body payload.\n "
55
+ - !ruby/object:Gem::Dependency
56
+ name: benchmark-ips
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: "\n Rack Middleware for parsing request body without touching or\n
70
+ \ mixing in request.params.\n "
57
71
  email:
58
72
  - aaronheesakkers@gmail.com
59
73
  executables: []
@@ -61,11 +75,17 @@ extensions: []
61
75
  extra_rdoc_files: []
62
76
  files:
63
77
  - ".gitignore"
78
+ - ".rspec"
79
+ - ".rubocop.yml"
64
80
  - MIT-LICENSE
65
81
  - README.md
82
+ - benchmark/benchmark_helper.rb
83
+ - benchmark/rack_bodyparser_benchmark.rb
66
84
  - lib/rack/bodyparser.rb
67
85
  - lib/rack/bodyparser/version.rb
68
86
  - rack-bodyparser.gemspec
87
+ - spec/rack_bodyparser_spec.rb
88
+ - spec/spec_helper.rb
69
89
  homepage: https://www.github.com/aars/rack-bodyparser
70
90
  licenses:
71
91
  - MIT
@@ -90,4 +110,6 @@ rubygems_version: 2.6.10
90
110
  signing_key:
91
111
  specification_version: 4
92
112
  summary: Rack Middleware for parsing request body
93
- test_files: []
113
+ test_files:
114
+ - spec/rack_bodyparser_spec.rb
115
+ - spec/spec_helper.rb