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

Use local commands #7

Closed
ashmoran opened this issue Mar 23, 2010 · 4 comments
Closed

Use local commands #7

ashmoran opened this issue Mar 23, 2010 · 4 comments

Comments

@ashmoran
Copy link

Didn't think about this until working on Spork, where you want to use the local binary. (Unlike, say, working on cucumber-rails, where the relevant binaries come from other projects.)

Currently I'm putting this at the top of Spork's env.rb:

ENV["PATH"] = File.expand_path(File.dirname(__FILE__) + "/../../bin") << ":" << ENV["PATH"]

This is to avoid any facepalm moments in future where I change Spork code and don't re-install the gem. Question is, does Aruba need a step for this or an API means of making it easy? eg

Given $PATH includes "bin"

(which I don't like)

@aslakhellesoy
Copy link
Contributor

Aruba should work well for command line apps in general (not only Ruby ones).
I don't think it should have magic for the bin folder.

Can't you just do:

When I run "bin/spork"

Or am I missing something?

@ashmoran
Copy link
Author

Yeah I thought that. But the problem is figuring out what "bin" is relative to. The above won't work, for example, if your project dir isn't in the PATH.

The problem is that as soon as you install the project gem, the command appears in the PATH, but it won't be running the code you actually want to test. It's a subtle gotcha.

@aslakhellesoy
Copy link
Contributor

This is fixed on master now.

@ashmoran
Copy link
Author

Cool cheers Aslak.

This issue was closed.
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

No branches or pull requests

2 participants