Class: RedmineInstaller::Environment

Inherits:
TaskModule show all
Defined in:
lib/redmine-installer/environment.rb

Constant Summary

Constants included from Utils

Utils::PROGRESSBAR_FORMAT

Instance Attribute Summary

Attributes inherited from TaskModule

#task

Instance Method Summary collapse

Methods inherited from TaskModule

#initialize

Methods included from Utils

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

Constructor Details

This class inherits a constructor from RedmineInstaller::TaskModule

Instance Method Details

#checkObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/redmine-installer/environment.rb', line 4

def check
  if user_is_root? && !task.options.enable_user_root
    error 'You cannot install redmine under root. Please change user.'
  end

  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new(RedmineInstaller::MIN_SUPPORTED_RUBY)
    error "You are using unsupported ruby. Please install at least #{RedmineInstaller::MIN_SUPPORTED_RUBY}."
  end

  logger.info 'Environemnt checked'
end

#user_is_root?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/redmine-installer/environment.rb', line 16

def user_is_root?
  Process.euid == 0
end