Class: CartBinaryUploader::CartupCommandHelper
- Inherits:
-
Object
- Object
- CartBinaryUploader::CartupCommandHelper
- Defined in:
- lib/cartup_command_helper.rb
Constant Summary collapse
- COMMAND_RUN =
'run'.freeze
- COMMAND_INIT =
'init'.freeze
- COMMAND_HELP =
'help'.freeze
Instance Attribute Summary collapse
-
#help_description ⇒ Object
readonly
Returns the value of attribute help_description.
Instance Method Summary collapse
- #handle(command) ⇒ Object
-
#initialize ⇒ CartupCommandHelper
constructor
A new instance of CartupCommandHelper.
- #print_helper ⇒ 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 @help_description = <<-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
#help_description ⇒ Object (readonly)
Returns the value of attribute help_description.
9 10 11 |
# File 'lib/cartup_command_helper.rb', line 9 def help_description @help_description end |
Instance Method Details
#handle(command) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cartup_command_helper.rb', line 20 def handle(command) case command when COMMAND_RUN CartBinaryUploader.run when COMMAND_INIT CartBinaryUploader.init when COMMAND_HELP print_helper else print_helper end end |
#print_helper ⇒ Object
33 34 35 |
# File 'lib/cartup_command_helper.rb', line 33 def print_helper puts @help_description end |