Class: VagrantPlugins::GPIICi::Command::InitEnvironment

Inherits:
Base
  • Object
show all
Defined in:
lib/vagrant-gpii-ci/action/init_environment.rb,
lib/vagrant-gpii-ci/command/init.rb

Overview

This action sets up the GPII CI environment

Instance Method Summary collapse

Methods inherited from Base

#action

Constructor Details

#initialize(app, env) ⇒ InitEnvironment

Returns a new instance of InitEnvironment.



9
10
11
12
# File 'lib/vagrant-gpii-ci/action/init_environment.rb', line 9

def initialize(app, env)
  @app = app
  @logger = Log4r::Logger.new("VagrantPlugins::GPIICi::action::init_environment")
end

Instance Method Details

#call(env) ⇒ Object



14
15
16
17
18
# File 'lib/vagrant-gpii-ci/action/init_environment.rb', line 14

def call(env)
  @logger.info('This call does nothing yet')
  #TODO: Create a .qi.yml file based on a template
  @app.call(env)
end

#executeObject

Raises:

  • (Vagrant::Errors::CLIInvalidUsage)


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/vagrant-gpii-ci/command/init.rb', line 9

def execute
  opts = OptionParser.new do |o|
    o.banner = "Usage: vagrant ci test [-h]"
  end

  # Parse the options
  argv = parse_options(opts)
  return if !argv
  raise Vagrant::Errors::CLIInvalidUsage, help: opts.help.chomp if argv.length > 0

  # List the installed plugins
  action(Action.action_init)

  # Success, exit status 0
  0
end