Module: BoPeep::Command::BehaviorWithoutRegistration

Included in:
BoPeep::Command
Defined in:
lib/bopeep.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argvObject (readonly)

Returns the value of attribute argv.



2007
2008
2009
# File 'lib/bopeep.rb', line 2007

def argv
  @argv
end

#contextObject (readonly)

Returns the value of attribute context.



2008
2009
2010
# File 'lib/bopeep.rb', line 2008

def context
  @context
end

#hostsObject (readonly)

Returns the value of attribute hosts.



2009
2010
2011
# File 'lib/bopeep.rb', line 2009

def hosts
  @hosts
end

#parserObject (readonly)

Returns the value of attribute parser.



2010
2011
2012
# File 'lib/bopeep.rb', line 2010

def parser
  @parser
end

#playlistObject (readonly)

Returns the value of attribute playlist.



2011
2012
2013
# File 'lib/bopeep.rb', line 2011

def playlist
  @playlist
end

Class Method Details

.included(klass) ⇒ Object



1991
1992
1993
# File 'lib/bopeep.rb', line 1991

def self.included(klass)
  klass.extend(ClassMethods)
end

Instance Method Details

#callObject



2028
2029
2030
2031
# File 'lib/bopeep.rb', line 2028

def call
  run
  self
end

#chain(*others) ⇒ Object



2044
2045
2046
2047
2048
# File 'lib/bopeep.rb', line 2044

def chain(*others)
  others.inject(self) do |execution, command|
    execution | command
  end
end

#command_nameObject



2036
2037
2038
# File 'lib/bopeep.rb', line 2036

def command_name
  self.class.command_name
end

#initialize(context) ⇒ Object



2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
# File 'lib/bopeep.rb', line 2013

def initialize(context)
  @context = context

  @parser = @context.parser
  @hosts = @context.hosts
  @argv = @context.argv.dup
  @playlist = @context.playlist

  configure_parser!
end

#nameObject



2024
2025
2026
# File 'lib/bopeep.rb', line 2024

def name
  command_name.cli
end

#on_failure(command_outcome) ⇒ Object



2059
2060
# File 'lib/bopeep.rb', line 2059

def on_failure(command_outcome)
end

#on_stderr(data) ⇒ Object



2053
2054
# File 'lib/bopeep.rb', line 2053

def on_stderr(data)
end

#on_stdout(data) ⇒ Object



2050
2051
# File 'lib/bopeep.rb', line 2050

def on_stdout(data)
end

#on_success(command_outcome) ⇒ Object



2056
2057
# File 'lib/bopeep.rb', line 2056

def on_success(command_outcome)
end

#runObject



2033
2034
# File 'lib/bopeep.rb', line 2033

def run
end

#SGR(text) ⇒ Object



2062
2063
2064
# File 'lib/bopeep.rb', line 2062

def SGR(text)
  Console::SGR(text)
end

#|(other) ⇒ Object



2040
2041
2042
# File 'lib/bopeep.rb', line 2040

def |(other)
  other.(context)
end