Class: CommandLine::Command
- Inherits:
-
Object
- Object
- CommandLine::Command
- Defined in:
- lib/git/contest/command_line/command.rb
Direct Known Subclasses
MainCommand, SubCommands::ConfigCommand, SubCommands::FinishCommand, SubCommands::InitCommand, SubCommands::ListCommand, SubCommands::RebaseCommand, SubCommands::StartCommand, SubCommands::SubmitCommand
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#input_stream ⇒ Object
readonly
Returns the value of attribute input_stream.
-
#opt_parser ⇒ Object
readonly
Returns the value of attribute opt_parser.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#terminal ⇒ Object
readonly
Returns the value of attribute terminal.
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Instance Method Summary collapse
- #define_options ⇒ Object
- #init ⇒ Object
-
#initialize(new_args, new_input_stream = STDIN) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
- #set_default_options ⇒ Object
Constructor Details
#initialize(new_args, new_input_stream = STDIN) ⇒ Command
Returns a new instance of Command.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/git/contest/command_line/command.rb', line 30 def initialize(new_args, new_input_stream = STDIN) @input_stream = new_input_stream @terminal = ::HighLine.new(new_input_stream) init_global # TODO: remove init_home # TODO:remove @args = new_args.clone @options = {} @tokens = [] # init after parse options @opt_parser = OptionParser.new do |opt| opt.version = Git::Contest::VERSION end end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
25 26 27 |
# File 'lib/git/contest/command_line/command.rb', line 25 def args @args end |
#input_stream ⇒ Object (readonly)
Returns the value of attribute input_stream.
23 24 25 |
# File 'lib/git/contest/command_line/command.rb', line 23 def input_stream @input_stream end |
#opt_parser ⇒ Object (readonly)
Returns the value of attribute opt_parser.
28 29 30 |
# File 'lib/git/contest/command_line/command.rb', line 28 def opt_parser @opt_parser end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
27 28 29 |
# File 'lib/git/contest/command_line/command.rb', line 27 def @options end |
#terminal ⇒ Object (readonly)
Returns the value of attribute terminal.
24 25 26 |
# File 'lib/git/contest/command_line/command.rb', line 24 def terminal @terminal end |
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
26 27 28 |
# File 'lib/git/contest/command_line/command.rb', line 26 def tokens @tokens end |
Instance Method Details
#define_options ⇒ Object
43 44 45 |
# File 'lib/git/contest/command_line/command.rb', line 43 def raise "not implement" end |
#init ⇒ Object
51 52 53 54 55 56 |
# File 'lib/git/contest/command_line/command.rb', line 51 def init @tokens = args end |
#run ⇒ Object
58 59 60 |
# File 'lib/git/contest/command_line/command.rb', line 58 def run raise "not implement" end |
#set_default_options ⇒ Object
47 48 49 |
# File 'lib/git/contest/command_line/command.rb', line 47 def raise "not implement" end |