rails-flog 1.1.0 → 1.1.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: 57c68ce2bbb1cb74f3bde72f9f9226ecb4ddd8d3
4
- data.tar.gz: 8981369d077b93a3d63a4fff554e01f7b8869487
3
+ metadata.gz: 5d92f9e5659c4ddc5b1cff2a221c211024678286
4
+ data.tar.gz: 3f436f911028bb5e1ec6edf651f77c4d4edc6b94
5
5
  SHA512:
6
- metadata.gz: 026b7737f8ec98e1f1e3749dd00e00eb728728473ba771f836d8cdc2dbb978442ddc2ac691df88be0ec7d5d0749eefe069784b6a85f9761d2777ba5edcce869a
7
- data.tar.gz: 081eda06508831663a0874bb5b2be931428e55bb95afec2781ee0be8c41e97d10978851ed9016cc2c4d26a60d6e8076a03ad396ed7c97e830ac82dd6c8d50533
6
+ metadata.gz: dc59c520f5e43959612424651280796903b23f48277e68c7373272d5602c4fcd846efe499b0cc01a7cb92df1313017d1db7b19ec6184e68132bb6bb9fb03e46c
7
+ data.tar.gz: c4701cef3be35296f50ab97cfd01d782b886b8e7291f667e153fc7a7184f4457ac813695ca9bc73d92d433a250445d49a828aeb6c1217dfebf8173ef1bdbf6e6
data/README.md CHANGED
@@ -70,7 +70,7 @@ Processing by IssuesController#create as HTML
70
70
 
71
71
  ## Installation
72
72
 
73
- Add this line to your application's Gemfile:
73
+ Add this line to your application's Gemfile:
74
74
  (Recommendation: use only `:development` and `:test` enviroment)
75
75
 
76
76
  gem 'rails-flog', :require => "flog"
@@ -108,3 +108,4 @@ If you put a file named `no-flog.txt` to `<rails_app>/tmp` direcotry, `rails-flo
108
108
 
109
109
  - v1.0.0 (2013-11-28 JST): First release
110
110
  - v1.1.0 (2013-12-02 JST): Add feature that disables format by no-flog.txt
111
+ - v1.1.1 (2013-12-06 JST): Change to alias_method_change from alias for method aliasing
@@ -7,17 +7,16 @@ require "flog/status"
7
7
  class ActionController::LogSubscriber
8
8
  include Flog::PayloadValueShuntable
9
9
 
10
- alias :original_start_processing :start_processing
11
-
12
- def start_processing(event)
13
- return original_start_processing(event) unless Flog::Status.enabled?
10
+ def start_processing_with_flog(event)
11
+ return start_processing_without_flog(event) unless Flog::Status.enabled?
14
12
 
15
13
  replaced = replace_params(event.payload[:params])
16
14
 
17
15
  shunt_payload_value(event.payload, :params, replaced) do
18
- original_start_processing(event)
16
+ start_processing_without_flog(event)
19
17
  end
20
18
  end
19
+ alias_method_chain :start_processing, :flog
21
20
 
22
21
  private
23
22
  def replace_params(params)
@@ -5,17 +5,16 @@ require "flog/payload_value_shuntable"
5
5
  class ActiveRecord::LogSubscriber
6
6
  include Flog::PayloadValueShuntable
7
7
 
8
- alias :original_sql :sql
9
-
10
- def sql(event)
11
- return original_sql(event) unless Flog::Status.enabled?
8
+ def sql_with_flog(event)
9
+ return sql_without_flog(event) unless Flog::Status.enabled?
12
10
 
13
11
  formatted = format_sql(event.payload[:sql])
14
12
 
15
13
  shunt_payload_value(event.payload, :sql, "\n\t#{formatted}") do
16
- original_sql(event)
14
+ sql_without_flog(event)
17
15
  end
18
16
  end
17
+ alias_method_chain :sql, :flog
19
18
 
20
19
  private
21
20
  def format_sql(sql)
data/lib/flog/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # coding: utf-8
2
2
  module Flog
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-flog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - pinzolo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-05 00:00:00.000000000 Z
11
+ date: 2013-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler