Class: Albacore::NugetsRestore::Cmd

Inherits:
Object
  • Object
show all
Includes:
CrossPlatformCmd, Logging
Defined in:
lib/albacore/task_types/nugets_restore.rb

Constant Summary

Constants included from CrossPlatformCmd

CrossPlatformCmd::KILL_TIMEOUT

Instance Attribute Summary

Attributes included from CrossPlatformCmd

#pid

Instance Method Summary collapse

Methods included from CrossPlatformCmd

#chdir, #make_command, #normalise_slashes, #sh, #shie, #stop, #system, #which

Methods included from Logging

#debug, #err, #error, #fatal, #info, #puts, #trace, #warn

Constructor Details

#initialize(work_dir, executable, *args) ⇒ Cmd

Returns a new instance of Cmd.

Raises:

  • (ArgumentError)


44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/albacore/task_types/nugets_restore.rb', line 44

def initialize work_dir, executable, *args
  opts = Map.options args
  raise ArgumentError, 'pkgcfg is nil' if opts.getopt(:pkgcfg).nil? 
  raise ArgumentError, 'out is nil' if opts.getopts(:out).nil?
  @work_dir = work_dir
  @executable = executable
  @opts = opts

  pars = opts.getopt(:parameters, :default => [])
  @parameters = [%W{install #{opts.getopt(:pkgcfg)} -OutputDirectory #{opts.getopt(:out)}}, pars.to_a].flatten

  mono_command
end

Instance Method Details

#executeObject



58
59
60
# File 'lib/albacore/task_types/nugets_restore.rb', line 58

def execute
  system @executable, @parameters, :work_dir => @work_dir, :output => false
end