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

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

Instance Method Summary collapse

Instance Method Details

#[](*args) ⇒ Object



92
93
94
# File 'lib/excom/plugins/executable.rb', line 92

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

#alias_success(*aliases) ⇒ Object



106
107
108
# File 'lib/excom/plugins/executable.rb', line 106

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

#call(*args) ⇒ Object



88
89
90
# File 'lib/excom/plugins/executable.rb', line 88

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

#fail_with(status = nil) ⇒ Object



96
97
98
99
100
# File 'lib/excom/plugins/executable.rb', line 96

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

  @fail_with = status
end

#method_added(name) ⇒ Object



110
111
112
113
# File 'lib/excom/plugins/executable.rb', line 110

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

#success_aliasesObject



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

def success_aliases
  []
end