Class: CartBinaryUploader::CartupCommandHelper
- Inherits:
-
Object
- Object
- CartBinaryUploader::CartupCommandHelper
- Defined in:
- lib/cartup_command_helper.rb
Constant Summary collapse
- COMMAND_RUN =
"run"- COMMAND_INIT =
"init"- COMMAND_HELP =
"help"
Instance Attribute Summary collapse
-
#helpDescription ⇒ Object
readonly
Returns the value of attribute helpDescription.
Instance Method Summary collapse
- #handle(command) ⇒ Object
-
#initialize ⇒ CartupCommandHelper
constructor
A new instance of CartupCommandHelper.
- #printHelper ⇒ Object
Constructor Details
#initialize ⇒ CartupCommandHelper
Returns a new instance of CartupCommandHelper.
11 12 13 14 15 16 17 18 |
# File 'lib/cartup_command_helper.rb', line 11 def initialize @helpDescription = <<-EOF These are common Cartup commands used in some situations: - init Create an empty cart_uploader.yaml - run uploading the Carthage prebuilts to a cloud storage - help show help instructions and list available subcommands EOF end |
Instance Attribute Details
#helpDescription ⇒ Object (readonly)
Returns the value of attribute helpDescription.
9 10 11 |
# File 'lib/cartup_command_helper.rb', line 9 def helpDescription @helpDescription end |
Instance Method Details
#handle(command) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/cartup_command_helper.rb', line 21 def handle(command) case command when COMMAND_RUN CartBinaryUploader.run when COMMAND_INIT CartBinaryUploader.init when COMMAND_HELP printHelper else printHelper end end |
#printHelper ⇒ Object
34 35 36 |
# File 'lib/cartup_command_helper.rb', line 34 def printHelper puts @helpDescription end |