capistrano3-delayed-job 1.0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fd898a2c65a8b55b2a490c7b283c014ac9102b70
4
+ data.tar.gz: 7ae3563d450af6d46bffcaeab1c214b056ec4803
5
+ SHA512:
6
+ metadata.gz: f9c51a3b08ccd9fb1c670c6f990ea7f06f5f794dbe81c3ce3871d9d8b16b1db1f251996998dc8f23024663469bbde4d95208027931351cf7f39f233ab1dcd0b3
7
+ data.tar.gz: 7af954d575c312cc6e3ccb89125f43f284ab2e20de1b63be6c61cd1a386013e5b2424f9d75445ac76ba4cee3678c5308390d08f0af484d873f6b64776782fd1f
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ pkg/
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Juan Ignacio Donoso
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # Capistrano::DelayedJob [![Gem Version](https://badge.fury.io/rb/capistrano3-delayed-job.png)](http://badge.fury.io/rb/capistrano3-delayed-job)
2
+
3
+ Delayed Job support for Capistrano 3.x
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'capistrano3-delayed-job', '~> 1.0'
10
+ gem 'capistrano'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install capistrano3-delayed-job
19
+
20
+ ## Usage
21
+
22
+ Require in `Capfile` to use the default task:
23
+
24
+ ```ruby
25
+ require 'capistrano/delayed-job'
26
+ ```
27
+
28
+ You will get the following tasks
29
+
30
+ ```ruby
31
+ cap delayed_job:start # Start delayed_job service
32
+ cap delayed_job:stop # Stop delayed_job service
33
+ cap delayed_job:reload # Reload delayed_job service
34
+ ```
35
+
36
+ Configurable options (copy into deploy.rb), shown here with examples:
37
+
38
+ ```ruby
39
+ # Number of delayed_job workers
40
+ # default value: 1
41
+ set :delayed_job_workers, 2
42
+
43
+ # Delayed_job queue or queues
44
+ # Set the --queue or --queues option to work from a particular queue.
45
+ # default value: nil
46
+ set :delayed_job_queues, ['mailer','tracking']
47
+
48
+ # Specify different pools
49
+ # You can use this option multiple times to start different numbers of workers for different queues.
50
+ # default value: nil
51
+ set :delayed_job_pool, {
52
+ :mailer => 2,
53
+ :tracking => 1,
54
+ :* => 2
55
+ }
56
+
57
+ # Set the roles where the delayed_job process should be started
58
+ # default value: :app
59
+ set :delayed_job_roles, [:app, :background]
60
+ ```
61
+
62
+ It also adds the following hook
63
+
64
+ ```ruby
65
+ after 'deploy:publishing', 'restart' do
66
+ invoke 'delayed_job:restart'
67
+ end
68
+ ```
69
+
70
+ ## Contributing
71
+
72
+ 1. Fork it
73
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
74
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
75
+ 4. Push to the branch (`git push origin my-new-feature`)
76
+ 5. Create new Pull Request
77
+
78
+ ## Credits
79
+
80
+ Thank you [contributors](https://github.com/platanus/guides/graphs/contributors)!
81
+
82
+ <img src="http://platan.us/gravatar_with_text.png" alt="Platanus" width="250"/>
83
+
84
+ capistrano3-delayed-job is maintained by [platanus](http://platan.us).
85
+
86
+ ## License
87
+
88
+ Guides is © 2014 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.
89
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "capistrano3-delayed-job"
7
+ spec.version = "1.0.1"
8
+ spec.authors = ["Juan Ignacio Donoso", "Agustin Feuerhake", "Ignacio Baixas"]
9
+ spec.email = ["juan.ignacio@platan.us", "agustin@platan.us", "ignacio@platanus"]
10
+ spec.summary = %q{Adds support for delayed_jobs to Capistrano 3.x}
11
+ spec.description = %q{Adds support for delayed_jobs to Capistrano 3.x}
12
+ spec.homepage = ""
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency 'capistrano', '>= 3.0.0'
21
+
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/delayed-job.rake', __FILE__)
@@ -0,0 +1,61 @@
1
+ namespace :delayed_job do
2
+
3
+ def args
4
+ args = ""
5
+ args += "-n #{fetch(:delayed_job_workers)}" unless fetch(:delayed_job_workers).nil?
6
+ args += "--queues=#{fetch(:delayed_job_queues).join(',')}" unless fetch(:delayed_job_queues).nil?
7
+ args += fetch(:delayed_job_pool).map {|k,v| "--pool=#{k}:#{v}"}.join(' ') unless fetch(:delayed_job_pool).nil?
8
+ args
9
+ end
10
+
11
+ def delayed_job_roles
12
+ fetch(:delayed_job_roles)
13
+ end
14
+
15
+ desc 'Stop the delayed_job process'
16
+ task :stop do
17
+ on roles(delayed_job_roles) do
18
+ within release_path do
19
+ with rails_env: fetch(:rails_env) do
20
+ execute :bundle, :exec, :'script/delayed_job', :stop
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ desc 'Start the delayed_job process'
27
+ task :start do
28
+ on roles(delayed_job_roles) do
29
+ within release_path do
30
+ with rails_env: fetch(:rails_env) do
31
+ execute :bundle, :exec, :'script/delayed_job', args, :start
32
+ end
33
+ end
34
+ end
35
+ end
36
+
37
+ desc 'Restart the delayed_job process'
38
+ task :restart do
39
+ on roles(delayed_job_roles) do
40
+ within release_path do
41
+ with rails_env: fetch(:rails_env) do
42
+ execute :bundle, :exec, :'script/delayed_job', args, :restart
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ after 'deploy:publishing', 'restart' do
49
+ invoke 'delayed_job:restart'
50
+ end
51
+
52
+ end
53
+
54
+ namespace :load do
55
+ task :defaults do
56
+ set :delayed_job_workers, 1
57
+ set :delayed_job_queues, nil
58
+ set :delayed_job_pool, nil
59
+ set :delayed_job_roles, :app
60
+ end
61
+ end
File without changes
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano3-delayed-job
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Juan Ignacio Donoso
8
+ - Agustin Feuerhake
9
+ - Ignacio Baixas
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2014-12-13 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: capistrano
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 3.0.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - '>='
27
+ - !ruby/object:Gem::Version
28
+ version: 3.0.0
29
+ - !ruby/object:Gem::Dependency
30
+ name: rake
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ~>
34
+ - !ruby/object:Gem::Version
35
+ version: '10.0'
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ version: '10.0'
43
+ description: Adds support for delayed_jobs to Capistrano 3.x
44
+ email:
45
+ - juan.ignacio@platan.us
46
+ - agustin@platan.us
47
+ - ignacio@platanus
48
+ executables: []
49
+ extensions: []
50
+ extra_rdoc_files: []
51
+ files:
52
+ - .gitignore
53
+ - Gemfile
54
+ - LICENSE.txt
55
+ - README.md
56
+ - Rakefile
57
+ - capistrano3-delayed-job.gemspec
58
+ - lib/capistrano/delayed-job.rb
59
+ - lib/capistrano/tasks/delayed-job.rake
60
+ - lib/capistrano3-delayed-job.rb
61
+ homepage: ''
62
+ licenses:
63
+ - MIT
64
+ metadata: {}
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 2.0.14
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: Adds support for delayed_jobs to Capistrano 3.x
85
+ test_files: []