Class: SystemCheck::App::RubyVersionCheck
- Inherits:
-
BaseCheck
- Object
- BaseCheck
- SystemCheck::App::RubyVersionCheck
show all
- Defined in:
- lib/system_check/app/ruby_version_check.rb
Instance Attribute Summary
Attributes inherited from BaseCheck
#skip_reason
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BaseCheck
#can_repair?, #can_skip?, check_fail, check_pass, display_name, #multi_check, #multi_check?, #repair!, set_check_fail, set_check_pass, set_name, set_skip_reason, #skip?, skip_reason
Methods included from Helpers
#construct_help_page_url, #finished_checking, #fix_and_rerun, #for_more_information, #omnibus_gitlab?, #sanitized_message, #see_installation_guide_section, #should_sanitize?, #start_checking, #sudo_gitlab, #try_fixing_it
#ask_to_continue, #checkout_or_clone_version, #checkout_version, #clone_repo, #download_package_file_version, #get_version, #gid_for, #gitlab_user, #gitlab_user?, #invoke_and_time_task, #os_name, #prompt, #prompt_for_password, #run_and_match, #run_command, #run_command!, #uid_for, #user_home, #warn_user_is_not_gitlab
Class Method Details
.current_version ⇒ Object
13
14
15
|
# File 'lib/system_check/app/ruby_version_check.rb', line 13
def self.current_version
@current_version ||= Gitlab::VersionInfo.parse(RUBY_VERSION)
end
|
.required_version ⇒ Object
9
10
11
|
# File 'lib/system_check/app/ruby_version_check.rb', line 9
def self.required_version
@required_version ||= Gitlab::VersionInfo.new(3, 0, 6)
end
|
Instance Method Details
#check? ⇒ Boolean
17
18
19
|
# File 'lib/system_check/app/ruby_version_check.rb', line 17
def check?
self.class.current_version.valid? && self.class.required_version <= self.class.current_version
end
|
#show_error ⇒ Object
21
22
23
24
25
26
|
# File 'lib/system_check/app/ruby_version_check.rb', line 21
def show_error
try_fixing_it(
"Update your ruby to a version >= #{self.class.required_version} from #{self.class.current_version}"
)
fix_and_rerun
end
|