Class: NuGetPublish
- Inherits:
-
Object
- Object
- NuGetPublish
- Includes:
- Albacore::RunCommand, Albacore::Task, Configuration::NuGetPublish, SupportsLinuxEnvironment
- Defined in:
- lib/albacore/nugetpublish.rb
Instance Attribute Summary collapse
-
#apikey ⇒ Object
Package Id.
-
#command ⇒ Object
Package Id.
-
#id ⇒ Object
Package Id.
-
#source ⇒ Object
Package Id.
-
#version ⇒ Object
Package Id.
Attributes included from SupportsLinuxEnvironment
Attributes included from Albacore::RunCommand
Attributes included from Logging
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(command = "NuGet.exe") ⇒ NuGetPublish
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::NuGetPublish
#nugetpublish, nugetpublishconfig
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") ⇒ NuGetPublish
users might have put the NuGet.exe in path
17 18 19 20 21 |
# File 'lib/albacore/nugetpublish.rb', line 17 def initialize(command = "NuGet.exe") # users might have put the NuGet.exe in path super() update_attributes nugetpublish.to_hash @command = command end |
Instance Attribute Details
#apikey ⇒ Object
Package Id
11 12 13 |
# File 'lib/albacore/nugetpublish.rb', line 11 def apikey @apikey end |
#command ⇒ Object
Package Id
11 12 13 |
# File 'lib/albacore/nugetpublish.rb', line 11 def command @command end |
#id ⇒ Object
Package Id
11 12 13 |
# File 'lib/albacore/nugetpublish.rb', line 11 def id @id end |
#source ⇒ Object
Package Id
11 12 13 |
# File 'lib/albacore/nugetpublish.rb', line 11 def source @source end |
#version ⇒ Object
Package Id
11 12 13 |
# File 'lib/albacore/nugetpublish.rb', line 11 def version @version end |
Instance Method Details
#execute ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/albacore/nugetpublish.rb', line 23 def execute 'id must be specified.' if @id.nil? 'version must be specified.' if @version.nil? # don't validate @apikey as required, coz it might have been set in the config file using 'SetApiKey' puts @create_only params = [] params << "publish" params << "#{@id}" params << "#{@version}" params << "#{@apikey}" if @apikey params << "-Source #{source}" unless @source.nil? merged_params = params.join(' ') @logger.debug "Build NuGet publish Command Line: #{merged_params}" result = run_command "NuGet", merged_params = 'NuGet Publish Failed. See Build Log For Details' if !result end |