GithubHelp home page GithubHelp logo

mattgibson / resque-scheduler-web Goto Github PK

View Code? Open in Web Editor NEW
25.0 4.0 22.0 424 KB

Tabs in the Resque Web gem for the Resque Scheduler plugin.

Home Page: https://rubygems.org/gems/resque-scheduler-web

License: MIT License

Ruby 81.70% HTML 16.75% JavaScript 0.70% CSS 0.84%

resque-scheduler-web's Introduction

Resque::Scheduler::Web

Gem Version Code Climate Test Coverage Inline docs Dependency Status Build Status

This gem provides tabs in Resque Web for managing Resque Scheduler.

It works with any version of Resque and Resque Scheduler, but requires the Resque Web gem, rather than the older Resque Web Sinatra interface that comes bundled with Resque 1.x.

This gem is a port of the old Sinatra code to the new REsque Web plugin architecture and has better test coverage and a number of bug fixes compared to the older Resque Scheduler Sinatra code which it is based on. The only reason to use the old Sinatra interface right now is if you have other Resque plugins that have web interfaces that you need, but which have not been upgraded for the new Resque Web gem yet.

The Sinatra interface will be deprecated when Resque 2 is released, so if you want to get ahead of the curve, you can start using the latest Resque Web gem today.

Installation

Add this line to your application's Gemfile:

gem 'resque-scheduler-web'

And then execute:

$ bundle

Or install it yourself as:

$ gem install resque-scheduler-web

Usage

The gem will automatically add the correct tabs, provided you have the Resque Web engine mounted like this in routes.rb:

mount ResqueWeb::Engine => 'admin/resque_web'

Running the tests

cd resque-scheduler-web
bundle exec rake

Contributing

  1. Fork it ( https://github.com/mattgibson/resque-scheduler-web/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Acknowledgements

The original code and tests for this gem were taken from the Resque Scheduler gem's Sinatra interface, and subsequently adapted into a Rails engine. Kudos and thanks to the original authors.

resque-scheduler-web's People

Contributors

davegudge avatar mattgibson avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

resque-scheduler-web's Issues

Doesn't do anything

All resque gems in my gem file:
gem 'capistrano-resque', require: false gem 'resque' gem 'resque-scheduler' gem 'resque-scheduler-web' gem 'resque-loner'

My routes.rb:

  mount ResqueWeb::Engine => "/resque_web"
end

Accessing /resque_web, and I see no tabs.

Namespace collision with resque-scheduler

We're trying to add resque-scheduler-web to our app, but we're getting this error when we attempt to start up:

gems/resque-scheduler-web-0.0.1/lib/resque/scheduler/web/version.rb:2:in `<module:Resque>': Scheduler is not a module (TypeError)

This appears to be a collision with the class Resque::Scheduler in the resque-scheduler gem.

MRI Ruby 2.0.0
resque-scheduler (2.5.5)
resque-scheduler-web (0.0.1)
resque-web (0.0.6)

Hard time on installation

Hi there,

Is there any deeper documentation regarding the setup of resque-scheduler-web ?
I have an hard time debugging this as I am quite a newbie on ruby on rails.

I did setup resque-web successfully through the following:

  • rails new project
  • add gem 'resque-web', require: 'resque_web' and gem 'resque-scheduler-web' to Gemfile
  • add mount ResqueWeb::Engine => "/resque_web" to config/routes.rb
  • bundle install

then http://host/resque_web works as expected once I launch the webapp through rails server

but no luck to see the new scheduling tabs, although I got the gems installed in /usr/local/bundle/gems:

resque-1.26.0
resque-scheduler-4.3.0
resque-scheduler-web-1.1.0
resque-web-0.0.9

by the way mount ResqueWeb::Engine => "admin/resque_web" does not seem to work

PS: sorry for my poor ruby level :P

Add schedules tab configuration procedure in README

Hello,

I struggled a bit of time to see that my schedules where not showing in the schedules tab of resque-scheduler-web.

According to:
resque/resque-scheduler#541

What I had to do is just to create an initializer:
Resque.schedule = YAML.load_file Rails.root.join('schedules.yml')

Instead of creating a rake task, as advertised in https://github.com/resque/resque-scheduler
As I believe that many other users will have the issue, I purpose to add this to the readme.

Thanks a lot for the amazing job team.
Resque, with the help of resque-web is definitely one of the easiest queuing backend for rails thanks to your awesome work :)

NoMethodError: undefined method `find_asset' for nil:NilClass

When trying to load /resque_web with rails 4.2.5, I get the following exception:

NoMethodError: undefined method `find_asset' for nil:NilClass
1
File "/app/vendor/bundle/ruby/2.2.0/gems/resque-web-0.0.7/app/views/layouts/resque_web/application.html.erb" line 12 in block in _vendor_bundle_ruby_______gems_resque_web_______app_views_layouts_resque_web_application_html_erb___4084463186552865067_69824662505420
2
File "/app/vendor/bundle/ruby/2.2.0/gems/resque-web-0.0.7/app/views/layouts/resque_web/application.html.erb" line 11 in collect
3
File "/app/vendor/bundle/ruby/2.2.0/gems/resque-web-0.0.7/app/views/layouts/resque_web/application.html.erb" line 11 in _vendor_bundle_ruby_______gems_resque_web_______app_views_layouts_resque_web_application_html_erb___4084463186552865067_69824662505420
4
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/template.rb" line 145 in block in render
5
File "/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/notifications.rb" line 166 in instrument
6
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/template.rb" line 333 in instrument
7
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/template.rb" line 143 in render
8
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/renderer/template_renderer.rb" line 66 in render_with_layout
9
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/renderer/template_renderer.rb" line 52 in render_template
10
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/renderer/template_renderer.rb" line 14 in render
11
File "/app/vendor/bundle/ruby/2.2.0/gems/actionview-4.2.5/lib/action_view/renderer/renderer.rb" line 42 in render_template

Now, this seems like an issue with resque-web, and not this gem, but if I remove resque-scheduler-web the page loads just fine. Any ideas?

Delay tab not work

Undefined local variable or method `current_page' for
Extracted source (around line #7):

<p class='pagination'>
    <% if start + per_page <= size %>
      <a href="<%= current_page %>?start=<%= start + per_page %>" class='more'>&laquo;
        Next</a>
    <% end %>

Trace of template inclusion: /Users/admin/.rvm/gems/ruby-2.2.1/gems/resque-scheduler-web-0.0.4/app/views/resque_web/plugins/resque_scheduler/delayed/index.erb

Rails.root: /Users/admin/Documents/Aptana_Studio_3_Workspace/resque_web/ext_resque_web

More log

resque-scheduler-web (0.0.4) app/views/resque_web/plugins/resque_scheduler/delayed/_next_more.erb:7:in `___sers_admin__rvm_gems_ruby_______gems_resque_scheduler_web_______app_views_resque_web_plugins_resque_scheduler_delayed__next_more_erb__1975423488722421611_70120211167500'
actionview (4.2.4) lib/action_view/template.rb:145:in `block in render'
activesupport (4.2.4) lib/active_support/notifications.rb:166:in `instrument'
actionview (4.2.4) lib/action_view/template.rb:333:in `instrument'
actionview (4.2.4) lib/action_view/template.rb:143:in `render'
actionview (4.2.4) lib/action_view/renderer/partial_renderer.rb:339:in `render_partial'
actionview (4.2.4) lib/action_view/renderer/partial_renderer.rb:310:in `block in render'
actionview (4.2.4) lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
actionview (4.2.4) lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
actionview (4.2.4) lib/action_view/renderer/partial_renderer.rb:309:in `render'
actionview (4.2.4) lib/action_view/renderer/renderer.rb:47:in `render_partial'
actionview (4.2.4) lib/action_view/renderer/renderer.rb:21:in `render'
actionview (4.2.4) lib/action_view/helpers/rendering_helper.rb:32:in `render'
resque-scheduler-web (0.0.4) app/views/resque_web/plugins/resque_scheduler/delayed/index.erb:65:in `___sers_admin__rvm_gems_ruby_______gems_resque_scheduler_web_______app_views_resque_web_plugins_resque_scheduler_delayed_index_erb___2805294178135055704_70120155224980'
actionview (4.2.4) lib/action_view/template.rb:145:in `block in render'
activesupport (4.2.4) lib/active_support/notifications.rb:166:in `instrument'
actionview (4.2.4) lib/action_view/template.rb:333:in `instrument'
actionview (4.2.4) lib/action_view/template.rb:143:in `render'
actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
actionview (4.2.4) lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
actionview (4.2.4) lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (4.2.4) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.2.4) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.2.4) lib/action_view/rendering.rb:100:in `_render_template'
actionpack (4.2.4) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.2.4) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (4.2.4) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.2.4) lib/action_controller/metal/renderers.rb:37:in `render_to_body'
actionpack (4.2.4) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.2.4) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
activesupport (4.2.4) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/Users/admin/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
activesupport (4.2.4) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (4.2.4) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:43:in `render'
actionpack (4.2.4) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.2.4) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (4.2.4) lib/abstract_controller/base.rb:198:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.2.4) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.2.4) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
activesupport (4.2.4) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.4) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.4) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.4) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.4) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:76:in `call'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:45:in `serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
railties (4.2.4) lib/rails/engine.rb:518:in `call'
railties (4.2.4) lib/rails/railtie.rb:194:in `public_send'
railties (4.2.4) lib/rails/railtie.rb:194:in `method_missing'
actionpack (4.2.4) lib/action_dispatch/routing/mapper.rb:51:in `serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
railties (4.2.4) lib/rails/engine.rb:518:in `call'
railties (4.2.4) lib/rails/railtie.rb:194:in `public_send'
railties (4.2.4) lib/rails/railtie.rb:194:in `method_missing'
actionpack (4.2.4) lib/action_dispatch/routing/mapper.rb:51:in `serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
rack (1.6.4) lib/rack/etag.rb:24:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.4) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.4) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.2.1) lib/web_console/middleware.rb:39:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/static.rb:116:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.4) lib/rails/engine.rb:518:in `call'
railties (4.2.4) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
/Users/admin/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/Users/admin/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/Users/admin/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'

Thanks

Doesn't run under ruby 3

The 3 URI encode and decode references need updated to CGI as those URI method have been removed from Ruby 3

Resque scheduler server not found

versions:
rails (5.0.0.1)
resque (1.26.0)
resque-scheduler (4.3.0)
resque-scheduler-web (1.1.0)
resque-web (0.0.9)

Resque-Web shows the tab but clicked, it shows

LoadError at /schedule
cannot load such file -- rack/showexceptions

require 'resque/scheduler/server' this line inside

resque-scheduler-web (1.1.0) app/controllers/resque_web/plugins/resque_scheduler/schedules_controller.rb

is where it breaks

Don't read correctly Resque::Scheduler.dynamic

I have simply installed the gem as the README says, and this is my configuration of Resque::Schedule

task "resque:setup_schedule" => "resque:setup" do
  require 'resque-scheduler'
  Resque::Scheduler.dynamic = true
end

task "resque:scheduler" => "resque:setup_schedule"

But resque-scheduler-web behaves like Resque::Scheduler is not set on dynamic. Looking at the code I see the it read the Resque::Scheduler.dynamic (for example in the index view of the scheduler page), and in my case it reads it as it is false. But scheduler is set up correctly, I can see that it dynamically schedules the jobs.

Why scheduler-web can't read it right? What it could be?

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.