Skip to content
This repository has been archived by the owner on Mar 2, 2019. It is now read-only.

Commit

Permalink
Fixed gem spec loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbooker committed Jun 15, 2009
1 parent 2d25a10 commit 8f6b192
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions require2lib.rb
Expand Up @@ -57,32 +57,30 @@ def self.gatherlibs
Dir.mkdir(File.expand_path("rubyscript2exe.gems/gems", LIBDIR))
Dir.mkdir(File.expand_path("rubyscript2exe.gems/specifications", LIBDIR))

Gem.loaded_specs.each do |gem|
if gem.loaded?
$stderr.puts "Found gem #{gem.name} (#{gem.version})." if VERBOSE
Gem.loaded_specs.each do |key, gem|
$stderr.puts "Found gem #{gem.name} (#{gem.version})." if VERBOSE

fromdir = File.join(gem.installation_path, "specifications")
todir = File.expand_path("rubyscript2exe.gems/specifications", LIBDIR)
fromdir = File.join(gem.installation_path, "specifications")
todir = File.expand_path("rubyscript2exe.gems/specifications", LIBDIR)

fromfile = File.join(fromdir, "#{gem.full_name}.gemspec")
tofile = File.join(todir, "#{gem.full_name}.gemspec")
fromfile = File.join(fromdir, "#{gem.full_name}.gemspec")
tofile = File.join(todir, "#{gem.full_name}.gemspec")

File.copy(fromfile, tofile)
File.copy(fromfile, tofile)

fromdir = gem.full_gem_path
todir = File.expand_path(File.join("rubyscript2exe.gems/gems", gem.full_name), LIBDIR)
fromdir = gem.full_gem_path
todir = File.expand_path(File.join("rubyscript2exe.gems/gems", gem.full_name), LIBDIR)

Dir.copy(fromdir, todir)
Dir.copy(fromdir, todir)

Dir.find(todir).each do |file|
if File.file?(file)
gem.require_paths.each do |lib|
unless lib.empty?
lib = File.expand_path(lib, todir)
lib = lib + "/"

requireablefiles << file[lib.length..-1] if file =~ /^#{lib}/
end
Dir.find(todir).each do |file|
if File.file?(file)
gem.require_paths.each do |lib|
unless lib.empty?
lib = File.expand_path(lib, todir)
lib = lib + "/"

requireablefiles << file[lib.length..-1] if file =~ /^#{lib.gsub('+', '\+')}/
end
end
end
Expand Down

0 comments on commit 8f6b192

Please sign in to comment.