diff --git a/.travis.yml b/.travis.yml index 3b6cc2f8..caa32c7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: ruby services: - redis-server rvm: - - 1.9.3 - jruby-19mode - rbx-2 - 2.0.0 diff --git a/lib/sidekiq.rb b/lib/sidekiq.rb index 907df681..20fef7d7 100644 --- a/lib/sidekiq.rb +++ b/lib/sidekiq.rb @@ -1,5 +1,7 @@ # encoding: utf-8 require 'sidekiq/version' +fail "Sidekiq #{Sidekiq::VERSION} does not support Ruby 1.9." if RUBY_PLATFORM != 'java' && RUBY_VERSION < '2.0.0' + require 'sidekiq/logging' require 'sidekiq/client' require 'sidekiq/worker' @@ -23,7 +25,7 @@ module Sidekiq :startup => [], :quiet => [], :shutdown => [], - }, + } } def self.❨╯°□°❩╯︵┻━┻ @@ -66,7 +68,7 @@ module Sidekiq end def self.redis(&block) - raise ArgumentError, "requires a block" if !block + raise ArgumentError, "requires a block" unless block redis_pool.with(&block) end @@ -143,8 +145,8 @@ module Sidekiq # end # end def self.on(event, &block) - raise ArgumentError, "Symbols only please: #{event}" if !event.is_a?(Symbol) - raise ArgumentError, "Invalid event name: #{event}" if !options[:lifecycle_events].keys.include?(event) + raise ArgumentError, "Symbols only please: #{event}" unless event.is_a?(Symbol) + raise ArgumentError, "Invalid event name: #{event}" unless options[:lifecycle_events].keys.include?(event) options[:lifecycle_events][event] << block end end diff --git a/sidekiq.gemspec b/sidekiq.gemspec index e1404d44..bb781568 100644 --- a/sidekiq.gemspec +++ b/sidekiq.gemspec @@ -13,7 +13,6 @@ Gem::Specification.new do |gem| gem.test_files = `git ls-files -- test/*`.split("\n") gem.name = "sidekiq" gem.require_paths = ["lib"] - gem.required_ruby_version = '>= 2.0.0' gem.version = Sidekiq::VERSION gem.add_dependency 'redis', '>= 3.0.6' gem.add_dependency 'redis-namespace', '>= 1.3.1'