Class: CartBinaryUploader::CartupCommandHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/cartup_command_helper.rb

Constant Summary collapse

COMMAND_RUN =
"run"
COMMAND_INIT =
"init"
COMMAND_HELP =
"help"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCartupCommandHelper

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

#helpDescriptionObject (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

#printHelperObject



34
35
36
# File 'lib/cartup_command_helper.rb', line 34

def printHelper
  puts @helpDescription
end