controller_filter_logging 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,12 @@
|
|
1
1
|
module AbstractController::Callbacks::ClassMethods
|
2
|
-
def before_filter_with_logging(filter_name, *args)
|
3
|
-
|
4
|
-
|
2
|
+
def before_filter_with_logging(filter_name, *args, &block)
|
3
|
+
if block_given?
|
4
|
+
Rails.logger.debug("Can't log filters with blocks: #{caller[0..3].join("\n")}")
|
5
|
+
before_filter_without_logging filter_name, *args, &block
|
6
|
+
else
|
7
|
+
create_logging_filter(filter_name)
|
8
|
+
before_filter_without_logging "#{filter_name}_with_logging".to_sym, *args
|
9
|
+
end
|
5
10
|
end
|
6
11
|
alias_method_chain :before_filter, :logging
|
7
12
|
|
@@ -10,9 +15,14 @@ module AbstractController::Callbacks::ClassMethods
|
|
10
15
|
end
|
11
16
|
alias_method_chain :skip_before_filter, :logging
|
12
17
|
|
13
|
-
def prepend_before_filter_with_logging(filter_name, *args)
|
14
|
-
|
15
|
-
|
18
|
+
def prepend_before_filter_with_logging(filter_name, *args, &block)
|
19
|
+
if block_given?
|
20
|
+
Rails.logger.debug("Can't log filters with blocks: #{caller[0..3].join("\n")}")
|
21
|
+
prepend_before_filter_without_logging filter_name, *args, &block
|
22
|
+
else
|
23
|
+
create_logging_filter(filter_name)
|
24
|
+
prepend_before_filter_without_logging("#{filter_name}_with_logging".to_sym, *args)
|
25
|
+
end
|
16
26
|
end
|
17
27
|
alias_method_chain :prepend_before_filter, :logging
|
18
28
|
|
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: controller_filter_logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- Jon Moses
|
@@ -10,7 +15,7 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-24 00:00:00 -04:00
|
14
19
|
default_executable:
|
15
20
|
dependencies: []
|
16
21
|
|
@@ -46,17 +51,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
46
51
|
requirements:
|
47
52
|
- - ">="
|
48
53
|
- !ruby/object:Gem::Version
|
54
|
+
hash: 3
|
55
|
+
segments:
|
56
|
+
- 0
|
49
57
|
version: "0"
|
50
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
59
|
none: false
|
52
60
|
requirements:
|
53
61
|
- - ">="
|
54
62
|
- !ruby/object:Gem::Version
|
63
|
+
hash: 3
|
64
|
+
segments:
|
65
|
+
- 0
|
55
66
|
version: "0"
|
56
67
|
requirements: []
|
57
68
|
|
58
69
|
rubyforge_project: controller_filter_logging
|
59
|
-
rubygems_version: 1.
|
70
|
+
rubygems_version: 1.3.7
|
60
71
|
signing_key:
|
61
72
|
specification_version: 3
|
62
73
|
summary: Bring back controller filter logging to rails 3
|