Class: Appetize::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/appetize/cli.rb

Overview

Handle the application command line parsing and the dispatch to various command objects

Constant Summary collapse

Error =

Error raised by this runner

Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#delete(public_key, token = nil, api_host = nil) ⇒ Object


48
49
50
51
52
53
54
55
# File 'lib/appetize/cli.rb', line 48

def delete(public_key, token = nil, api_host = nil)
  if options[:help]
    invoke :help, ["delete"]
  else
    require_relative "commands/delete"
    Appetize::Commands::Delete.new(public_key, token, api_host, options).execute
  end
end

#update(path, public_key, token = nil, api_host = nil) ⇒ Object


24
25
26
27
28
29
30
31
# File 'lib/appetize/cli.rb', line 24

def update(path, public_key, token = nil, api_host = nil)
  if options[:help]
    invoke :help, ["update"]
  else
    require_relative "commands/update"
    Appetize::Commands::Update.new(path, public_key, token, api_host, options).execute
  end
end

#upload(path, platform, token = nil, api_host = nil) ⇒ Object


36
37
38
39
40
41
42
43
# File 'lib/appetize/cli.rb', line 36

def upload(path, platform, token = nil, api_host = nil)
  if options[:help]
    invoke :help, ["upload"]
  else
    require_relative "commands/upload"
    Appetize::Commands::Upload.new(path, platform, token, api_host, options).execute
  end
end

#versionObject


15
16
17
18
# File 'lib/appetize/cli.rb', line 15

def version
  require_relative "version"
  puts "v#{Appetize::VERSION}"
end