Class: DevSystem::TextFileShell

Inherits:
FileShell show all
Defined in:
lib/dev_system/sub/shell/shells/text_file_shell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from FileShell

_raise_if_blank, _raise_if_not_exists, category_for, directory?, exist?, file?, gitkeep, size, symbolic_link?, touch

Methods inherited from Shell

all, 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_linesObject

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_linesObject (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

#pathObject (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_pathObject (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