Sha256: be69591f5cd6dfc6c19e2b4f4c76453cc4ea0a2d9ce7aac9c2740322eba959e4

Contents?: true

Size: 1.13 KB

Versions: 10

Compression:

Stored size: 1.13 KB

Contents

module Hem
  module Lib
    module HostCheck
      def ssh_present opts
        advice = "The SSH command could not be located on your system.\n\n"

        if Hem.windows?
          advice += "To make SSH available you must re-install git using the installer from http://git-scm.com/downloads ensuring you select the 'Use git and unix tools everywhere' option."
        else
          advice += "Please install openssh using your package manager."
        end

        begin
          shell "ssh -V"
        rescue Errno::ENOENT
          raise Hem::HostCheckError.new("SSH is missing", advice)
        end
      end

      def php_present opts
        advice = <<-EOF
The PHP command could not be located on your system.

This is an optional command that can speed up composer dependency installs.

Please install it from your package manager ensuring that the following command does not produce any errors:

  php -r "readfile('https://getcomposer.org/installer');" | php
EOF

        begin
          shell "php --version"
        rescue Errno::ENOENT
          raise Hem::HostCheckError.new("PHP is missing", advice)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hem-1.2.0 lib/hem/lib/host_check/deps.rb
hem-1.1.2 lib/hem/lib/host_check/deps.rb
hem-1.1.1 lib/hem/lib/host_check/deps.rb
hem-1.1.0 lib/hem/lib/host_check/deps.rb
hem-1.0.1.beta6 lib/hem/lib/host_check/deps.rb
hem-1.0.1.beta5 lib/hem/lib/host_check/deps.rb
hem-1.0.1.beta4 lib/hem/lib/host_check/deps.rb
hem-1.0.1.beta3 lib/hem/lib/host_check/deps.rb
hem-1.0.1.beta2 lib/hem/lib/host_check/deps.rb
hem-1.0.1.beta1 lib/hem/lib/host_check/deps.rb