Class: DevSystem::TextFileShell
- Inherits:
-
FileShell
- Object
- Liza::Unit
- Liza::Controller
- Shell
- FileShell
- DevSystem::TextFileShell
- Defined in:
- lib/dev_system/sub/shell/shells/text_file_shell.rb
Instance Attribute Summary collapse
-
#new_lines ⇒ Object
Returns the value of attribute new_lines.
-
#old_lines ⇒ Object
readonly
Returns the value of attribute old_lines.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#relative_path ⇒ Object
readonly
Returns the value of attribute relative_path.
Instance Method Summary collapse
-
#initialize(path) ⇒ TextFileShell
constructor
A new instance of TextFileShell.
Methods inherited from FileShell
_raise_if_blank, _raise_if_not_exists, directory?, exist?, file?, gitkeep, size, touch
Methods inherited from Shell
cruby?, engine, jruby?, linux?, mac?, os, ruby_version, unix?, windows?
Methods inherited from Liza::Controller
color, inherited, on_connected
Methods inherited from Liza::Unit
const_missing, division, part, system, #system, test_class
Constructor Details
#initialize(path) ⇒ TextFileShell
Returns a new instance of TextFileShell.
8 9 10 11 12 |
# File 'lib/dev_system/sub/shell/shells/text_file_shell.rb', line 8 def initialize(path) @path = Pathname(path) @relative_path = Pathname(path).relative_path_from(App.root) @old_lines = TextShell.read_lines path end |
Instance Attribute Details
#new_lines ⇒ Object
Returns the value of attribute new_lines.
6 7 8 |
# File 'lib/dev_system/sub/shell/shells/text_file_shell.rb', line 6 def new_lines @new_lines end |
#old_lines ⇒ Object (readonly)
Returns the value of attribute old_lines.
5 6 7 |
# File 'lib/dev_system/sub/shell/shells/text_file_shell.rb', line 5 def old_lines @old_lines end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/dev_system/sub/shell/shells/text_file_shell.rb', line 5 def path @path end |
#relative_path ⇒ Object (readonly)
Returns the value of attribute relative_path.
5 6 7 |
# File 'lib/dev_system/sub/shell/shells/text_file_shell.rb', line 5 def relative_path @relative_path end |