Module: GithubRunDeck::CLI

Defined in:
lib/github-rundeck/cli.rb

Overview

> GitHub-RunDeck Launcher

Defined Under Namespace

Classes: Options

Class Method Summary collapse

Class Method Details

.configure(argv = ARGV) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/github-rundeck/cli.rb', line 61

def configure(argv = ARGV)
  # => Parse CLI Configuration
  cli = Options.new
  cli.parse_options(argv)

  # => Parse JSON Config File (If Specified & Exists)
  json_config = Util.parse_json(cli.config[:config_file] || Config.config_file)

  # => Merge Configuration (CLI Wins)
  config = [json_config, cli.config].compact.reduce(:merge)

  # => Apply Configuration
  config.each { |k, v| Config.send("#{k}=", v) }
end

.run(argv = ARGV) ⇒ Object

> Launch the Application



77
78
79
80
81
82
83
# File 'lib/github-rundeck/cli.rb', line 77

def run(argv = ARGV)
  # => Parse the Params
  configure(argv)

  # => Launch the API
  API.run!
end