Class: Terraspace::CLI::Bundle

Inherits:
Object
  • Object
show all
Defined in:
lib/terraspace/cli/bundle.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Bundle

Returns a new instance of Bundle.



5
6
7
# File 'lib/terraspace/cli/bundle.rb', line 5

def initialize(options={})
  @options = options
end

Instance Method Details

#argsObject

Allows bundle to be called without install. So both work:

terraspace bundle
terraspace bundle install


19
20
21
22
23
24
25
26
# File 'lib/terraspace/cli/bundle.rb', line 19

def args
  args = @options[:args]
  if args.empty? or args.first.include?('--')
    args.unshift("install")
  end
  args = ["bundle"] + args
  args
end

#runObject



9
10
11
12
# File 'lib/terraspace/cli/bundle.rb', line 9

def run
  TerraspaceBundler.config.deep_merge!(Terraspace.config.bundle)
  TerraspaceBundler::CLI.start(args)
end