Class: Statistrano::Deployment::LogFile
- Inherits:
-
Object
- Object
- Statistrano::Deployment::LogFile
- Defined in:
- lib/statistrano/deployment/log_file.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#remote ⇒ Object
readonly
Returns the value of attribute remote.
-
#resolved_path ⇒ Object
readonly
Returns the value of attribute resolved_path.
Instance Method Summary collapse
- #append!(log_entry) ⇒ Object
-
#initialize(path, remote) ⇒ LogFile
constructor
A new instance of LogFile.
- #last_entry ⇒ Object
- #tail(length = 10) ⇒ Object
Constructor Details
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/statistrano/deployment/log_file.rb', line 5 def file @file end |
#remote ⇒ Object (readonly)
Returns the value of attribute remote.
5 6 7 |
# File 'lib/statistrano/deployment/log_file.rb', line 5 def remote @remote end |
#resolved_path ⇒ Object (readonly)
Returns the value of attribute resolved_path.
5 6 7 |
# File 'lib/statistrano/deployment/log_file.rb', line 5 def resolved_path @resolved_path end |
Instance Method Details
#append!(log_entry) ⇒ Object
13 14 15 |
# File 'lib/statistrano/deployment/log_file.rb', line 13 def append! log_entry file.append_content! log_entry.to_json end |
#last_entry ⇒ Object
17 18 19 |
# File 'lib/statistrano/deployment/log_file.rb', line 17 def last_entry entries(1).last || {} end |
#tail(length = 10) ⇒ Object
21 22 23 |
# File 'lib/statistrano/deployment/log_file.rb', line 21 def tail length=10 entries(length) end |