Class: Annoyme::ShellFileAppender

Inherits:
Object
  • Object
show all
Defined in:
lib/annoyme/shell_file_appender.rb

Constant Summary collapse

COMMAND_TO_APPEND =
'annoyme print'

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ ShellFileAppender

Returns a new instance of ShellFileAppender.



7
8
9
10
# File 'lib/annoyme/shell_file_appender.rb', line 7

def initialize(path)
  raise 'shellfile does not exist' unless File.exist?(path)
  @path = path
end

Instance Method Details

#append_commandObject



12
13
14
15
16
17
# File 'lib/annoyme/shell_file_appender.rb', line 12

def append_command
  if command_missing?
    append_annoyme_command
    Logger.yellow('modified', @path.split('/').last)
  end
end