Module: Excom::Plugins::Executable::ClassMethods

Defined in:
lib/excom/plugins/executable.rb

Instance Method Summary collapse

Instance Method Details

#[](*args) ⇒ Object



103
104
105
# File 'lib/excom/plugins/executable.rb', line 103

def [](*args)
  call(*args).result
end

#alias_success(*aliases) ⇒ Object



117
118
119
# File 'lib/excom/plugins/executable.rb', line 117

def alias_success(*aliases)
  singleton_class.send(:define_method, :success_aliases) { super() + aliases }
end

#call(*args) ⇒ Object



99
100
101
# File 'lib/excom/plugins/executable.rb', line 99

def call(*args)
  new(*args).execute
end

#fail_with(status = nil) ⇒ Object



107
108
109
110
111
# File 'lib/excom/plugins/executable.rb', line 107

def fail_with(status = nil)
  return @fail_with || :failure if status.nil?

  @fail_with = status
end

#method_added(name) ⇒ Object



121
122
123
124
# File 'lib/excom/plugins/executable.rb', line 121

def method_added(name)
  private :run if name == :run
  super if defined? super
end

#success_aliasesObject



113
114
115
# File 'lib/excom/plugins/executable.rb', line 113

def success_aliases
  []
end