Module: EasyInstaller::MethodValidateHelper

Includes:
InstallHelper
Defined in:
lib/easy_installer/methods/ftp/validate_helper.rb,
lib/easy_installer/methods/local/validate_helper.rb,
lib/easy_installer/methods/sample/validate_helper.rb

Instance Method Summary collapse

Methods included from InstallHelper

#chmod, #chmod_r, #create_directory, #delete_directory, #move_directory, #move_file, #remove_directory, #setup

Instance Method Details

#check_connection(params = {}) ⇒ Object

copy local directory to remote can be used to push data to server e.g. move_directory(“joomla_installer”, @inputs)

  • Args :

    • params -> hash with data to connect “ftp_username”=> “”, “ftp_password”=>“” @inputs

  • Returns :

    • true -> if connecting

    • false -> if fails



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/easy_installer/methods/ftp/validate_helper.rb', line 12

def check_connection params = {}
	host = params["ftp_host"] 
	username = params["ftp_username"]
	password = params["ftp_password"]
	begin
		setup "ftp_host"=>host, "ftp_username"=>username, "ftp_password"=>password
		true
	rescue
		false
	end
end