Sha256: 48a59388b63a98eadf00eb8477860638ebb924f263ed0fb343a78ce6094fdb96

Contents?: true

Size: 1.16 KB

Versions: 4

Compression:

Stored size: 1.16 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
          Hem::Helper.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
          Hem::Helper.shell "php --version"
        rescue Errno::ENOENT
          raise Hem::HostCheckError.new("PHP is missing", advice)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hem-1.2.4 lib/hem/lib/host_check/deps.rb
hem-1.2.3 lib/hem/lib/host_check/deps.rb
hem-1.2.2 lib/hem/lib/host_check/deps.rb
hem-1.2.1 lib/hem/lib/host_check/deps.rb