Class: RedmineInstaller::Easycheck

Inherits:
Object
  • Object
show all
Extended by:
Utils
Defined in:
lib/redmine-installer/easycheck.rb

Constant Summary collapse

EASYCHECK_SH =
'https://raw.githubusercontent.com/easyredmine/easy_server_requirements_check/master/easycheck.sh'

Constants included from Utils

Utils::PROGRESSBAR_FORMAT

Class Method Summary collapse

Methods included from Utils

class_name, create_dir, env_user, error, logger, ok, pastel, print_title, prompt, run_command

Class Method Details

.runObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/redmine-installer/easycheck.rb', line 9

def self.run
  Bundler.with_unbundled_env do
    if Kernel.system('which', 'wget')
      Open3.pipeline(['wget', EASYCHECK_SH, '-O', '-', '--quiet'], 'bash')

    elsif Kernel.system('which', 'curl')
      Open3.pipeline(['curl', EASYCHECK_SH, '--output', '-', '--silent'], 'bash')

    else
      error 'Neither wget nor curl was found'
    end
  end

  puts
  if !prompt.yes?('Continue?')
    error 'Canceled'
  end
end