Skip to content

Instantly share code, notes, and snippets.

@georgebrock
Created March 7, 2014 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save georgebrock/2ac522163551e0755368 to your computer and use it in GitHub Desktop.
Save georgebrock/2ac522163551e0755368 to your computer and use it in GitHub Desktop.
> Bundler.definition.specs_for([:dist]).each { |gem| p gem.name => gem.require_paths } ; 1
{"rake"=>["lib"]}
{"i18n"=>["lib"]}
{"multi_json"=>["lib"]}
{"activesupport"=>["lib"]}
{"bundler"=>["lib"]}
{"colored"=>["lib"]}
{"highline"=>["lib"]}
{"xcodeproj"=>["../../extensions/x86_64-darwin-12/2.1.0-static/xcodeproj-0.14.1", "ext", "lib"]}
@gfontenot
Copy link

Change to vendorize:

      gem.require_paths.each do |path|
        setup_file << "$LOAD_PATH.unshift(File.expand_path(%s, __FILE__))\n" % [
          "../#{gem.name}-#{gem.version}/#{path}".inspect
        ]
      end

Output:

$LOAD_PATH.unshift(File.expand_path("../rake-10.1.1/lib", __FILE__))
$LOAD_PATH.unshift(File.expand_path("../i18n-0.6.9/lib", __FILE__))
$LOAD_PATH.unshift(File.expand_path("../multi_json-1.9.0/lib", __FILE__))
$LOAD_PATH.unshift(File.expand_path("../activesupport-3.2.17/lib", __FILE__))
$LOAD_PATH.unshift(File.expand_path("../colored-1.2/lib", __FILE__))
$LOAD_PATH.unshift(File.expand_path("../highline-1.6.21/lib", __FILE__))
$LOAD_PATH.unshift(File.expand_path("../xcodeproj-0.14.1/ext", __FILE__))
$LOAD_PATH.unshift(File.expand_path("../xcodeproj-0.14.1/lib", __FILE__))

@georgebrock
Copy link
Author

That looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment