Where should I put custom executables in a Rails project

I use bin / to host various bash scripts. I remember reading that this is incorrect due to bundle install --binstubs , which is confusing with our own bash scripts (or may even overwrite, causing a conflict).

I vaguely think the script / answer is correct, but I think this is not the case either.

Obviously, the β€œanswer” doesn't really matter, but if there is a standard location, I think it makes sense to use it.

+4
source share
2 answers

There seems to be no β€œright” answer for this. This is what I have looked for several times in the past, but I have never been happy enough to think of something as an agreed standard.

In practice, I saw binaries placed in script/ (do you really think that the whole directory should have only one file?), lib/script (I can see the logic of this corresponding to other "lib") lib/<various subdirectories> ( for more organized use of lib/ ) or rewritten to perform rake tasks ( lib/tasks )

+2
source

I searched for it in the kit and I found out this problem: https://github.com/carlhuda/bundler/issues/1250

They regret that binstubs can take values, so you can specify binstubs elsewhere. So the solution is the opposite of what you thought, you will point binstubs to a different path and save your scripts in / bin.

  bundle install --binstubs some_value 
+1
source

All Articles