Permalink
Browse files

update to v1.0.0

  • Loading branch information...
1 parent ce6b550 commit 2488caf1fb826414230c9f478ef1a32d79e73255 @lostboy committed Feb 18, 2012
Showing with 20 additions and 75 deletions.
  1. +1 −0 .gitignore
  2. +0 −18 Rakefile
  3. +1 −1 VERSION
  4. +1 −2 lib/{rails.rb → workless/initialize.rb}
  5. +2 −4 lib/workless/railtie.rb
  6. +1 −1 lib/workless/scalers/local.rb
  7. +1 −0 rails/init.rb
  8. +2 −2 spec/workless/scaler_spec.rb
  9. +11 −47 workless.gemspec
View
@@ -22,3 +22,4 @@ rdoc
pkg
## PROJECT::SPECIFIC
+Gemfile.lock
View
@@ -2,24 +2,6 @@ require 'rubygems'
require 'rake'
require 'bundler'
-begin
- require 'jeweler'
-
- Jeweler::Tasks.new do |gem|
- gem.name = "workless"
- gem.summary = %Q{Use delayed job workers only when theyre needed}
- gem.description = %Q{Extension to Delayed Job to enable workers to scale up when needed}
- gem.email = "paul.crabtree@gmail.com"
- gem.homepage = "http://github.com/lostboy/workless"
- gem.authors = ["lostboy"]
- gem.add_bundler_dependencies
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
-end
-
require 'rspec/core/rake_task'
desc "Run RSpec"
RSpec::Core::RakeTask.new do |t|
View
@@ -1 +1 @@
-0.2.0
+1.0.0
@@ -1,4 +1,3 @@
-require 'workless'
Delayed::Worker.max_attempts = 3
Delayed::Backend::ActiveRecord::Job.send(:include, Delayed::Workless::Scaler) if defined?(Delayed::Backend::ActiveRecord::Job)
-Delayed::Backend::Mongoid::Job.send(:include, Delayed::Workless::Scaler) if defined?(Delayed::Backend::Mongoid::Job)
+Delayed::Backend::Mongoid::Job.send(:include, Delayed::Workless::Scaler) if defined?(Delayed::Backend::Mongoid::Job)
View
@@ -1,12 +1,10 @@
require 'rails'
+require 'delayed_job'
module Delayed
class Railtie < Rails::Railtie
initializer :after_initialize do
- Delayed::Worker.max_attempts = 3
- [ Delayed::Backend::ActiveRecord::Job, Delayed::Backend::Mongoid::Job ].each do |klass|
- klass.send(:include, Delayed::Workless::Scaler) if defined?(klass)
- end
+ require 'workless/initialize'
end
end
end
@@ -11,7 +11,7 @@ def self.up
true
end
- def down
+ def self.down
$exit = true unless jobs.count > 0
true
end
View
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + "/../lib/workless/initialize"
@@ -33,11 +33,11 @@
context 'with a known scaler' do
before do
- Delayed::Job::Mock.scaler = :heroku_logarithmic
+ Delayed::Job::Mock.scaler = :heroku_cedar
end
it 'should be properly assigned' do
- Delayed::Job::Mock.scaler.should == Delayed::Workless::Scaler::HerokuLogarithmic
+ Delayed::Job::Mock.scaler.should == Delayed::Workless::Scaler::HerokuCedar
end
end
View
@@ -5,61 +5,25 @@
Gem::Specification.new do |s|
s.name = %q{workless}
- s.version = "0.2.0"
+ s.version = "1.0.0"
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version=
s.authors = ["lostboy"]
s.date = %q{2011-06-30}
s.description = %q{Extension to Delayed Job to enable workers to scale up when needed}
s.email = %q{paul.crabtree@gmail.com}
- s.extra_rdoc_files = [
- "LICENSE",
- "README.textile"
- ]
- s.files = [
- ".bundle/config",
- ".document",
- ".rvmrc",
- "Gemfile",
- "Gemfile.lock",
- "LICENSE",
- "README.textile",
- "Rakefile",
- "VERSION",
- "lib/workless.rb",
- "lib/workless/railtie.rb",
- "lib/workless/scaler.rb",
- "lib/workless/scalers/base.rb",
- "lib/workless/scalers/heroku.rb",
- "lib/workless/scalers/heroku_cedar.rb",
- "lib/workless/scalers/local.rb",
- "lib/workless/scalers/null.rb",
- "workless.gemspec"
- ]
+
+ s.files = Dir.glob("{rails,lib}/**/*") + %w(LICENSE README.textile)
+
s.homepage = %q{http://github.com/lostboy/workless}
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.5.0}
- s.summary = %q{Use delayed job workers only when theyre needed}
+ s.summary = %q{Use delayed job workers only when theyre needed on Heroku}
- if s.respond_to? :specification_version then
- s.specification_version = 3
+ s.add_runtime_dependency(%q<rails>)
+ s.add_runtime_dependency(%q<heroku>)
+ s.add_runtime_dependency(%q<rush>)
+ s.add_runtime_dependency(%q<delayed_job>, [">= 2.0.7"])
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<rails>)
- s.add_runtime_dependency(%q<heroku>)
- s.add_runtime_dependency(%q<rush>)
- s.add_runtime_dependency(%q<delayed_job>, [">= 2.0.7"])
- else
- s.add_dependency(%q<rails>)
- s.add_dependency(%q<heroku>)
- s.add_dependency(%q<rush>)
- s.add_dependency(%q<delayed_job>, [">= 2.0.7"])
- end
- else
- s.add_dependency(%q<rails>)
- s.add_dependency(%q<heroku>)
- s.add_dependency(%q<rush>)
- s.add_dependency(%q<delayed_job>, [">= 2.0.7"])
- end
+ s.add_development_dependency(%q<rspec>)
end

0 comments on commit 2488caf

Please sign in to comment.