Class: Ecogem::Cli::Commands::Install

Inherits:
Object
  • Object
show all
Defined in:
lib/ecogem/cli/commands/install.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Install



7
8
9
# File 'lib/ecogem/cli/commands/install.rb', line 7

def initialize(args)
  @args = args
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
19
# File 'lib/ecogem/cli/commands/install.rb', line 11

def execute
  ::Ecogem.new_workspace(@args) do |ws|
    gemfile = "--gemfile=#{ws.gemfile.write.inspect}"
    ws.gitsfile.save
    args = [*@args.bundler_args, gemfile].join(' ')
    command = "bundle install #{args}"
    system command
  end
end