Skip to content

Commit

Permalink
Fix Builder to work with installed gems (use require_paths instead of…
Browse files Browse the repository at this point in the history
… assumed load_paths)
  • Loading branch information
Adam Beynon committed Dec 21, 2011
1 parent dd956d7 commit 3f0cbdd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/opal/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,19 @@ def build_gem spec
@built_bundles << spec.name

puts "* Bundling: #{spec.name}"
libs = spec.lib_files
root = spec.full_gem_path

if spec.is_a? Gem::Specification
libs = []
spec.require_paths.each do |r|
Dir.chdir(root) { libs.push *Dir["#{r}/**/*.rb"] }
end
else
libs = spec.lib_files
end

files = spec.respond_to?(:other_files) ? spec.other_files : []
code = []
root = spec.full_gem_path

code << "opal.gem({'name': '#{spec.name}'"

Expand Down

0 comments on commit 3f0cbdd

Please sign in to comment.