Class: PLink
- Inherits:
-
Object
- Object
- PLink
- Includes:
- Albacore::RunCommand, Albacore::Task
- Defined in:
- lib/albacore/plink.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#key ⇒ Object
Returns the value of attribute key.
-
#port ⇒ Object
Returns the value of attribute port.
-
#user ⇒ Object
Returns the value of attribute user.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Attributes included from Albacore::RunCommand
Attributes included from Logging
Instance Method Summary collapse
- #build_parameter(param_name, param_value) ⇒ Object
- #check_command ⇒ Object
- #create_parameters ⇒ Object
-
#initialize ⇒ PLink
constructor
A new instance of PLink.
- #run ⇒ Object
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 ⇒ PLink
Returns a new instance of PLink.
10 11 12 13 14 15 16 |
# File 'lib/albacore/plink.rb', line 10 def initialize() @require_valid_command = false @port = 22 @verbose = false @commands = [] super() end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/albacore/plink.rb', line 7 def host @host end |
#key ⇒ Object
Returns the value of attribute key.
7 8 9 |
# File 'lib/albacore/plink.rb', line 7 def key @key end |
#port ⇒ Object
Returns the value of attribute port.
7 8 9 |
# File 'lib/albacore/plink.rb', line 7 def port @port end |
#user ⇒ Object
Returns the value of attribute user.
7 8 9 |
# File 'lib/albacore/plink.rb', line 7 def user @user end |
#verbose ⇒ Object
Returns the value of attribute verbose.
7 8 9 |
# File 'lib/albacore/plink.rb', line 7 def verbose @verbose end |
Instance Method Details
#build_parameter(param_name, param_value) ⇒ Object
38 39 40 |
# File 'lib/albacore/plink.rb', line 38 def build_parameter(param_name, param_value) "-#{param_name} #{param_value}" end |
#check_command ⇒ Object
42 43 44 45 46 |
# File 'lib/albacore/plink.rb', line 42 def check_command return true if @command 'Plink.path_to_command cannot be nil.' return false end |
#create_parameters ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/albacore/plink.rb', line 27 def create_parameters parameters = [] parameters << "#{@user}@#{@host} -P #{@port} " parameters << build_parameter("i", @key) unless @key.nil? parameters << "-batch" parameters << "-v" if @verbose parameters << @commands @logger.debug "PLink Parameters" + parameters.join(" ") return parameters end |
#run ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/albacore/plink.rb', line 18 def run() return unless check_command parameters = create_parameters result = run_command "Plink", parameters.join(" ") = 'Command Failed. See Build Log For Detail' if !result end |