activeasync 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -4
  3. data/.travis.yml +1 -1
  4. data/CHANGELOG.md +4 -0
  5. data/Gemfile +1 -1
  6. data/README.md +13 -10
  7. data/lib/active_async.rb +0 -1
  8. data/lib/active_async/version.rb +1 -1
  9. data/spec/{dummy → sample}/.gitignore +0 -0
  10. data/spec/{dummy → sample}/Rakefile +1 -1
  11. data/spec/{dummy → sample}/app/controllers/application_controller.rb +0 -0
  12. data/spec/{dummy → sample}/app/helpers/application_helper.rb +0 -0
  13. data/spec/{dummy → sample}/app/models/blog.rb +0 -0
  14. data/spec/{dummy → sample}/app/models/post.rb +0 -0
  15. data/spec/{dummy → sample}/app/views/layouts/application.html.erb +1 -1
  16. data/spec/{dummy → sample}/config.ru +1 -1
  17. data/spec/{dummy → sample}/config/application.rb +1 -1
  18. data/spec/{dummy → sample}/config/boot.rb +0 -0
  19. data/spec/{dummy → sample}/config/database.yml +0 -0
  20. data/spec/{dummy → sample}/config/environment.rb +1 -1
  21. data/spec/{dummy → sample}/config/environments/development.rb +1 -5
  22. data/spec/{dummy → sample}/config/environments/production.rb +1 -5
  23. data/spec/{dummy → sample}/config/environments/test.rb +1 -1
  24. data/spec/{dummy → sample}/config/initializers/backtrace_silencers.rb +0 -0
  25. data/spec/{dummy → sample}/config/initializers/inflections.rb +0 -0
  26. data/spec/{dummy → sample}/config/initializers/mime_types.rb +0 -0
  27. data/spec/{dummy → sample}/config/initializers/secret_token.rb +1 -1
  28. data/spec/{dummy → sample}/config/initializers/session_store.rb +2 -2
  29. data/spec/{dummy → sample}/config/initializers/wrap_parameters.rb +0 -0
  30. data/spec/{dummy → sample}/config/locales/en.yml +0 -0
  31. data/spec/{dummy → sample}/config/routes.rb +1 -1
  32. data/spec/{dummy → sample}/db/migrate/20120126234735_create_posts.rb +0 -0
  33. data/spec/{dummy → sample}/db/migrate/20120127010859_create_blogs.rb +0 -0
  34. data/spec/{dummy → sample}/db/schema.rb +10 -10
  35. data/spec/{dummy → sample}/db/seeds.rb +0 -0
  36. data/spec/{dummy → sample}/log/.gitkeep +0 -0
  37. data/spec/{dummy → sample}/script/rails +0 -0
  38. data/spec/spec_helper.rb +1 -1
  39. metadata +32 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3d66e146e6418c6e8c98c4f1a2331db9cdaee99
4
- data.tar.gz: 91ce2d461a08a6b0b31e0e735f086e010ae8d9e2
3
+ metadata.gz: cc8fe980596f76c145ade8133b3149133625821c
4
+ data.tar.gz: 550e7d47851975c692537d591d32e1ecb1324ab0
5
5
  SHA512:
6
- metadata.gz: 04e6193ff36b0341be92ef1103109ca6f4a9decdf8dec8b1a61ab1f8e7e0091c93c110a1428bd4d45c7d03f80b21f2fda195d5aabb76f18bdf41bec0e31f8a7f
7
- data.tar.gz: 9e424556d00138b83761ea6379ef3223ec08f2f8cede56a2c97d096db441a08d5a5cf587618aa947eeabeeeb86226f1f7b656e26d2f251c1f22b42bbe86dbeaa
6
+ metadata.gz: c7aa8d92df07e6c381d320cdbaa99b371f7d7ea68de80b541951d19b674a9b32732ee332eac70ca58abe5bed73fb724bda65cc0dad2720d29ea1da1b75c43ed9
7
+ data.tar.gz: 55b1780c47fc989132dc2033c1132e6fc59d3cb082845760c638ab3c91780a4630a01bb83c3ef7eae84db7289a28b7f3b13c3047a92b54708501b60adeeea3c0
data/.gitignore CHANGED
@@ -4,7 +4,7 @@ Gemfile.lock
4
4
  pkg/*
5
5
  .rspec
6
6
  log/*.log
7
- spec/dummy/db/*.sqlite3
8
- spec/dummy/log/*.log
9
- spec/dummy/tmp/
10
- tmp/
7
+ spec/sample/db/*.sqlite3
8
+ spec/sample/log/*.log
9
+ spec/sample/tmp/
10
+ tmp/
@@ -10,4 +10,4 @@ rvm:
10
10
  - 2.1.7
11
11
  - 2.2.3
12
12
 
13
- before_script: "sh -c 'cd spec/dummy && bundle exec rake db:migrate'"
13
+ before_script: "sh -c 'cd spec/sample && bundle exec rake db:migrate'"
@@ -1,3 +1,7 @@
1
+ ## 0.2.1 (2018-07-18)
2
+
3
+ * Don't break for sidekiq-only users
4
+
1
5
  ## 0.2.0 (2015-10-07)
2
6
 
3
7
  * BREAKING CHANGES: Support is dropped for Ruby 1.9.3. Please use Ruby 2.x.x
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ rails_version = ENV.fetch('RAILS_VERSION') { 'default' }
6
6
 
7
7
  case rails_version
8
8
  when "default"
9
- gem "rails", "~> 4.1.0"
9
+ gem "rails", "~> 4.2.0"
10
10
  else
11
11
  gem "rails", "~> #{rails_version}"
12
12
  end
data/README.md CHANGED
@@ -3,11 +3,7 @@
3
3
  ActiveAsync aims to provide an interface for easily setting up ActiveRecord objects
4
4
  and ruby classes to run methods asynchronously.
5
5
 
6
- ActiveAsync currently depends on Resque and ActiveSupport.
7
-
8
- Ruby support:
9
- - 1.9.3
10
- - 2.1 (coming soon)
6
+ ActiveAsync currently depends on ActiveSupport.
11
7
 
12
8
  [![Build Status](https://secure.travis-ci.org/challengepost/activeasync.png)](http://travis-ci.org/challengepost/activeasync)
13
9
 
@@ -25,11 +21,18 @@ Or via command line
25
21
 
26
22
  ## Usage
27
23
 
24
+ Configure one of the supported adapters: `:sidekiq`, `:resque`, or `:inline` (useful for testing synchronously).
25
+
26
+ ```ruby
27
+ # config/initializers/activeasync.rb
28
+ require "active_async"
29
+
30
+ ActiveAsync.queue_adapter = :sidekiq
31
+ ```
32
+
28
33
  Background class methods
29
34
 
30
35
  ``` ruby
31
- require 'active_async'
32
-
33
36
  class HeavyLifter
34
37
  include ActiveAsync::Async
35
38
 
@@ -70,7 +73,7 @@ late_nite = LateNite.last
70
73
  late_nite.save # runs late_night#drive_home asynchronously after save
71
74
  ```
72
75
 
73
- ## RSpec
76
+ ## Testing
74
77
 
75
78
  ActiveAsync comes with some helpers support for RSpec.
76
79
 
@@ -92,7 +95,7 @@ any similar module/class that responds to `#enqueue(*args)`:
92
95
 
93
96
  ``` ruby
94
97
  before do
95
- ActiveAsync.background = ActiveAsync::FakeResque
98
+ ActiveAsync.queue_adapter = :inline
96
99
  end
97
100
  ```
98
101
 
@@ -103,4 +106,4 @@ To contribute to activeasync, clone the project and submit pull requests in a br
103
106
  To run tests, install the bundle and migrate the test database:
104
107
 
105
108
  $ bundle
106
- $ cd spec/dummy && bundle exec rake db:migrate db:test:prepare
109
+ $ cd spec/sample && bundle exec rake db:migrate db:test:prepare
@@ -1,4 +1,3 @@
1
- require "resque"
2
1
  require "active_support/concern"
3
2
  require "active_async/version"
4
3
  require "active_async/async"
@@ -1,3 +1,3 @@
1
1
  module ActiveAsync
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
File without changes
@@ -4,4 +4,4 @@
4
4
 
5
5
  require File.expand_path('../config/application', __FILE__)
6
6
 
7
- Dummy::Application.load_tasks
7
+ Sample::Application.load_tasks
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>Dummy</title>
4
+ <title>Sample</title>
5
5
  <%= stylesheet_link_tag "application", :media => "all" %>
6
6
  <%= javascript_include_tag "application" %>
7
7
  <%= csrf_meta_tags %>
@@ -1,4 +1,4 @@
1
1
  # This file is used by Rack-based servers to start the application.
2
2
 
3
3
  require ::File.expand_path('../config/environment', __FILE__)
4
- run Dummy::Application
4
+ run Sample::Application
@@ -17,7 +17,7 @@ if defined?(Bundler)
17
17
  # Bundler.require(:default, :assets, Rails.env)
18
18
  end
19
19
 
20
- module Dummy
20
+ module Sample
21
21
  class Application < Rails::Application
22
22
  # Settings in config/environments/* take precedence over those specified here.
23
23
  # Application configuration should go into files in config/initializers
File without changes
@@ -2,4 +2,4 @@
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
4
  # Initialize the rails application
5
- Dummy::Application.initialize!
5
+ Sample::Application.initialize!
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ Sample::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -25,8 +25,4 @@ Dummy::Application.configure do
25
25
  # Raise exception on mass assignment protection for Active Record models
26
26
  # config.active_record.mass_assignment_sanitizer = :strict
27
27
 
28
- # Log the query plan for queries taking more than this (works
29
- # with SQLite, MySQL, and PostgreSQL)
30
- config.active_record.auto_explain_threshold_in_seconds = 0.5
31
-
32
28
  end
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ Sample::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
4
  # Code is not reloaded between requests
@@ -47,8 +47,4 @@ Dummy::Application.configure do
47
47
 
48
48
  # Send deprecation notices to registered listeners
49
49
  config.active_support.deprecation = :notify
50
-
51
- # Log the query plan for queries taking more than this (works
52
- # with SQLite, MySQL, and PostgreSQL)
53
- # config.active_record.auto_explain_threshold_in_seconds = 0.5
54
50
  end
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ Sample::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
4
  # The test environment is used exclusively to run your application's
@@ -4,4 +4,4 @@
4
4
  # If you change this key, all old signed cookies will become invalid!
5
5
  # Make sure the secret is at least 30 characters and all random,
6
6
  # no regular words or you'll be exposed to dictionary attacks.
7
- Dummy::Application.config.secret_token = '9a86b43614a6c40a1f6b3a522847e22892e488a22be718466e13ab08723e47c6f5e33a80e7d0ed89464ab41c148bc54027dcea264ef1fd4aba994a76df4162a0'
7
+ Sample::Application.config.secret_token = '9a86b43614a6c40a1f6b3a522847e22892e488a22be718466e13ab08723e47c6f5e33a80e7d0ed89464ab41c148bc54027dcea264ef1fd4aba994a76df4162a0'
@@ -1,8 +1,8 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
3
+ Sample::Application.config.session_store :cookie_store, :key => '_sample_session'
4
4
 
5
5
  # Use the database for sessions instead of the cookie-based default,
6
6
  # which shouldn't be used to store highly confidential information
7
7
  # (create the session table with "rails generate session_migration")
8
- # Dummy::Application.config.session_store :active_record_store
8
+ # Sample::Application.config.session_store :active_record_store
@@ -1,4 +1,4 @@
1
- Dummy::Application.routes.draw do
1
+ Sample::Application.routes.draw do
2
2
  # The priority is based upon order of creation:
3
3
  # first created -> highest priority.
4
4
 
@@ -9,21 +9,21 @@
9
9
  # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
10
  # you'll amass, the slower it'll run and the greater likelihood for issues).
11
11
  #
12
- # It's strongly recommended to check this file into your version control system.
12
+ # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20120127010859) do
14
+ ActiveRecord::Schema.define(version: 20120127010859) do
15
15
 
16
- create_table "blogs", :force => true do |t|
17
- t.string "title"
18
- t.datetime "created_at", :null => false
19
- t.datetime "updated_at", :null => false
16
+ create_table "blogs", force: :cascade do |t|
17
+ t.string "title", limit: 255
18
+ t.datetime "created_at"
19
+ t.datetime "updated_at"
20
20
  end
21
21
 
22
- create_table "posts", :force => true do |t|
23
- t.string "title"
22
+ create_table "posts", force: :cascade do |t|
23
+ t.string "title", limit: 255
24
24
  t.text "body"
25
- t.datetime "created_at", :null => false
26
- t.datetime "updated_at", :null => false
25
+ t.datetime "created_at"
26
+ t.datetime "updated_at"
27
27
  end
28
28
 
29
29
  end
File without changes
File without changes
File without changes
@@ -10,7 +10,7 @@ require 'resque'
10
10
  require 'sidekiq'
11
11
  require 'sidekiq/testing'
12
12
 
13
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
13
+ require File.expand_path("../sample/config/environment.rb", __FILE__)
14
14
 
15
15
  # Load support files
16
16
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeasync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Kaffenberger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-07 00:00:00.000000000 Z
11
+ date: 2018-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -153,35 +153,35 @@ files:
153
153
  - spec/active_async/async_spec.rb
154
154
  - spec/active_async/callbacks_spec.rb
155
155
  - spec/active_async_spec.rb
156
- - spec/dummy/.gitignore
157
- - spec/dummy/Rakefile
158
- - spec/dummy/app/controllers/application_controller.rb
159
- - spec/dummy/app/helpers/application_helper.rb
160
- - spec/dummy/app/models/blog.rb
161
- - spec/dummy/app/models/post.rb
162
- - spec/dummy/app/views/layouts/application.html.erb
163
- - spec/dummy/config.ru
164
- - spec/dummy/config/application.rb
165
- - spec/dummy/config/boot.rb
166
- - spec/dummy/config/database.yml
167
- - spec/dummy/config/environment.rb
168
- - spec/dummy/config/environments/development.rb
169
- - spec/dummy/config/environments/production.rb
170
- - spec/dummy/config/environments/test.rb
171
- - spec/dummy/config/initializers/backtrace_silencers.rb
172
- - spec/dummy/config/initializers/inflections.rb
173
- - spec/dummy/config/initializers/mime_types.rb
174
- - spec/dummy/config/initializers/secret_token.rb
175
- - spec/dummy/config/initializers/session_store.rb
176
- - spec/dummy/config/initializers/wrap_parameters.rb
177
- - spec/dummy/config/locales/en.yml
178
- - spec/dummy/config/routes.rb
179
- - spec/dummy/db/migrate/20120126234735_create_posts.rb
180
- - spec/dummy/db/migrate/20120127010859_create_blogs.rb
181
- - spec/dummy/db/schema.rb
182
- - spec/dummy/db/seeds.rb
183
- - spec/dummy/log/.gitkeep
184
- - spec/dummy/script/rails
156
+ - spec/sample/.gitignore
157
+ - spec/sample/Rakefile
158
+ - spec/sample/app/controllers/application_controller.rb
159
+ - spec/sample/app/helpers/application_helper.rb
160
+ - spec/sample/app/models/blog.rb
161
+ - spec/sample/app/models/post.rb
162
+ - spec/sample/app/views/layouts/application.html.erb
163
+ - spec/sample/config.ru
164
+ - spec/sample/config/application.rb
165
+ - spec/sample/config/boot.rb
166
+ - spec/sample/config/database.yml
167
+ - spec/sample/config/environment.rb
168
+ - spec/sample/config/environments/development.rb
169
+ - spec/sample/config/environments/production.rb
170
+ - spec/sample/config/environments/test.rb
171
+ - spec/sample/config/initializers/backtrace_silencers.rb
172
+ - spec/sample/config/initializers/inflections.rb
173
+ - spec/sample/config/initializers/mime_types.rb
174
+ - spec/sample/config/initializers/secret_token.rb
175
+ - spec/sample/config/initializers/session_store.rb
176
+ - spec/sample/config/initializers/wrap_parameters.rb
177
+ - spec/sample/config/locales/en.yml
178
+ - spec/sample/config/routes.rb
179
+ - spec/sample/db/migrate/20120126234735_create_posts.rb
180
+ - spec/sample/db/migrate/20120127010859_create_blogs.rb
181
+ - spec/sample/db/schema.rb
182
+ - spec/sample/db/seeds.rb
183
+ - spec/sample/log/.gitkeep
184
+ - spec/sample/script/rails
185
185
  - spec/spec_helper.rb
186
186
  homepage: ''
187
187
  licenses: []
@@ -202,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  version: '0'
203
203
  requirements: []
204
204
  rubyforge_project: activeasync
205
- rubygems_version: 2.4.5
205
+ rubygems_version: 2.6.11
206
206
  signing_key:
207
207
  specification_version: 4
208
208
  summary: Add async support to ruby objects