Top Level Namespace
Defined Under Namespace
Modules: ActionCable, Redmineup Classes: ApplicationRecord, RedmineupController
Instance Method Summary collapse
Instance Method Details
#requires_redmineup(arg) ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/redmineup.rb', line 113 def requires_redmineup(arg) arg = { version_or_higher: arg } unless arg.is_a?(Hash) arg.assert_valid_keys(:version_or_higher) requirement = arg[:version_or_higher] unless requirement.is_a?(String) raise ArgumentError, ':version_or_higher accepts a version string only' end current = Gem::Version.new(Redmineup::VERSION) required = Gem::Version.new(requirement) return true if required <= current = "Redmine requires redmineup gem version #{requirement} or higher " \ "(you're using #{Redmineup::VERSION}).\n" \ "Please update with 'bundle update redmineup --conservative'." Rails.logger&.error("\033[31m[ERROR]\033[0m #{}") abort "\033[31m#{}\033[0m" end |