Skip to content
Browse files

Merge remote branch 'upstream/master'

  • Loading branch information...
2 parents 88ded56 + 2ba5aa4 commit c419e9b17088eca97b267ac9260068bdf8dbfd6b @lasso committed
Showing with 24 additions and 7 deletions.
  1. +23 −6 lib/ramaze/setup.rb
  2. +1 −1 ramaze.gemspec
View
29 lib/ramaze/setup.rb
@@ -117,14 +117,11 @@ def setup_gem(name, options)
log "Activating gem #{name}"
- Gem.activate(name, *version)
- require(lib_name)
-
+ activate(name, lib_name, *version)
# Gem not installed yet
- rescue LoadError
+ rescue Gem::LoadError
install_gem(name, options)
- Gem.activate(name, *version)
- require(lib_name)
+ activate(name, lib_name, *version)
end
##
@@ -166,6 +163,26 @@ def temp_argv(extconf)
private
##
+ # Activates a gem and requires it.
+ #
+ # @author Yorick Peterse
+ # @author Lee Jarvis
+ # @since 20-08-2011
+ # @param [String] name The name of the gem to activate.
+ # @param [String] lib_name The name of the gem as it should be required.
+ # @param [Array] requirements An array with additional requirements.
+ #
+ def activate(name, lib_name, *requirements)
+ if Gem::Specification.respond_to?(:find_by_name)
+ Gem::Specification.find_by_name(name, *requirements).activate
+ else
+ Gem.activate(name, *requirements)
+ end
+
+ require(lib_name)
+ end
+
+ ##
# Writes the message to the logger.
#
# @author Michael Fellinger (manveru)
View
2 ramaze.gemspec
@@ -7,7 +7,7 @@ path = File.expand_path('../', __FILE__)
Gem::Specification.new do |s|
s.name = 'ramaze'
s.version = Ramaze::VERSION
- s.date = '25-07-2011'
+ s.date = '2011-07-25'
s.authors = ['Michael \'manveru\' Fellinger']
s.email = 'm.fellinger@gmail.com'
s.summary = 'Ramaze is a simple and modular web framework'

0 comments on commit c419e9b

Please sign in to comment.
Something went wrong with that request. Please try again.