grape-middleware-logger 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 447cca99bc2e0253d2fe3645706122cec1c0c7bf
4
- data.tar.gz: 83811830d95ab958323aa6cddabf0c77285f6a57
3
+ metadata.gz: c09e5c24a2fe69018c3193eae50e2ce2f9879600
4
+ data.tar.gz: 6e728c86c74a64debb9071909edcb7dc93e72273
5
5
  SHA512:
6
- metadata.gz: efb31508ea71c6901cf2e327c9a4448d577c0246dbed6e063655195f85533eb4aec0f72bb69a2d55c8b455a7a11c47040856eb1707445432c796a88e7ee14fbf
7
- data.tar.gz: 6075453808d8cf7ee6e7988292315083f2dc1bda0eb77810b1d3e371bcb8843aeb46200fbe4e44d0649f380046945263cd06acaea40f08c5c5464e44388630b7
6
+ metadata.gz: c9a08f38acf72a89882737bb91194a2b74c266d68c3b005bd24712aa42b0ade41c41cda9c88db027ca6653936a590e536b4f00bba7844d22fa61a1b5ac83836d
7
+ data.tar.gz: 2c0f0bb9dc3093a01adc33152de30235985541e6d59bfb32756b98286d922e204158500d4645546aebc279f463478e5244cc2b4dbef2b3e70f0e93c768a483b6
data/.travis.yml CHANGED
@@ -1,9 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
- - 2.1.5
5
- - 2.2.4
6
- - 2.3.0
3
+ - 2.1.10
4
+ - 2.2.5
5
+ - 2.3.1
7
6
  before_install:
8
7
  - gem install bundler -v 1.10.5
9
8
  - gem install mime-types -v 2.6.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,32 @@
1
+ 1.7.1 (11/1/2016)
2
+ ==================
3
+ * Log the error class name (https://github.com/ridiculous/grape-middleware-logger/pull/13)
4
+
5
+ 1.7.0 (8/2/2016)
6
+ ==================
7
+
8
+ * Bump Grape dependency to 0.17
9
+ * Encourage `insert_after` when mounting to properly include query and post data
10
+
11
+ ```ruby
12
+ insert_after Grape::Middleware::Formatter, Grape::Middleware::Logger
13
+ ```
14
+
15
+ 1.6.0 (4/4/2016)
16
+ ==================
17
+
18
+ * Can use default rake command to run test suite
19
+ * Fix [#4](https://github.com/ridiculous/grape-middleware-logger/issues/4), missing JSON parameters from POST requests
20
+ * Grape::Middleware::Formatter#before is Ruby 1.9.3 friendly
21
+
22
+ 1.5.1 (12/15/2015)
23
+ ==================
24
+
25
+ * Refactor logger conditional to use coercion and parallel assignment
26
+
27
+
28
+ 1.5.0 (12/12/2015)
29
+ ==================
30
+
31
+ * Use Railtie to setup default configuration for Rails apps
32
+ * Stop logging the namespace
@@ -0,0 +1,30 @@
1
+ # Grape::Middleware::logger Code of Conduct
2
+
3
+ The Grape::Middleware::logger project strongly values contributors from anywhere, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, ethnicity, age, religion, or nationality. As a result, the Grape::Middleware::logger team has agreed to and enforces this code of conduct in order to provide a harassment-free experience for everyone who participates in the development of Grape::Middleware::logger.
4
+
5
+ ### Summary
6
+
7
+ Harassment in code and discussion or violation of physical boundaries is completely unacceptable anywhere in the Grape::Middleware::logger project’s codebases, issue trackers, chat rooms, mailing lists, meetups, and any other events. Violators will be warned and then blocked or banned by the core team at or before the 3rd violation.
8
+
9
+ ### In detail
10
+
11
+ Harassment includes offensive verbal comments related to level of experience, gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, ethnicity, age, religion, nationality, the use of sexualized language or imagery, deliberate intimidation, stalking, sustained disruption, and unwelcome sexual attention.
12
+
13
+ Individuals asked to stop any harassing behavior are expected to comply immediately.
14
+
15
+ Maintainers, including the core team, are also subject to the anti-harassment policy.
16
+
17
+ If anyone engages in abusive, harassing, or otherwise unacceptable behavior, including maintainers, we may take appropriate action, up to and including warning the offender, deletion of comments, removal from the project’s codebase and communication systems, and escalation to Github support.
18
+
19
+ If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact a member of the core team immediately.
20
+
21
+ We expect everyone to follow these rules anywhere in the logger project’s codebases, issue trackers, IRC channel, group chat, and mailing lists.
22
+
23
+ This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
24
+
25
+ Finally, don't forget that it is human to make mistakes! We all do. Let’s work together to help each other, resolve issues, and learn from the mistakes that we will all inevitably make from time to time.
26
+
27
+
28
+ ### License
29
+
30
+ MIT
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # A logger for Grape apps
1
+ # A logger for [Grape](https://github.com/ruby-grape/grape) apps
2
2
  [![Code Climate](https://codeclimate.com/github/ridiculous/grape-middleware-logger/badges/gpa.svg)](https://codeclimate.com/github/ridiculous/grape-middleware-logger) [![Gem Version](https://badge.fury.io/rb/grape-middleware-logger.svg)](http://badge.fury.io/rb/grape-middleware-logger)
3
3
  [![Build Status](https://travis-ci.org/ridiculous/grape-middleware-logger.svg)](https://travis-ci.org/ridiculous/grape-middleware-logger)
4
4
 
@@ -23,7 +23,7 @@ gem 'grape-middleware-logger'
23
23
  ## Usage
24
24
  ```ruby
25
25
  class API < Grape::API
26
- # @note Make sure this is above you're first +mount+
26
+ # @note Make sure this is above your first +mount+
27
27
  insert_after Grape::Middleware::Formatter, Grape::Middleware::Logger
28
28
  end
29
29
  ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'grape-middleware-logger'
5
- spec.version = '1.7.0'
5
+ spec.version = '1.7.1'
6
6
  spec.platform = Gem::Platform::RUBY
7
7
  spec.authors = ['Ryan Buckley']
8
8
  spec.email = ['arebuckley@gmail.com']
@@ -16,6 +16,14 @@ Gem::Specification.new do |spec|
16
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
17
  spec.require_paths = ['lib']
18
18
 
19
+ spec.post_install_message = %q{
20
+
21
+ Grape::Middleware::Logger 1.7+ should be mounted with +insert_after+ to properly include POST params:
22
+
23
+ insert_after Grape::Middleware::Formatter, Grape::Middleware::Logger
24
+
25
+ }
26
+
19
27
  spec.add_dependency 'grape', '>= 0.17', '< 1'
20
28
 
21
29
  spec.add_development_dependency 'bundler', '~> 1.7'
@@ -71,7 +71,7 @@ class Grape::Middleware::Logger < Grape::Middleware::Globals
71
71
  #
72
72
 
73
73
  def after_exception(e)
74
- logger.info %Q( Error: #{e.message})
74
+ logger.info %Q( #{e.class.name}: #{e.message})
75
75
  after(500)
76
76
  end
77
77
 
@@ -21,6 +21,22 @@ describe Grape::Middleware::Logger, type: :integration do
21
21
  subject.call!(env)
22
22
  end
23
23
 
24
+ context 'when an exception occurs' do
25
+ it 'logs all parts of the request including the error class' do
26
+ expect(subject.logger).to receive(:info).with ''
27
+ expect(subject.logger).to receive(:info).with %Q(Started POST "/api/1.0/users" at #{subject.start_time})
28
+ expect(subject.logger).to receive(:info).with %Q(Processing by TestAPI/users)
29
+ expect(subject.logger).to receive(:info).with %Q( Parameters: {"id"=>"101001", "secret"=>"[FILTERED]", "customer"=>[], "name"=>"foo", "password"=>"[FILTERED]"})
30
+ expect(subject.logger).to receive(:info).with %Q( ArgumentError: Whoops)
31
+ expect(subject.logger).to receive(:info).with /Completed 500 in \d+\.\d+ms/
32
+ expect(subject.logger).to receive(:info).with ''
33
+ expect(subject.app).to receive(:call).and_raise(ArgumentError, 'Whoops')
34
+ expect {
35
+ subject.call!(env)
36
+ }.to raise_error(ArgumentError)
37
+ end
38
+ end
39
+
24
40
  describe 'the "processing by" section' do
25
41
  before { subject.call!(env) }
26
42
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-middleware-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Buckley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-02 00:00:00.000000000 Z
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape
@@ -101,6 +101,8 @@ extra_rdoc_files: []
101
101
  files:
102
102
  - ".gitignore"
103
103
  - ".travis.yml"
104
+ - CHANGELOG.md
105
+ - CODE_OF_CONDUCT.md
104
106
  - Gemfile
105
107
  - LICENSE.txt
106
108
  - README.md
@@ -119,7 +121,9 @@ homepage: https://github.com/ridiculous/grape-middleware-logger
119
121
  licenses:
120
122
  - MIT
121
123
  metadata: {}
122
- post_install_message:
124
+ post_install_message: "\n\nGrape::Middleware::Logger 1.7+ should be mounted with +insert_after+
125
+ to properly include POST params:\n\n insert_after Grape::Middleware::Formatter,
126
+ Grape::Middleware::Logger\n\n "
123
127
  rdoc_options: []
124
128
  require_paths:
125
129
  - lib
@@ -147,4 +151,3 @@ test_files:
147
151
  - spec/lib/grape/middleware/logger_spec.rb
148
152
  - spec/rails_helper.rb
149
153
  - spec/spec_helper.rb
150
- has_rdoc: