diff options
Diffstat (limited to 'activejob')
-rw-r--r-- | activejob/CHANGELOG.md | 4 | ||||
-rw-r--r-- | activejob/README.md | 2 | ||||
-rw-r--r-- | activejob/Rakefile | 15 | ||||
-rw-r--r-- | activejob/lib/active_job/queue_adapter.rb | 6 | ||||
-rw-r--r-- | activejob/lib/active_job/queue_adapters.rb | 4 | ||||
-rw-r--r-- | activejob/test/cases/test_case_test.rb | 8 |
6 files changed, 15 insertions, 24 deletions
diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md index 74f4c2588e..c523723fc4 100644 --- a/activejob/CHANGELOG.md +++ b/activejob/CHANGELOG.md @@ -3,7 +3,7 @@ Fixes #18821. - *Kevin Deisz* And *Jeroen van Baarsen* + *Kevin Deisz*, *Jeroen van Baarsen* * `assert_enqueued_jobs` and `assert_performed_jobs` in block form use the given number as expected value. This makes the error message much easier to @@ -11,7 +11,7 @@ *y-yagi* -* A generated job now inherents from `app/jobs/application_job.rb` by default. +* A generated job now inherits from `app/jobs/application_job.rb` by default. *Jeroen van Baarsen* diff --git a/activejob/README.md b/activejob/README.md index 5170ebee6e..f9a3183b1a 100644 --- a/activejob/README.md +++ b/activejob/README.md @@ -102,7 +102,7 @@ see the API Documentation for [ActiveJob::QueueAdapters](http://api.rubyonrails. The latest version of Active Job can be installed with RubyGems: ``` - % [sudo] gem install activejob + % gem install activejob ``` Source code can be downloaded as part of the Rails project on GitHub diff --git a/activejob/Rakefile b/activejob/Rakefile index 0e36bb81b3..8c86df3c91 100644 --- a/activejob/Rakefile +++ b/activejob/Rakefile @@ -1,5 +1,4 @@ require 'rake/testtask' -require 'rubygems/package_task' ACTIVEJOB_ADAPTERS = %w(inline delayed_job qu que queue_classic resque sidekiq sneakers sucker_punch backburner test) ACTIVEJOB_ADAPTERS -= %w(queue_classic) if defined?(JRUBY_VERSION) @@ -74,17 +73,3 @@ def run_without_aborting(tasks) abort "Errors running #{errors.join(', ')}" if errors.any? end - - -spec = eval(File.read('activejob.gemspec')) - -Gem::PackageTask.new(spec) do |p| - p.gem_spec = spec -end - -desc 'Release to rubygems' -task release: :package do - require 'rake/gemcutter' - Rake::Gemcutter::Tasks.new(spec).define - Rake::Task['gem:push'].invoke -end diff --git a/activejob/lib/active_job/queue_adapter.rb b/activejob/lib/active_job/queue_adapter.rb index 9c4519432d..457015b741 100644 --- a/activejob/lib/active_job/queue_adapter.rb +++ b/activejob/lib/active_job/queue_adapter.rb @@ -4,7 +4,7 @@ require 'active_support/core_ext/string/inflections' module ActiveJob # The <tt>ActiveJob::QueueAdapter</tt> module is used to load the - # correct adapter. The default queue adapter is the :inline queue. + # correct adapter. The default queue adapter is the +:inline+ queue. module QueueAdapter #:nodoc: extend ActiveSupport::Concern @@ -15,12 +15,14 @@ module ActiveJob # Includes the setter method for changing the active queue adapter. module ClassMethods + # Returns the backend queue provider. The default queue adapter + # is the +:inline+ queue. See QueueAdapters for more information. def queue_adapter _queue_adapter end # Specify the backend queue provider. The default queue adapter - # is the :inline queue. See QueueAdapters for more + # is the +:inline+ queue. See QueueAdapters for more # information. def queue_adapter=(name_or_adapter_or_class) self._queue_adapter = interpret_adapter(name_or_adapter_or_class) diff --git a/activejob/lib/active_job/queue_adapters.rb b/activejob/lib/active_job/queue_adapters.rb index bd69e525bb..1335e3236e 100644 --- a/activejob/lib/active_job/queue_adapters.rb +++ b/activejob/lib/active_job/queue_adapters.rb @@ -116,6 +116,10 @@ module ActiveJob private_constant :ADAPTER class << self + # Returns adapter for specified name. + # + # ActiveJob::QueueAdapters.lookup(:sidekiq) + # # => ActiveJob::QueueAdapters::SidekiqAdapter def lookup(name) const_get(name.to_s.camelize << ADAPTER) end diff --git a/activejob/test/cases/test_case_test.rb b/activejob/test/cases/test_case_test.rb index 0a3a20d5a0..ee816e1dd5 100644 --- a/activejob/test/cases/test_case_test.rb +++ b/activejob/test/cases/test_case_test.rb @@ -5,11 +5,11 @@ require 'jobs/nested_job' class ActiveJobTestCaseTest < ActiveJob::TestCase # this tests that this job class doesn't get its adapter set. - # that's the correct behaviour since we don't want to break - # the `class_attribute` inheritence - class TestClassAttributeInheritenceJob < ActiveJob::Base + # that's the correct behavior since we don't want to break + # the `class_attribute` inheritance + class TestClassAttributeInheritanceJob < ActiveJob::Base def self.queue_adapter=(*) - raise 'Attemping to break `class_attribute` inheritence, bad!' + raise 'Attemping to break `class_attribute` inheritance, bad!' end end |