Class: GemInstaller::RubyGemsVersionWarnings
- Inherits:
-
Object
- Object
- GemInstaller::RubyGemsVersionWarnings
- Defined in:
- lib/geminstaller/rubygems_version_warnings.rb
Class Method Summary collapse
- .allow_unsupported? ⇒ Boolean
- .incompatible_warning(options = {}) ⇒ Object
- .outdated_warning(options = {}) ⇒ Object
- .print_warnings(options = {}) ⇒ Object
Class Method Details
.allow_unsupported? ⇒ Boolean
29 30 31 |
# File 'lib/geminstaller/rubygems_version_warnings.rb', line 29 def self.allow_unsupported? defined? ALLOW_UNSUPPORTED_RUBYGEMS_VERSION end |
.incompatible_warning(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/geminstaller/rubygems_version_warnings.rb', line 15 def self.incompatible_warning( = {}) return nil if allow_unsupported? return nil unless ( GemInstaller::RubyGemsVersionChecker.matches?('=0.9.5', ) or GemInstaller::RubyGemsVersionChecker.matches?('=1.1.0', ) ) return "\n\n----------------------------------------------------------------\n" + "WARNING: You are using RubyGems version #{Gem::RubyGemsVersion}.\n" + "This version is known to have bugs and/or compatibility issues\n" + "with GemInstaller. Update RubyGems, or continue at your risk.\n" + "To update rubygems (recommended), use 'gem update --system'.\n" + "----------------------------------------------------------------\n\n" end |
.outdated_warning(options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/geminstaller/rubygems_version_warnings.rb', line 3 def self.outdated_warning( = {}) return nil if allow_unsupported? return nil if GemInstaller::RubyGemsVersionChecker.matches?('>=0.9.5', ) return "\n\n----------------------------------------------------------------\n" + "WARNING: You are using RubyGems version #{Gem::RubyGemsVersion}.\n" + "You should update to RubyGems version 1.0.1 or above,\n" + "because gems created for newer RubyGems versions\n" + "might be incompatible.\n" + "To update rubygems (recommended), use 'gem update --system'.\n" + "----------------------------------------------------------------\n\n" end |
.print_warnings(options = {}) ⇒ Object
33 34 35 36 |
# File 'lib/geminstaller/rubygems_version_warnings.rb', line 33 def self.print_warnings( = {}) warnings = [self.outdated_warning, self.incompatible_warning].compact! warnings.each {|warning| print warning} end |