Class: ServerTools::InstallDebPackage
- Inherits:
-
Object
- Object
- ServerTools::InstallDebPackage
- Includes:
- SSH
- Defined in:
- lib/server_tools/install_deb_package.rb
Instance Method Summary collapse
- #copy_command ⇒ Object
-
#initialize(hostname, options) ⇒ InstallDebPackage
constructor
A new instance of InstallDebPackage.
- #install_command ⇒ Object
Methods included from SSH
Constructor Details
#initialize(hostname, options) ⇒ InstallDebPackage
6 7 8 9 |
# File 'lib/server_tools/install_deb_package.rb', line 6 def initialize(hostname, ) @hostname = hostname = end |
Instance Method Details
#copy_command ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/server_tools/install_deb_package.rb', line 11 def copy_command [ "rsync -avz", %(-e "ssh #{ssh_opts(options)}"), "--progress --partial", "#{options[:deb_package_file]}", "#{options[:ssh_user]}@#{hostname}:~/" ].join(' ') end |
#install_command ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/server_tools/install_deb_package.rb', line 21 def install_command ["ssh #{hostname}", "#{ssh_opts(options)}"].tap do |command| if [:purge_older_version] command << %('#{purge_command} && #{_install_command}') else command << %('#{_install_command}') end end.join(' ') end |