thincloud-resque 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +166 -0
  3. data/Rakefile +40 -0
  4. data/lib/tasks/thincloud-resque_tasks.rake +2 -0
  5. data/lib/thincloud-resque.rb +8 -0
  6. data/lib/thincloud/resque/capistrano.rb +27 -0
  7. data/lib/thincloud/resque/configuration.rb +36 -0
  8. data/lib/thincloud/resque/engine.rb +71 -0
  9. data/lib/thincloud/resque/resqueable.rb +24 -0
  10. data/lib/thincloud/resque/version.rb +5 -0
  11. data/test/ci/before_script.sh +2 -0
  12. data/test/ci/ci_runner.sh +8 -0
  13. data/test/dummy/README.rdoc +261 -0
  14. data/test/dummy/Rakefile +7 -0
  15. data/test/dummy/app/assets/javascripts/application.js +15 -0
  16. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  17. data/test/dummy/app/controllers/application_controller.rb +3 -0
  18. data/test/dummy/app/helpers/application_helper.rb +2 -0
  19. data/test/dummy/app/mailers/test_mailer.rb +3 -0
  20. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  21. data/test/dummy/config.ru +4 -0
  22. data/test/dummy/config/application.rb +65 -0
  23. data/test/dummy/config/boot.rb +10 -0
  24. data/test/dummy/config/database.yml +25 -0
  25. data/test/dummy/config/environment.rb +5 -0
  26. data/test/dummy/config/environments/development.rb +37 -0
  27. data/test/dummy/config/environments/production.rb +67 -0
  28. data/test/dummy/config/environments/test.rb +44 -0
  29. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  30. data/test/dummy/config/initializers/inflections.rb +15 -0
  31. data/test/dummy/config/initializers/mime_types.rb +5 -0
  32. data/test/dummy/config/initializers/secret_token.rb +7 -0
  33. data/test/dummy/config/initializers/session_store.rb +8 -0
  34. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  35. data/test/dummy/config/locales/en.yml +5 -0
  36. data/test/dummy/config/routes.rb +61 -0
  37. data/test/dummy/db/schema.rb +16 -0
  38. data/test/dummy/public/404.html +26 -0
  39. data/test/dummy/public/422.html +26 -0
  40. data/test/dummy/public/500.html +25 -0
  41. data/test/dummy/public/favicon.ico +0 -0
  42. data/test/dummy/script/rails +6 -0
  43. data/test/integration/thincloud/resque/configuration_test.rb +40 -0
  44. data/test/integration/thincloud/resque/resque_mailer_test.rb +24 -0
  45. data/test/integration/thincloud/resque/resque_test.rb +15 -0
  46. data/test/integration/thincloud/resque/resque_web_test.rb +21 -0
  47. data/test/minitest_helper.rb +25 -0
  48. data/test/thincloud-resque_test.rb +7 -0
  49. metadata +234 -0
@@ -0,0 +1,16 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 0) do
15
+
16
+ end
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,40 @@
1
+ require "minitest_helper"
2
+
3
+ module Thincloud
4
+ module Resque
5
+
6
+ describe "Configuration" do
7
+ let(:config) { Dummy::Application.config.thincloud.resque }
8
+
9
+ # defaults
10
+ it { config.must_be_kind_of Thincloud::Resque::Configuration }
11
+ it { config.redis_url.must_equal "unix:///tmp/redis.sock" }
12
+
13
+ if RUBY_ENGINE == "ruby"
14
+ it { config.redis_driver.must_equal "hiredis" }
15
+ else
16
+ it { config.redis_driver.must_equal "ruby" }
17
+ end
18
+
19
+ it { config.web_username.must_equal "thincloud-resque" }
20
+ it { config.web_password.must_equal "thincloud-resque" }
21
+ it { config.mailer_environments.must_equal [:test, :production] }
22
+
23
+ # changed in dummy app environments/test.rb
24
+ it { config.redis_namespace.must_equal "dummy_app_namespace" }
25
+
26
+ describe "with configure block" do
27
+ before do
28
+ Thincloud::Resque.configure do |c|
29
+ c.web_username = "webuser"
30
+ c.mailer_environments = [:staging]
31
+ end
32
+ end
33
+
34
+ it { config.web_username.must_equal "webuser" }
35
+ it { config.mailer_environments.must_include :staging }
36
+ end
37
+ end
38
+
39
+ end
40
+ end
@@ -0,0 +1,24 @@
1
+ require "minitest_helper"
2
+
3
+ module Thincloud
4
+ module Resque
5
+
6
+ describe "Resque Mailer" do
7
+ let(:mailer) { TestMailer }
8
+
9
+ it { mailer.must_respond_to :resque }
10
+ it { mailer.ancestors.must_include ::Resque::Mailer }
11
+
12
+ describe "inheritance" do
13
+ let(:ancestors) { mailer.ancestors }
14
+ let(:action_mailer) { ancestors.index ::ActionMailer::Base }
15
+ let(:resque_mailer) { ancestors.index ::Resque::Mailer }
16
+
17
+ it "must be after ActionMailer" do
18
+ action_mailer.must_be :>, resque_mailer
19
+ end
20
+ end
21
+ end
22
+
23
+ end
24
+ end
@@ -0,0 +1,15 @@
1
+ require "minitest_helper"
2
+
3
+ module Thincloud
4
+ module Resque
5
+
6
+ describe "Resque Test" do
7
+ let(:resque) { ::Resque }
8
+ let(:config) { Dummy::Application.config.thincloud.resque }
9
+
10
+ it { resque.redis.must_be_kind_of ::Redis::Namespace }
11
+ it { resque.redis.namespace.must_equal config.redis_namespace }
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,21 @@
1
+ require "minitest_helper"
2
+
3
+ module Thincloud
4
+ module Resque
5
+ class ResqueWebTest < MiniTest::Rails::ActionDispatch::IntegrationTest
6
+
7
+ test "resque web available at /resque" do
8
+ creds = ActionController::HttpAuthentication::Basic.encode_credentials(
9
+ "thincloud-resque",
10
+ "thincloud-resque"
11
+ )
12
+
13
+ get "/resque", nil, "HTTP_AUTHORIZATION" => creds
14
+
15
+ assert_response :redirect
16
+ assert_redirected_to "/resque/overview"
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ if RUBY_ENGINE == "ruby"
2
+ begin
3
+ require "simplecov"
4
+ SimpleCov.add_filter "test"
5
+ SimpleCov.add_filter "config"
6
+ SimpleCov.command_name "MiniTest"
7
+ SimpleCov.start
8
+ rescue LoadError
9
+ warn "unable to load SimpleCov"
10
+ end
11
+ end
12
+
13
+ ENV["RAILS_ENV"] = "test"
14
+
15
+ require File.expand_path("../dummy/config/environment", __FILE__)
16
+
17
+ require "minitest/autorun"
18
+ require "minitest/rails"
19
+ require "minitest/pride"
20
+ require "minitest-rails-shoulda"
21
+
22
+ Rails.backtrace_cleaner.remove_silencers!
23
+
24
+ # Load support files
25
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@@ -0,0 +1,7 @@
1
+ require 'minitest_helper'
2
+
3
+ class ThincloudResqueTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, Thincloud::Resque
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,234 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: thincloud-resque
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Don Morrison
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-11-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.8
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.8
30
+ - !ruby/object:Gem::Dependency
31
+ name: redis
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 3.0.1
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 3.0.1
46
+ - !ruby/object:Gem::Dependency
47
+ name: resque
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 1.23.0
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.23.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: resque-cleaner
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 0.2.9
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.2.9
78
+ - !ruby/object:Gem::Dependency
79
+ name: resque_mailer
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 2.1.0
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 2.1.0
94
+ - !ruby/object:Gem::Dependency
95
+ name: thincloud-test
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ description: Thincloud Resque is an extraction of the New Leaders resque recipes packaged
111
+ up as a Rails engine to manage dependencies and configuration.
112
+ email:
113
+ - dmorrison@newleaders.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - lib/tasks/thincloud-resque_tasks.rake
119
+ - lib/thincloud/resque/capistrano.rb
120
+ - lib/thincloud/resque/configuration.rb
121
+ - lib/thincloud/resque/engine.rb
122
+ - lib/thincloud/resque/resqueable.rb
123
+ - lib/thincloud/resque/version.rb
124
+ - lib/thincloud-resque.rb
125
+ - MIT-LICENSE
126
+ - Rakefile
127
+ - README.md
128
+ - test/ci/before_script.sh
129
+ - test/ci/ci_runner.sh
130
+ - test/dummy/app/assets/javascripts/application.js
131
+ - test/dummy/app/assets/stylesheets/application.css
132
+ - test/dummy/app/controllers/application_controller.rb
133
+ - test/dummy/app/helpers/application_helper.rb
134
+ - test/dummy/app/mailers/test_mailer.rb
135
+ - test/dummy/app/views/layouts/application.html.erb
136
+ - test/dummy/config/application.rb
137
+ - test/dummy/config/boot.rb
138
+ - test/dummy/config/database.yml
139
+ - test/dummy/config/environment.rb
140
+ - test/dummy/config/environments/development.rb
141
+ - test/dummy/config/environments/production.rb
142
+ - test/dummy/config/environments/test.rb
143
+ - test/dummy/config/initializers/backtrace_silencers.rb
144
+ - test/dummy/config/initializers/inflections.rb
145
+ - test/dummy/config/initializers/mime_types.rb
146
+ - test/dummy/config/initializers/secret_token.rb
147
+ - test/dummy/config/initializers/session_store.rb
148
+ - test/dummy/config/initializers/wrap_parameters.rb
149
+ - test/dummy/config/locales/en.yml
150
+ - test/dummy/config/routes.rb
151
+ - test/dummy/config.ru
152
+ - test/dummy/db/schema.rb
153
+ - test/dummy/public/404.html
154
+ - test/dummy/public/422.html
155
+ - test/dummy/public/500.html
156
+ - test/dummy/public/favicon.ico
157
+ - test/dummy/Rakefile
158
+ - test/dummy/README.rdoc
159
+ - test/dummy/script/rails
160
+ - test/integration/thincloud/resque/configuration_test.rb
161
+ - test/integration/thincloud/resque/resque_mailer_test.rb
162
+ - test/integration/thincloud/resque/resque_test.rb
163
+ - test/integration/thincloud/resque/resque_web_test.rb
164
+ - test/minitest_helper.rb
165
+ - test/thincloud-resque_test.rb
166
+ homepage: http://newleaders.github.com/thincloud-resque
167
+ licenses: []
168
+ post_install_message:
169
+ rdoc_options: []
170
+ require_paths:
171
+ - lib
172
+ required_ruby_version: !ruby/object:Gem::Requirement
173
+ none: false
174
+ requirements:
175
+ - - ! '>='
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ segments:
179
+ - 0
180
+ hash: -3922522443370155668
181
+ required_rubygems_version: !ruby/object:Gem::Requirement
182
+ none: false
183
+ requirements:
184
+ - - ! '>='
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ segments:
188
+ - 0
189
+ hash: -3922522443370155668
190
+ requirements: []
191
+ rubyforge_project:
192
+ rubygems_version: 1.8.24
193
+ signing_key:
194
+ specification_version: 3
195
+ summary: Rails Engine to provide resque services for Thincloud applications
196
+ test_files:
197
+ - test/ci/before_script.sh
198
+ - test/ci/ci_runner.sh
199
+ - test/dummy/app/assets/javascripts/application.js
200
+ - test/dummy/app/assets/stylesheets/application.css
201
+ - test/dummy/app/controllers/application_controller.rb
202
+ - test/dummy/app/helpers/application_helper.rb
203
+ - test/dummy/app/mailers/test_mailer.rb
204
+ - test/dummy/app/views/layouts/application.html.erb
205
+ - test/dummy/config/application.rb
206
+ - test/dummy/config/boot.rb
207
+ - test/dummy/config/database.yml
208
+ - test/dummy/config/environment.rb
209
+ - test/dummy/config/environments/development.rb
210
+ - test/dummy/config/environments/production.rb
211
+ - test/dummy/config/environments/test.rb
212
+ - test/dummy/config/initializers/backtrace_silencers.rb
213
+ - test/dummy/config/initializers/inflections.rb
214
+ - test/dummy/config/initializers/mime_types.rb
215
+ - test/dummy/config/initializers/secret_token.rb
216
+ - test/dummy/config/initializers/session_store.rb
217
+ - test/dummy/config/initializers/wrap_parameters.rb
218
+ - test/dummy/config/locales/en.yml
219
+ - test/dummy/config/routes.rb
220
+ - test/dummy/config.ru
221
+ - test/dummy/db/schema.rb
222
+ - test/dummy/public/404.html
223
+ - test/dummy/public/422.html
224
+ - test/dummy/public/500.html
225
+ - test/dummy/public/favicon.ico
226
+ - test/dummy/Rakefile
227
+ - test/dummy/README.rdoc
228
+ - test/dummy/script/rails
229
+ - test/integration/thincloud/resque/configuration_test.rb
230
+ - test/integration/thincloud/resque/resque_mailer_test.rb
231
+ - test/integration/thincloud/resque/resque_test.rb
232
+ - test/integration/thincloud/resque/resque_web_test.rb
233
+ - test/minitest_helper.rb
234
+ - test/thincloud-resque_test.rb