lib/tap/support/gems.rb in bahuvrihi-tap-0.10.4 vs lib/tap/support/gems.rb in bahuvrihi-tap-0.10.5
- old
+ new
@@ -1,37 +1,11 @@
-autoload(:Gem, 'rubygems')
+require 'rubygems'
module Tap
module Support
- module Gems
- module_function
-
- # Finds the home directory for the user (method taken from Rubygems).
- def find_home
- ['HOME', 'USERPROFILE'].each do |homekey|
- return ENV[homekey] if ENV[homekey]
- end
-
- if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] then
- return "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}"
- end
-
- begin
- File.expand_path("~")
- rescue
- if File::ALT_SEPARATOR then
- "C:/"
- else
- "/"
- end
- end
- end
-
- # The home directory for the user.
- def user_home
- @user_home ||= find_home
- end
-
+ module Gems
+ module_function
+
# Returns the gemspec for the specified gem. A gem version
# can be specified in the name, like 'gem >= 1.2'. The gem
# will be activated using +gem+ if necessary.
def gemspec(gem_name)
return gem_name if gem_name.kind_of?(Gem::Specification)
\ No newline at end of file