aioli_log_formatter 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ require 'aioli_log_formatter/controller/extension'
6
6
 
7
7
  module AioliLogFormatter
8
8
 
9
- def self.setup(app)
9
+ def self.setup
10
10
  ActionController::Base.send(:include, AioliLogFormatter::Controller::Extension)
11
11
  end
12
12
 
@@ -17,6 +17,8 @@ module AioliLogFormatter
17
17
  USER_ID_PROC = lambda { |controller| controller.session[:user_id] }
18
18
 
19
19
  def aioli_log_formatter(options = {})
20
+ return unless Rails.application.config.aioli_log_formatter.enabled
21
+
20
22
  if session_id = options.fetch(:session_id, SESSION_ID_PROC)
21
23
  before_filter { |controller| ($session_id ||= {})[Thread.current] = session_id.call(controller) || 0 }
22
24
  end
@@ -5,7 +5,7 @@ module AioliLogFormatter
5
5
  config.aioli_log_formatter.formatter = Formatter.new
6
6
 
7
7
  initializer :aioli_log_formatter do |app|
8
- AioliLogFormatter.setup(app) if app.config.aioli_log_formatter.enabled
8
+ AioliLogFormatter.setup
9
9
  end
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module AioliLogFormatter
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: aioli_log_formatter
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.1.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Thomas Baustert
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-14 00:00:00.000000000 Z
12
+ date: 2014-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3
@@ -119,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  segments:
121
121
  - 0
122
- hash: 3110665859264606959
122
+ hash: 428284119644341654
123
123
  version: '0'
124
124
  none: false
125
125
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  - !ruby/object:Gem::Version
129
129
  segments:
130
130
  - 0
131
- hash: 3110665859264606959
131
+ hash: 428284119644341654
132
132
  version: '0'
133
133
  none: false
134
134
  requirements: []