Class: Albacore::NugetsRestore::Cmd
- Inherits:
-
Object
- Object
- Albacore::NugetsRestore::Cmd
- 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
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(work_dir, executable, *args) ⇒ Cmd
constructor
A new instance of Cmd.
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.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/albacore/task_types/nugets_restore.rb', line 44 def initialize work_dir, executable, *args opts = Map. 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 => []) if (opts.getopt :source) @parameters = [%W{install #{opts.getopt(:pkgcfg)} -OutputDirectory #{opts.getopt(:out)} -source #{@opts[:source][:uri]}}, pars.to_a].flatten else @parameters = [%W{install #{opts.getopt(:pkgcfg)} -OutputDirectory #{opts.getopt(:out)}}, pars.to_a].flatten end mono_command end |
Instance Method Details
#execute ⇒ Object
63 64 65 |
# File 'lib/albacore/task_types/nugets_restore.rb', line 63 def execute system @executable, @parameters, :work_dir => @work_dir, :output => false end |