Class: Footnotes::Notes::LogNote
Defined Under Namespace
Modules: LoggingExtensions
Constant Summary
collapse
- @@log =
[]
Class Method Summary
collapse
Instance Method Summary
collapse
add
close!, #escape, #has_fieldset?, #hash_to_xml_attributes, included?, #javascript, #legend, #link, #mount_table, #mount_table_for_hash, #onclick, #prefix?, #row, start!, #stylesheet, title, #to_sym, to_sym, #valid?
Constructor Details
#initialize(controller) ⇒ LogNote
Returns a new instance of LogNote.
10
11
12
|
# File 'lib/rails-footnotes/notes/log_note.rb', line 10
def initialize(controller)
@controller = controller
end
|
Class Method Details
.log(message) ⇒ Object
6
7
8
|
# File 'lib/rails-footnotes/notes/log_note.rb', line 6
def self.log(message)
@@log << message
end
|
Instance Method Details
#content ⇒ Object
18
19
20
|
# File 'lib/rails-footnotes/notes/log_note.rb', line 18
def content
escape(log.gsub(/\e\[.+?m/, '')).gsub("\n", '<br />')
end
|
#log ⇒ Object
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/rails-footnotes/notes/log_note.rb', line 22
def log
unless @log
@log = @@log.join('')
@@log = []
if rindex = @log.rindex('Processing '+@controller.class.name+'#'+@controller.action_name)
@log = @log[rindex..-1]
end
end
@log
end
|
#title ⇒ Object
14
15
16
|
# File 'lib/rails-footnotes/notes/log_note.rb', line 14
def title
"Log (#{log.count("\n")})"
end
|