Class: AlpacaBuildTool::Nuget

Inherits:
Tool
  • Object
show all
Defined in:
lib/alpacabuildtool/tools/nuget.rb

Overview

tool

Direct Known Subclasses

PackageManager

Instance Attribute Summary

Attributes included from Log

#log

Instance Method Summary collapse

Methods inherited from Tool

#call, #initialize

Constructor Details

This class inherits a constructor from AlpacaBuildTool::Tool

Instance Method Details

#install(package, outputdir = nil, prerelease = false, exclude_version = false, source = nil) ⇒ Object


11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/alpacabuildtool/tools/nuget.rb', line 11

def install(package,
            outputdir = nil,
            prerelease = false,
            exclude_version = false,
            source = nil)
  extra_options = {}
  extra_options['OutputDirectory'] = outputdir if outputdir
  extra_options['Prerelease'] = prerelease if prerelease
  extra_options['ExcludeVersion'] = exclude_version if exclude_version
  extra_options['Source'] = source if source
  run_command 'install', package, extra_options
end

#pack(nuspec_or_project, configuration = nil) ⇒ Object


24
25
26
27
28
# File 'lib/alpacabuildtool/tools/nuget.rb', line 24

def pack(nuspec_or_project, configuration = nil)
  extra_options = {}
  extra_options['Prop'] = "Configuration=#{configuration}" if configuration
  run_command 'pack', nuspec_or_project, extra_options
end

#push(package, source) ⇒ Object


30
31
32
# File 'lib/alpacabuildtool/tools/nuget.rb', line 30

def push(package, source)
  run_command 'install', package, 'Source' => source
end

#restore(solution_file) ⇒ Object


7
8
9
# File 'lib/alpacabuildtool/tools/nuget.rb', line 7

def restore(solution_file)
  run_command 'restore', solution_file
end