Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Truffle] Shim to make it easier to use bundler. #3297

Closed
wants to merge 1 commit into from

Conversation

chrisseaton
Copy link
Contributor

@nirvdrum had a script to run bundler with JRuby and then patch up the files it produced to let us use that. This shim simplifies that. For example you can now do:

$ bundler install --standalone --path vendor
$ bin/jruby -X+T -r ./vendor/bundler/setup.rb app.rb

This is something that we could start suggesting people try out on their own apps at some point soon.

I was also thinking about taking this a couple of steps further. Can we autodetect and run that setup.rb? Can we provide a command bin/truffle-bundle that then lets you do just:

$ bin/truffle-bundle
$ bin/jruby -X+T app.rb

@nirvdrum @pitr-ch @eregon please comment

@chrisseaton chrisseaton added this to the truffe milestone Aug 30, 2015
@chrisseaton chrisseaton self-assigned this Aug 30, 2015

if (name.equals("RUBY_ENGINE")
&& sourceSection.getSource().getPath().endsWith("bundler/setup.rb")
&& sourceSection.getStartLine() == 3) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fragile, I would remove the line check.

@eregon
Copy link
Member

eregon commented Aug 30, 2015

Auto-loading of vendor/bundler/setup.rb seems bad, since many commands expect to run without the Bundler setup if it is not specified.
Would bundler exec bin/jruby -X+T ... work instead? It should set up the right environment to load the bundle.

@pitr-ch
Copy link
Member

pitr-ch commented Aug 31, 2015

I would suggest to wait with this PR until I submit mine PR with the gem. Both PRs are trying to solve similar thing. Let's discuss then what'll be the best approach.

@chrisseaton
Copy link
Contributor Author

Yeah I forgot you were working on something similar. Better solutions welcome.

@chrisseaton
Copy link
Contributor Author

Closing in favour of #3298.

@chrisseaton chrisseaton modified the milestones: Invalid or Duplicate, truffe Aug 31, 2015
@chrisseaton chrisseaton deleted the truffle-bundler-shim branch September 1, 2015 11:15
@chrisseaton chrisseaton modified the milestones: truffe, truffle-dev Dec 19, 2015
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants