Currently, the -r flag supports being passed the root directory of a rails app or a single ruby file. In my use case, I'm often writing small APIs or celluloid apps bundled with a handful of jobs (usually living in ./lib/jobs). If I want faktory-worker to require all of my jobs, I need to maintain a separate file require-ing all of my job classes.
Instinctively I feel like you'd think you could use -r with a dir glob, or with the path to a directory. So here's a first crack at a proposal which implements that behavior.
I've also taken a little bit of artistic liberty with cleaning up the logical operators in boot_system, since I had to make some changes there anyway.
This is just a draft PR; I'm curious about your thoughts and would like some direction if you think this is useful.
Currently, the
-r
flag supports being passed the root directory of a rails app or a single ruby file. In my use case, I'm often writing small APIs or celluloid apps bundled with a handful of jobs (usually living in ./lib/jobs). If I want faktory-worker to require all of my jobs, I need to maintain a separate filerequire
-ing all of my job classes.Instinctively I feel like you'd think you could use
-r
with a dir glob, or with the path to a directory. So here's a first crack at a proposal which implements that behavior.I've also taken a little bit of artistic liberty with cleaning up the logical operators in boot_system, since I had to make some changes there anyway.
This is just a draft PR; I'm curious about your thoughts and would like some direction if you think this is useful.