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