mirror of
https://github.com/samsonjs/grape_logging.git
synced 2026-03-25 08:55:47 +00:00
Add support for Grape 2.4 (#93)
* Fix RequestLogger middleware to handle Grape 2.4 breaking chnage * Make RequestLogger#initialize signature match Grape 2.4 * Update changelog * Require grape >= 2.4 in gemspec --------- Co-authored-by: Cedric Darricau <cedricdarricau@gmail.com>
This commit is contained in:
parent
5a9ef5d801
commit
ed25898685
4 changed files with 5 additions and 5 deletions
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
## [2.1.2] - Unreleased
|
||||
|
||||
### Changed or Fixed or Added
|
||||
- Your contribution here.
|
||||
### Changed
|
||||
- [#93](https://github.com/aserafin/grape_logging/pull/93) RequestLogger middleware to handle Grape 2.4 breaking change - [@devsigner](https://github.com/devsigner) and [@samsonjs](https://github.com/samsonjs).
|
||||
|
||||
[2.1.2]: https://github.com/aserafin/grape_logging/compare/v2.1.1...master
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|||
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
||||
spec.require_paths = ['lib']
|
||||
|
||||
spec.add_dependency 'grape', '< 2.4.0'
|
||||
spec.add_dependency 'grape', '>= 2.4.0'
|
||||
spec.add_dependency 'rack'
|
||||
|
||||
spec.add_development_dependency 'rake', '~> 13.3'
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ module GrapeLogging
|
|||
# to use int in parameters
|
||||
attr_accessor :response_status, :response_body
|
||||
|
||||
def initialize(app, options = {})
|
||||
def initialize(app, **options)
|
||||
super
|
||||
|
||||
@included_loggers = @options[:include] || []
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ describe GrapeLogging::Middleware::RequestLogger do
|
|||
let(:env) { { 'action_dispatch.request_id' => 'request-abc123' } }
|
||||
let(:subject) { request.send(request_method, path, env) }
|
||||
let(:app) { proc { [status, {}, ['response body']] } }
|
||||
let(:stack) { described_class.new app, options }
|
||||
let(:stack) { described_class.new app, **options }
|
||||
let(:request) { Rack::MockRequest.new(stack) }
|
||||
let(:options) { { include: [], logger: logger } }
|
||||
let(:logger) { double('logger') }
|
||||
|
|
|
|||
Loading…
Reference in a new issue