Coder Social home page Coder Social logo

guard-delayed's Introduction

Guard::Delayed

Guard::Delayed automatically starts/stops/restarts delayed_job

Install

Please be sure to have Guard installed before continuing.

Add it to your Gemfile (inside your development and/or test group):

gem 'guard-delayed'

Add guard definition to your Guardfile by running this command:

guard init delayed

Usage

Please read Guard usage doc.

I suggest you put the delayed guard definition before your test/rspec guard if your tests depend on it being active.

Guardfile

guard 'delayed', :environment => 'development' do
  watch(%r{^app/(.+)\.rb})
end

Options

    :environment        defaults to 'test'
    :min_priority       e.g. 2
    :max_priority       e.g. 10
    :number_of_workers  e.g. 2
    :pid_dir            e.g. tmp/pids Specifies an alternate directory in which to store the process ids.
    :identifier         A numeric identifier for the worker.
    :monitor            Start monitor process.
    :sleep-delay N      Amount of time to sleep in seconds when no jobs are found
    :prefix NAME        String to be prefixed to worker process names
    :root               directory to find the executable. Defaults to ''
    :command            Command to execute. Default to 'bin/delayed_job'

Development

Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change you make.

Building and deploying gem

  • Update the version number in lib/guard/delayed/version.rb

  • Update CHANGELOG.md

  • Build the gem:

    gem build guard-delayed.gemspec

  • Push to rubygems.org:

    gem push guard-delayed-0.4.0.gem

Testing the gem locally

gem install guard-delayed-0.4.0.gem

Authors

David Parry Dennis Reimann

Ideas for this gem came from Guard::WEBrick.

guard-delayed's People

Contributors

dennisreimann avatar drewda avatar filipegiusti avatar greeneca avatar olleolleolle avatar substantial-philipbjorge avatar sunny avatar suranyami avatar vizh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

guard-delayed's Issues

Jobs not running

I hate to post such a vauge issue, but basically jobs are not getting run. Upon starting Guard I get the following:

Starting up delayed_job...

Then... nothing. If I use rake jobs:work from another terminal, the jobs do get run as expected.

Any idea how I could troubleshoot this? Thanks!

guard-delayed.gemspec needs updating

Hi,
I think the gemspec needs to update delayed_job version dependendency to

 s.add_dependency 'delayed_job', '>= 3'

so it can be compatible with rails 4.2, delayed_job_active_record 4.1.1 and delayed_job 4.1.2.

Thanks.

guard/guard-delayed out of sync

I noticed that the "official" guard plugin repo is 51 commits behind form this one. Hopefully you can update it ๐Ÿ˜„

thanks.

test/unit error

I'm having hard time running it in my 1.9.3. Here's the log from running "guard":

delayed_job: trying to stop process with pid 20189...
delayed_job: process with pid 20189 successfully stopped.
/home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: stop (ArgumentError)
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:21:in `run'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
Starting up delayed_job...
/home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: start (ArgumentError)
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:21:in `run'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
    from /home/jkl/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'

What is strange is that I'm not using Test::Unit, but RSpec. When I remove guard-delayed from Gemfile the error disappears.

Shutdown delayed_job process when shutting down guard

It seems that he delayed_job process is not shut down together with guard, because when restarting guard I see the following:

$ guard -c
...
delayed_job: trying to stop process with pid 80135...
delayed_job: process with pid 80135 successfully stopped.
Starting up delayed_job...
...

I think the process should be shut down together with guard.

Add note to manually restart delayed job when changing code

I've been chasing a ghost for hours now, and finally I found the problem: one has to restart the delayed_job process when changing codes, otherwise it won't recognize it!

I think you should add a note to README that clarifies that, so the next one won't run into this problem... Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.