rack-action_logger 0.2.0 → 0.3.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: decd5af4f47d90252f92d6442c7642b486681d47
4
- data.tar.gz: 55096e953ae0a64a26c3e364d64a6579f3c33084
3
+ metadata.gz: c699cc16212b714dbb03fbdc789f8a6f2820ccfc
4
+ data.tar.gz: 9502d93c2f958b57cd5507c6e51541b51edb3e26
5
5
  SHA512:
6
- metadata.gz: 2e8fff404973516a228d9df8fa9f8b649bde879a200f12d71a6d43249fd77958165167038d87deca3d38c828db353dcf7b8e41f67675eb2fa8862b8e4c1a7509
7
- data.tar.gz: cdfcdf11d86bf527f3b66f8e4df80f1b1d6966581e6d599729c7674bcc4dc81b9af29bdefe69051a4a208bd1fbdcd8fe857eebd279f3977c7ae27e1016a9d4f6
6
+ metadata.gz: 2d6f3b08d1a49fe068e42034a57acd239abdf3730b62a6a672ce2bc1d1af5e3cc68cf8b38179183ccc3cd07ec9e0ac496ecbf8bcce6b161a6b4909127387680c
7
+ data.tar.gz: 26e7cfddc5335a447500f510380d4c805492f7a6f198cc9aeaa36450adda7a186b75d46ed17f0be74af67228b8bdc38c00ad303fc684712d366ac481b794e7de
data/.codeclimate.yml ADDED
@@ -0,0 +1,9 @@
1
+ ratings:
2
+ paths:
3
+ - lib/**
4
+ exclude_paths:
5
+ - spec/**/*
6
+ - docs/**/*
7
+ - example/**/*
8
+ - spec/**/*
9
+ - "**/vendor/**/*"
data/.gitignore CHANGED
@@ -51,3 +51,6 @@ build-iPhoneSimulator/
51
51
 
52
52
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
53
53
  .rvmrc
54
+
55
+ .generators
56
+
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.4.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-action_logger (0.2.0)
4
+ rack-action_logger (0.3.0)
5
5
  activesupport
6
6
  fluent-logger (~> 0.5)
7
7
  woothee (~> 1.4)
@@ -14,6 +14,8 @@ GEM
14
14
  i18n (~> 0.7)
15
15
  minitest (~> 5.1)
16
16
  tzinfo (~> 1.1)
17
+ codeclimate-test-reporter (1.0.3)
18
+ simplecov
17
19
  concurrent-ruby (1.0.2)
18
20
  diff-lcs (1.2.5)
19
21
  docile (1.1.5)
@@ -55,6 +57,7 @@ PLATFORMS
55
57
 
56
58
  DEPENDENCIES
57
59
  bundler (~> 1.13)
60
+ codeclimate-test-reporter
58
61
  rack-action_logger!
59
62
  rack-test (~> 0.6.3)
60
63
  rake (~> 10.0)
@@ -62,4 +65,4 @@ DEPENDENCIES
62
65
  simplecov
63
66
 
64
67
  BUNDLED WITH
65
- 1.13.6
68
+ 1.15.1
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![CircleCI](https://circleci.com/gh/wapa5pow/rack-action_logger.svg?style=shield)](https://circleci.com/gh/wapa5pow/rack-action_logger)
4
4
  [![Gem Version](https://badge.fury.io/rb/rack-action_logger.svg)](https://badge.fury.io/rb/rack-action_logger)
5
5
  [![Code Climate](https://codeclimate.com/github/wapa5pow/rack-action_logger/badges/gpa.svg)](https://codeclimate.com/github/wapa5pow/rack-action_logger)
6
+ [![Test Coverage](https://codeclimate.com/github/wapa5pow/rack-action_logger/badges/coverage.svg)](https://codeclimate.com/github/wapa5pow/rack-action_logger/coverage)
6
7
 
7
8
  **Rack::ActionLogger** is a tool to collect user action logs via fluentd, Rails.logger or any custome logger.
8
9
 
@@ -34,6 +35,7 @@ It is intended to collect user request log, action log and any other custome log
34
35
  "HTTP_COOKIE": "xxx"
35
36
  },
36
37
  "status_code": 200,
38
+ "ip": "127.0.0.1",
37
39
  "remote_ip": "127.0.0.1",
38
40
  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36",
39
41
  "device": "pc",
@@ -152,7 +154,7 @@ Rack::ActionLogger::Container.add_append_log({ value: 'ok' }, 'activities')
152
154
  Add the folloing line to ```config/initializers/rack-action_logger.rb``` at the end of line.
153
155
 
154
156
  ```
155
- ActiveRecord::Base.send(:include, Rack::ActionLog::ActiveRecordExtension)
157
+ ActiveRecord::Base.send(:include, Rack::ActionLogger::ActiveRecordExtension)
156
158
  ```
157
159
 
158
160
  ### Override log attributes
data/circle.yml ADDED
@@ -0,0 +1,5 @@
1
+ deployment:
2
+ codeclimate:
3
+ branch: master
4
+ commands:
5
+ - bundle exec codeclimate-test-reporter
@@ -5,7 +5,7 @@ require 'woothee'
5
5
  module Rack::ActionLogger::Metrics
6
6
  class RackMetrics
7
7
  METRICS = [
8
- :path, :method, :params, :request_headers, :status_code, :remote_ip, :user_agent, :device, :os, :browser,
8
+ :path, :method, :params, :request_headers, :status_code, :ip, :remote_ip, :user_agent, :device, :os, :browser,
9
9
  :browser_version, :request_id, :response_headers, :response_json_body,
10
10
  ]
11
11
  RACK_TAG_PREFIX = 'rack'
@@ -71,6 +71,10 @@ module Rack::ActionLogger::Metrics
71
71
  end
72
72
 
73
73
  def remote_ip
74
+ @env['action_dispatch.remote_ip']
75
+ end
76
+
77
+ def ip
74
78
  @request.ip
75
79
  end
76
80
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module ActionLogger
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
@@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency 'rspec', '~> 3.0'
34
34
  spec.add_development_dependency 'rack-test', '~> 0.6.3'
35
35
  spec.add_development_dependency 'simplecov'
36
+ spec.add_development_dependency 'codeclimate-test-reporter'
36
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-action_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Ishida
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-24 00:00:00.000000000 Z
11
+ date: 2017-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: codeclimate-test-reporter
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: Rack::ActionLogger is a tool to log user activity
126
140
  email:
127
141
  - wapa5pow@gmail.com
@@ -129,9 +143,10 @@ executables: []
129
143
  extensions: []
130
144
  extra_rdoc_files: []
131
145
  files:
146
+ - ".codeclimate.yml"
132
147
  - ".gitignore"
133
148
  - ".rspec"
134
- - ".simplecov"
149
+ - ".ruby-version"
135
150
  - ".travis.yml"
136
151
  - CODE_OF_CONDUCT.md
137
152
  - Gemfile
@@ -142,6 +157,7 @@ files:
142
157
  - bin/console
143
158
  - bin/rspec
144
159
  - bin/setup
160
+ - circle.yml
145
161
  - lib/rack/action_logger.rb
146
162
  - lib/rack/action_logger/active_record_extension.rb
147
163
  - lib/rack/action_logger/configuration.rb
@@ -179,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
195
  version: 1.3.5
180
196
  requirements: []
181
197
  rubyforge_project:
182
- rubygems_version: 2.6.7
198
+ rubygems_version: 2.6.11
183
199
  signing_key:
184
200
  specification_version: 4
185
201
  summary: Rack::ActionLogger is a tool to log user activity
data/.simplecov DELETED
@@ -1,3 +0,0 @@
1
- SimpleCov.start do
2
- add_group 'lib', 'lib'
3
- end