Module: ReverseRequire
- Defined in:
- lib/reverse_require/version.rb,
lib/reverse_require/reverse_require.rb
Constant Summary collapse
- VERSION =
'0.3.1'
Class Method Summary collapse
-
.rubygems_version_check(&block) ⇒ Object
Preforms a version check on rubygems before calling the given block.
Class Method Details
.rubygems_version_check(&block) ⇒ Object
Preforms a version check on rubygems before calling the given block. If rubygems >= 1.3.0 is not found, then an exception will be raised.
6 7 8 9 10 11 12 13 14 |
# File 'lib/reverse_require/reverse_require.rb', line 6 def self.rubygems_version_check(&block) major, minor, rev = Gem::RubyGemsVersion.split('.').map { |i| i.to_i } if (major <= 1 && minor <= 2) raise("rubygems >= 1.3.0 is required, please run 'gem update --system'") end block.call if block end |