Exception: Freshen::ExecutableError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/freshen/errors.rb

Overview

A RuntimeError subclass for when an executing command fails.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, command, *args) ⇒ ExecutableError

Returns a new instance of ExecutableError.



73
74
75
76
77
# File 'lib/freshen/errors.rb', line 73

def initialize(name, command, *args)
  @name = name
  @command = command
  @args = args.map { |a| a.to_s }
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



71
72
73
# File 'lib/freshen/errors.rb', line 71

def args
  @args
end

#commandObject (readonly)

Returns the value of attribute command.



71
72
73
# File 'lib/freshen/errors.rb', line 71

def command
  @command
end

#nameObject (readonly)

Returns the value of attribute name.



71
72
73
# File 'lib/freshen/errors.rb', line 71

def name
  @name
end

Instance Method Details

#to_sObject



79
80
81
82
83
# File 'lib/freshen/errors.rb', line 79

def to_s
  command = Executable.command_string(@command, *@args)
  
  "#{@name} freshener failed command '#{command}'"
end