rails3-footnotes 4.0.0.pre.8 → 4.0.0.pre.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ == Footnotes v4.0.0.pre.9 (April 6, 2011)
2
+ * stop the log note collecting logs forever
3
+
1
4
  == Footnotes v4.0.0.pre.8 (April 5, 2011)
2
5
  * fix log note to only activate in development
3
6
 
@@ -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 Footnotes::LoggingExtensions
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
- @@logs = []
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 (#{self.class.logs.size})"
26
+ "Log (#{@num})"
29
27
  end
30
28
 
31
29
  def content
32
- self.class.logs.map do |l|
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
@@ -1,3 +1,3 @@
1
1
  module Footnotes
2
- VERSION = "4.0.0.pre.8"
2
+ VERSION = "4.0.0.pre.9"
3
3
  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: 1923831865
4
+ hash: 1923831867
5
5
  prerelease: true
6
6
  segments:
7
7
  - 4
8
8
  - 0
9
9
  - 0
10
10
  - pre
11
- - 8
12
- version: 4.0.0.pre.8
11
+ - 9
12
+ version: 4.0.0.pre.9
13
13
  platform: ruby
14
14
  authors:
15
15
  - "Andr\xC3\xA9 Arko"