Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resque 2 fixer #31

Open
wants to merge 8 commits into
base: resque2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .rvmrc

This file was deleted.

5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
language: ruby
rvm:
- ree
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- jruby-18mode # JRuby in 1.8 mode
- jruby-19mode # JRuby in 1.9 mode
- rbx-18mode
- rbx-19mode
services:
- redis-server
7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ source "http://rubygems.org"
# Specify your gem's dependencies in resque-history.gemspec
# gemspec

gem "resque"
gem "resque", "~> 2.0.0.pre.1", github: "resque/resque"
gem 'resque-web', require: 'resque_web'

group :development, :test do
gem "rake"
gem "bundler"
gem "jeweler"
gem 'yajl-ruby'
end

group :test do
gem "rspec-rails"
gem "rspec", ">2.12.0"
gem "rack-test"
Expand Down
160 changes: 130 additions & 30 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,49 +1,147 @@
GIT
remote: git://github.com/resque/resque.git
revision: ce435fab0067ea141160d409b52540202361d6d4
specs:
resque (2.0.0.pre.1)
json
mono_logger (~> 1.0)
redis-namespace (>= 1.3.0)
thor (~> 0.17)

GEM
remote: http://rubygems.org/
specs:
backports (3.1.1)
diff-lcs (1.2.2)
actionmailer (4.0.4)
actionpack (= 4.0.4)
mail (~> 2.5.4)
actionpack (4.0.4)
activesupport (= 4.0.4)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.4)
activesupport (= 4.0.4)
builder (~> 3.1.0)
activerecord (4.0.4)
activemodel (= 4.0.4)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.4)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.4)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.2)
atomic (1.1.16)
builder (3.1.4)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.7.0)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.0.2)
git (1.2.5)
hike (1.2.3)
i18n (0.6.9)
jeweler (1.8.4)
bundler (~> 1.0)
git (>= 1.2.5)
rake
rdoc
jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.7.7)
multi_json (1.7.1)
rack (1.4.5)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
minitest (4.7.5)
mono_logger (1.1.0)
multi_json (1.9.2)
polyglot (0.3.4)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.0.4)
actionmailer (= 4.0.4)
actionpack (= 4.0.4)
activerecord (= 4.0.4)
activesupport (= 4.0.4)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.4)
sprockets-rails (~> 2.0.0)
railties (4.0.4)
actionpack (= 4.0.4)
activesupport (= 4.0.4)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.0.4)
rdoc (4.0.0)
json (~> 1.4)
redis (3.0.3)
redis-namespace (1.2.1)
redis (~> 3.0.0)
resque (1.23.1)
multi_json (~> 1.0)
redis-namespace (~> 1.0)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
redis (3.0.7)
redis-namespace (1.4.1)
redis (~> 3.0.4)
resque-web (0.0.5)
coffee-rails
jquery-rails
resque
sass-rails
twitter-bootstrap-rails
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.0)
rspec-rails (1.3.2)
rack (>= 1.0.0)
rspec (>= 1.3.0)
sinatra (1.2.9)
backports
rack (~> 1.1, < 1.5)
tilt (>= 1.2.2, < 2.0)
tilt (1.3.6)
rspec-mocks (2.14.6)
rspec-rails (2.14.2)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
sass (3.2.18)
sass-rails (4.0.2)
railties (>= 4.0.0, < 5.0)
sass (~> 3.2.0)
sprockets (~> 2.8, <= 2.11.0)
sprockets-rails (~> 2.0.0)
sprockets (2.11.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
thor (0.19.1)
thread_safe (0.3.1)
atomic (>= 1.1.7, < 2)
tilt (1.4.1)
timecop (0.6.1)
vegas (0.1.11)
rack (>= 1.0.0)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
twitter-bootstrap-rails (2.2.8)
actionpack (>= 3.1)
execjs
rails (>= 3.1)
railties (>= 3.1)
tzinfo (0.3.39)
yajl-ruby (1.2.0)

PLATFORMS
ruby
Expand All @@ -53,7 +151,9 @@ DEPENDENCIES
jeweler
rack-test
rake
resque
resque (~> 2.0.0.pre.1)!
resque-web
rspec (> 2.12.0)
rspec-rails
timecop
yajl-ruby
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
#require 'resque_web/app/controllers/resque_web/application_controller'
#require 'app/controllers/resque_web/application_controller'

module ResqueWeb::Plugins::ResqueHistory
#class HistoriesController < ActionController::Base
class HistoriesController < ResqueWeb::ApplicationController
def show
module ResqueWeb
module Plugins
module ResqueHistory
#class HistoriesController < ActionController::Base
class HistoriesController #< ResqueWeb::ApplicationController
def show

end
end

def destroy
reset_history
redirect_to :show
end
def destroy
reset_history
redirect_to :show
end

private
private

def reset_history
size = redis.llen(Resque::Plugins::History::HISTORY_SET_NAME)
def reset_history
size = redis.llen(Resque::Plugins::History::HISTORY_SET_NAME)

size.times do
redis.lpop(Resque::Plugins::History::HISTORY_SET_NAME)
end
size.times do
redis.lpop(Resque::Plugins::History::HISTORY_SET_NAME)
end

end
end
end
end
end
3 changes: 1 addition & 2 deletions lib/resque-history/server.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'resque'
require 'resque/server'
#require 'resque/server'
#require 'resque-history'

# Extends Resque Web Based UI.
Expand Down Expand Up @@ -32,7 +32,6 @@ def self.included(base)
end
end

Resque::Server.tabs << 'History'
end

# Clears all historical jobs
Expand Down
2 changes: 1 addition & 1 deletion spec/resque-history/plugins/history_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def self.perform(*args)
job = Resque.reserve('test')
job.perform

arr = Resque.redis.lrange(Resque::Plugins::History::HISTORY_SET_NAME, 0, -1)

arr = Resque.backend.store.lrange(Resque::Plugins::History::HISTORY_SET_NAME, 0, -1)
arr.count.should == 1
JSON.parse(arr.first).should == {"class"=>"HistoryJob", "args"=>[12], "time"=>"2000-09-01 12:00", "execution"=>0}
end
Expand Down
8 changes: 4 additions & 4 deletions spec/resque-web_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
require 'timecop'


describe ResqueHistory::Server, :pending => true do
describe ResqueHistory::Server do
include Rack::Test::Methods

def app
@app ||= Resque::Server.new
end

let :queues do
Resque.redis.sadd(:queues, "queue1")
Resque.redis.sadd(:queues, "queue2")
Resque.redis.sadd(:queues, "queue3")
Resque.backend.store.sadd(:queues, "queue1")
Resque.backend.store.sadd(:queues, "queue2")
Resque.backend.store.sadd(:queues, "queue3")
end

before do
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
end

config.before(:each) do
Resque.redis.flushall
Resque.backend.store.flushall
Kernel.stub!(:sleep)
end

Expand Down