rails3-footnotes 4.0.0.pre.8 → 4.0.0.pre.9
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.
- data/CHANGELOG +3 -0
- data/lib/rails-footnotes.rb +3 -3
- data/lib/rails-footnotes/notes/log_note.rb +8 -8
- data/lib/rails-footnotes/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
data/lib/rails-footnotes.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Footnotes
|
2
|
-
|
3
2
|
class Railtie < ::Rails::Railtie
|
3
|
+
|
4
4
|
config.before_configuration do
|
5
5
|
if ::Rails.env.development?
|
6
6
|
require 'rails-footnotes/footnotes'
|
@@ -25,9 +25,9 @@ module Footnotes
|
|
25
25
|
initializer "rails3-footnotes.hook_logger" do
|
26
26
|
if ::Rails.env.development?
|
27
27
|
raise ArgumentError, "The logs footnote requires a logger" unless Rails.logger
|
28
|
-
Rails.logger.extend
|
28
|
+
Rails.logger.extend LoggingExtensions
|
29
29
|
end
|
30
30
|
end
|
31
|
-
end
|
32
31
|
|
32
|
+
end
|
33
33
|
end
|
@@ -9,27 +9,27 @@ module Footnotes
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.log(message)
|
12
|
-
logs << message unless message =~ /SQL|SELECT/
|
12
|
+
logs << message# unless message =~ /SQL|SELECT/
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.clear_logs
|
16
|
-
|
16
|
+
# clear the logs for the next request
|
17
|
+
old_logs, @@logs = @@logs, []
|
18
|
+
return old_logs
|
17
19
|
end
|
18
20
|
|
19
21
|
def initialize(controller)
|
20
22
|
@controller = controller
|
21
23
|
end
|
22
24
|
|
23
|
-
def start!
|
24
|
-
self.class.clear_logs
|
25
|
-
end
|
26
|
-
|
27
25
|
def title
|
28
|
-
"Log (#{
|
26
|
+
"Log (#{@num})"
|
29
27
|
end
|
30
28
|
|
31
29
|
def content
|
32
|
-
self.class.logs.
|
30
|
+
@num = self.class.logs.size
|
31
|
+
|
32
|
+
self.class.clear_logs.map do |l|
|
33
33
|
escape(l.gsub(/\e\[.+?m/, ''))
|
34
34
|
end.join('<br />')
|
35
35
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails3-footnotes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1923831867
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 4
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- pre
|
11
|
-
-
|
12
|
-
version: 4.0.0.pre.
|
11
|
+
- 9
|
12
|
+
version: 4.0.0.pre.9
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- "Andr\xC3\xA9 Arko"
|