Skip to content

Commit

Permalink
Merge pull request resque#360 from meatballhat/api-cleanup
Browse files Browse the repository at this point in the history
API cleanup step 0
  • Loading branch information
Matteo Centenaro committed Feb 24, 2014
2 parents 3e0c739 + 34d83a4 commit 7b4abc4
Show file tree
Hide file tree
Showing 55 changed files with 1,360 additions and 1,184 deletions.
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.bundle/
.idea/
/.bundle/
/.idea/
/.yardoc/

doc/
pkg
/doc/
/pkg/
nbproject
Gemfile.lock
.rvmrc
/Gemfile.lock
/.rvmrc
*.swp

/coverage/
Expand Down
23 changes: 12 additions & 11 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2014-02-09 12:18:33 -0500 using RuboCop version 0.18.1.
# on 2014-02-12 01:55:22 -0500 using RuboCop version 0.18.1.
# The point is for the user to remove these configuration records
# one by one as the offences are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -9,30 +9,31 @@ AllCops:
Includes:
- Gemfile
- Rakefile
- '*.gemspec'
- 'bin/*'
- resque-scheduler.gemspec
- bin/resque-scheduler

# Offence count: 1
CaseEquality:
Enabled: false

# Offence count: 1
# Offence count: 2
# Configuration parameters: CountComments.
ClassLength:
Max: 342
Max: 130

# Offence count: 4
# Offence count: 3
CyclomaticComplexity:
Max: 24
Max: 21

# Offence count: 29
Documentation:
Enabled: false

# Offence count: 17
# Configuration parameters: CountComments.
MethodLength:
Max: 150
Max: 145

# Offence count: 1
RescueException:
Enabled: false

Documentation:
Enabled: false
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rvm:
env:
global:
- RESQUE_SCHEDULER_DISABLE_TEST_REDIS_SERVER=1
- JRUBY_OPTS='-Xcext.enabled=true'
services:
- redis-server
notifications:
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ gem 'resque-scheduler'
Adding the resque:scheduler rake task:

```ruby
require 'resque_scheduler/tasks'
require 'resque/scheduler/tasks'
```

### Rake integration
Expand All @@ -66,12 +66,12 @@ everything `resque` needs to know.
```ruby
# Resque tasks
require 'resque/tasks'
require 'resque_scheduler/tasks'
require 'resque/scheduler/tasks'

namespace :resque do
task :setup do
require 'resque'
require 'resque_scheduler'
require 'resque-scheduler'

# you probably already have this somewhere
Resque.redis = 'localhost:6379'
Expand Down Expand Up @@ -145,8 +145,8 @@ scheduled job must run (coerced with `Kernel#Float()`) (default `5`)
* `LOGFORMAT` - Log output format to use (either `'text'` or `'json'`,
default `'text'`)
* `PIDFILE` - If non-empty, write process PID to file (default empty)
* `QUIET` or `MUTE` - Silence most output if non-empty (equivalent to
a level of `Logger::FATAL`, default `false`)
* `QUIET` - Silence most output if non-empty (equivalent to a level of
`Logger::FATAL`, default `false`)
* `VERBOSE` - Maximize log verbosity if non-empty (equivalent to a level
of `Logger::DEBUG`, default `false`)

Expand Down Expand Up @@ -448,7 +448,7 @@ redis instance and schedule. The scheduler processes will use redis to
elect a master process and detect failover when the master dies. Precautions are
taken to prevent jobs from potentially being queued twice during failover even
when the clocks of the scheduler machines are slightly out of sync (or load affects
scheduled job firing time). If you want the gory details, look at Resque::SchedulerLocking.
scheduled job firing time). If you want the gory details, look at Resque::Scheduler::Locking.

If the scheduler process(es) goes down for whatever reason, the delayed items
that should have fired during the outage will fire once the scheduler process
Expand Down Expand Up @@ -495,8 +495,8 @@ Now, you want to add the following:

```ruby
# This will make the tabs show up.
require 'resque_scheduler'
require 'resque_scheduler/server'
require 'resque-scheduler'
require 'resque/scheduler/server'
```

That should make the scheduler tabs show up in `resque-web`.
Expand Down Expand Up @@ -534,8 +534,8 @@ worker is started.
There are several options to toggle the way scheduler logs its actions. They
are toggled by environment variables:

- `MUTE` will stop logging anything. Completely silent.
- `VERBOSE` opposite of 'mute'; will log even debug information
- `QUIET` will stop logging anything. Completely silent.
- `VERBOSE` opposite of 'QUIET'; will log even debug information
- `LOGFILE` specifies the file to write logs to. (default standard output)
- `LOGFORMAT` specifies either "text" or "json" output format
(default "text")
Expand All @@ -545,7 +545,7 @@ values:

```ruby
Resque::Scheduler.configure do |c|
c.mute = false
c.quiet = false
c.verbose = false
c.logfile = nil # meaning all messages go to $stdout
c.logformat = 'text'
Expand Down
8 changes: 6 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ v2.6.0
TODO for v3.0.0
===============

- Clean up all RuboCop offences, breaking the API if necessary
- Get to at least 95% test coverage
- [x] Clean up all RuboCop offences, breaking the API if necessary
- [x] Get to at least 95% test coverage
- [x] Collapse `lib/resque_scheduler` into `lib/resque/scheduler`
- [ ] Reduce public API on `Resque::Scheduler::Extension` to fewer than 10 methods
- [ ] Reduce public API on `Resque::Scheduler` to fewer than 10 methods
- [ ] Anything else?

TODO for v3.1.0
===============
Expand Down
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rubocop/rake_task'
require 'yard'

task default: [:rubocop, :test] unless RUBY_PLATFORM =~ /java/
task default: [:test] if RUBY_PLATFORM =~ /java/
Expand All @@ -16,3 +17,5 @@ Rake::TestTask.new do |t|
o << '--verbose ' if ENV['VERBOSE']
end
end

YARD::Rake::YardocTask.new
4 changes: 2 additions & 2 deletions bin/resque-scheduler
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
# vim:fileencoding=utf-8

require 'resque_scheduler'
ResqueScheduler::Cli.run!
require 'resque-scheduler'
Resque::Scheduler::Cli.run!
2 changes: 1 addition & 1 deletion examples/Rakefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# vim:fileencoding=utf-8
require 'resque_scheduler/tasks'
require 'resque/scheduler/tasks'
4 changes: 2 additions & 2 deletions examples/config/initializers/resque-web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
redis_env_var = ENV['REDIS_PROVIDER'] || 'REDIS_URL'
Resque.redis = ENV[redis_env_var] || 'localhost:6379'

require 'resque_scheduler'
require 'resque_scheduler/server'
require 'resque-scheduler'
require 'resque/scheduler/server'

schedule_yml = ENV['RESQUE_SCHEDULE_YML']
if schedule_yml
Expand Down
4 changes: 2 additions & 2 deletions examples/dynamic-scheduling/lib/tasks/resque.rake
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# vim:fileencoding=utf-8

require 'resque/tasks'
require 'resque_scheduler/tasks'
require 'resque/scheduler/tasks'
require 'yaml'

namespace :resque do
task :setup do
require 'resque'
require 'resque_scheduler'
require 'resque-scheduler'

rails_root = ENV['RAILS_ROOT'] || File.expand_path('../../../', __FILE__)
rails_env = ENV['RAILS_ENV'] || 'development'
Expand Down
4 changes: 3 additions & 1 deletion lib/resque-scheduler.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# vim:fileencoding=utf-8
require File.expand_path('../resque_scheduler', __FILE__)
require_relative 'resque/scheduler'

Resque.extend Resque::Scheduler::Extension
Loading

0 comments on commit 7b4abc4

Please sign in to comment.