contribsys / faktory_worker_ruby

Faktory worker for Ruby
GNU Lesser General Public License v3.0
214 stars 31 forks source link

Implement using -r with a directory of job classes. #70

Closed Igneous closed 1 year ago

Igneous commented 1 year ago

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.

mperham commented 1 year ago

I’m fine with the status quo.

Igneous commented 1 year ago

Hah, fair enough