Class: NuGetUpdate
- Inherits:
-
Object
- Object
- NuGetUpdate
- Includes:
- Albacore::RunCommand, Albacore::Task, Configuration::NuGetUpdate, SupportsLinuxEnvironment
- Defined in:
- lib/albacore/nugetupdate.rb
Instance Attribute Summary collapse
-
#input_file ⇒ Object
Returns the value of attribute input_file.
-
#repository_path ⇒ Object
Returns the value of attribute repository_path.
-
#safe ⇒ Object
Returns the value of attribute safe.
Attributes included from SupportsLinuxEnvironment
Attributes included from Albacore::RunCommand
Attributes included from Logging
Instance Method Summary collapse
- #execute ⇒ Object
- #get_array_parameter(arr) ⇒ Object
- #get_command_parameters ⇒ Object
-
#initialize(command = "NuGet.exe") ⇒ NuGetUpdate
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::NuGetUpdate
#nugetupdate, nugetupdateconfig
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") ⇒ NuGetUpdate
users might have put the NuGet.exe in path
18 19 20 21 22 |
# File 'lib/albacore/nugetupdate.rb', line 18 def initialize(command = "NuGet.exe") # users might have put the NuGet.exe in path super() update_attributes nugetupdate.to_hash @command = command end |
Instance Attribute Details
#input_file ⇒ Object
Returns the value of attribute input_file.
11 12 13 |
# File 'lib/albacore/nugetupdate.rb', line 11 def input_file @input_file end |
#repository_path ⇒ Object
Returns the value of attribute repository_path.
11 12 13 |
# File 'lib/albacore/nugetupdate.rb', line 11 def repository_path @repository_path end |
#safe ⇒ Object
Returns the value of attribute safe.
11 12 13 |
# File 'lib/albacore/nugetupdate.rb', line 11 def safe @safe end |
Instance Method Details
#execute ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/albacore/nugetupdate.rb', line 24 def execute params = get_command_parameters @logger.debug "Build NuGet Update Command Line: #{params}" result = run_command "NuGet", params 'NuGet Update Failed. See Build Log For Detail' unless result end |
#get_array_parameter(arr) ⇒ Object
47 48 49 |
# File 'lib/albacore/nugetupdate.rb', line 47 def get_array_parameter(arr) "\"#{arr.join(';')}\"" end |
#get_command_parameters ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/albacore/nugetupdate.rb', line 33 def get_command_parameters 'An input file must be specified (packages.config|solution).' if self.input_file.nil? params = [] params << "update" params << "#{self.input_file}" params << "-Source #{get_array_parameter(self.source)}" unless self.source.nil? params << "-Id #{get_array_parameter(self.id)}" unless self.id.nil? params << "-RepositoryPath #{self.repository_path}" unless self.repository_path.nil? params << "-Safe" if self.safe merged_params = params.join(' ') end |