Sha256: 66d08236e90be4c54eed4d5d8415d78a024e910b3b4d009012f79e569d9b7207

Contents?: true

Size: 864 Bytes

Versions: 2

Compression:

Stored size: 864 Bytes

Contents

require 'cartup'

module CartBinaryUploader
  class CartupCommandHelper
    COMMAND_RUN = 'run'.freeze
    COMMAND_INIT = 'init'.freeze
    COMMAND_HELP = 'help'.freeze

    attr_reader :help_description

    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


    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

    def print_helper
      puts @help_description
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cartup-0.1.7.1 lib/cartup_command_helper.rb
cartup-0.1.7 lib/cartup_command_helper.rb