Class: NuGetPack
- Inherits:
-
Object
- Object
- NuGetPack
- Defined in:
- lib/albacore/nugetpack.rb
Instance Attribute Summary collapse
-
#base_folder ⇒ Object
Returns the value of attribute base_folder.
-
#command ⇒ Object
Returns the value of attribute command.
-
#nuspec ⇒ Object
Returns the value of attribute nuspec.
-
#output ⇒ Object
Returns the value of attribute output.
-
#symbols ⇒ Object
Returns the value of attribute symbols.
Attributes included from SupportsLinuxEnvironment
Attributes included from Albacore::RunCommand
Attributes included from Logging
Instance Method Summary collapse
- #build_properties ⇒ Object
- #execute ⇒ Object
-
#initialize(command = "NuGet.exe") ⇒ NuGetPack
constructor
users might have put the NuGet.exe in path.
Methods included from SupportsLinuxEnvironment
#format_path, #format_reference, #to_OS_format
Methods included from Configuration::NuGetPack
Methods included from Albacore::Configuration
Methods included from Albacore::RunCommand
Methods included from AttrMethods
Methods included from Albacore::Task
clean_dirname, create_rake_task, include_config, included
Methods included from UpdateAttributes
Methods included from YAMLConfig
#configure, #load_config_by_task_name
Methods included from Logging
#create_logger, #log_device=, #log_level, #log_level=
Methods included from Failure
Constructor Details
#initialize(command = "NuGet.exe") ⇒ NuGetPack
users might have put the NuGet.exe in path
19 20 21 22 23 |
# File 'lib/albacore/nugetpack.rb', line 19 def initialize(command = "NuGet.exe") # users might have put the NuGet.exe in path super() update_attributes nugetpack.to_hash @command = command end |
Instance Attribute Details
#base_folder ⇒ Object
Returns the value of attribute base_folder.
11 12 13 |
# File 'lib/albacore/nugetpack.rb', line 11 def base_folder @base_folder end |
#command ⇒ Object
Returns the value of attribute command.
11 12 13 |
# File 'lib/albacore/nugetpack.rb', line 11 def command @command end |
#nuspec ⇒ Object
Returns the value of attribute nuspec.
11 12 13 |
# File 'lib/albacore/nugetpack.rb', line 11 def nuspec @nuspec end |
#output ⇒ Object
Returns the value of attribute output.
11 12 13 |
# File 'lib/albacore/nugetpack.rb', line 11 def output @output end |
#symbols ⇒ Object
Returns the value of attribute symbols.
11 12 13 |
# File 'lib/albacore/nugetpack.rb', line 11 def symbols @symbols end |
Instance Method Details
#build_properties ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/albacore/nugetpack.rb', line 46 def build_properties option_text = [] @properties.each do |key, value| option_text << "#{key}=\"#{value}\"" end '-Properties ' + option_text.join(";") end |
#execute ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/albacore/nugetpack.rb', line 25 def execute 'nuspec must be specified.' if @nuspec.nil? params = [] params << "pack" params << "-Symbols" if @symbols params << "#{nuspec}" params << "-BasePath #{base_folder}" unless @base_folder.nil? params << "-OutputDirectory #{output}" unless @output.nil? params << build_properties unless @properties.nil? || @properties.empty? merged_params = params.join(' ') @logger.debug "Build NuGet pack Command Line: #{merged_params}" result = run_command "NuGet", merged_params = 'NuGet Failed. See Build Log For Detail' if !result end |