Class: Pair::CommandLine
- Inherits:
-
Object
- Object
- Pair::CommandLine
- Defined in:
- lib/pair/command_line.rb,
lib/pair/command_line/host.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Host
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(arguments) ⇒ CommandLine
constructor
A new instance of CommandLine.
- #run! ⇒ Object
Constructor Details
#initialize(arguments) ⇒ CommandLine
Returns a new instance of CommandLine.
13 14 15 16 |
# File 'lib/pair/command_line.rb', line 13 def initialize(arguments) self.arguments = arguments self. = {} end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
6 7 8 |
# File 'lib/pair/command_line.rb', line 6 def arguments @arguments end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/pair/command_line.rb', line 6 def @options end |
Class Method Details
.run!(*arguments) ⇒ Object
9 10 11 |
# File 'lib/pair/command_line.rb', line 9 def self.run!(*arguments) new(*arguments).run! end |
Instance Method Details
#run! ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/pair/command_line.rb', line 18 def run! case command = arguments.shift when 'host' require "pair/command_line/host" Host.run!(arguments) else unknown_command(command) end rescue SystemExit raise rescue if $-d STDOUT.puts "\n" STDOUT.puts " Please contact [email protected], there" STDOUT.puts " was an issue creating your session." STDOUT.puts "\n" else raise end end |