Class: Ninny::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/ninny/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

#new_stagingObject



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

def new_staging(*)
  if options[:help]
    invoke :help, ['new_staging']
  else
    require_relative 'commands/new_staging'
    Ninny::Commands::NewStaging.new(options).execute
  end
end

#setupObject



60
61
62
63
64
65
66
67
# File 'lib/ninny/cli.rb', line 60

def setup(*)
  if options[:help]
    invoke :help, ['setup']
  else
    require_relative 'commands/setup'
    Ninny::Commands::Setup.new(options).execute
  end
end

#stage_up(pull_request_id = nil) ⇒ Object



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

def stage_up(pull_request_id = nil)
  if options[:help]
    invoke :help, ['stage_up']
  else
    require_relative 'commands/stage_up'
    Ninny::Commands::StageUp.new(pull_request_id, options).execute
  end
end

#staging_branchObject



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

def staging_branch(*)
  if options[:help]
    invoke :help, ['staging_branch']
  else
    require_relative 'commands/staging_branch'
    Ninny::Commands::StagingBranch.new(options).execute
  end
end

#versionObject



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

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