capistrano-resque-pool 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f771aa1d33f72689f13bdf3a7ae1e03386795c64
4
- data.tar.gz: 10c578c9873d04162252e0248b148ad15e8992ca
3
+ metadata.gz: f73cc8a2da3270261c3e005501b9ba6ab136cbd3
4
+ data.tar.gz: 68100579457c1da70704d14f79b23ffb2908fbee
5
5
  SHA512:
6
- metadata.gz: 007e3ebd7c81b6c0c144345020f97c9f9ca5d3f7173a98d8c23e718380fb319adf76a799bfb80efd2bbc8bb47e5163ef34fddcd8314c1963c6fe207400f03145
7
- data.tar.gz: 812fe4e027bcaeb48defc80e165eb2791e211faa139b86afbb06e0c8d91029cd1882eaa0ddb15f5786bda59d863184cac00e8447135476d15f93ebc9241de5cd
6
+ metadata.gz: 9f203a3671a2f1101baf05c370cedbd9a546e5539b4c93abb2a978a3a05b6f04cdf7319f16e879c48580fa7be3c9cb6b896eab5f7265c2aa2eaf240badb6cec9
7
+ data.tar.gz: 78bebe514803ca6cc092444b71bb2923418d94805ead33b01fd2e7a11a9ea77d33008bc7453204220b408334c48390ff3616df4611e992f792e36210a2c2695f
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Capistrano::Resque::Pool
2
2
 
3
- TODO: Write a gem description
3
+ Capistrano integration for `resque-pool`.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,7 +10,7 @@ Add this line to your application's Gemfile:
10
10
 
11
11
  And then execute:
12
12
 
13
- $ bundle
13
+ $ bundle install
14
14
 
15
15
  Or install it yourself as:
16
16
 
@@ -18,7 +18,22 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ Start all the workers and queus.
22
+
23
+ bundle exec cap production resque:pool:start
24
+
25
+ Gracefully shut down workers and shutdown the manager after all workers are done.
26
+
27
+ bundle exec cap production resque:pool:stop
28
+
29
+ Gracefully shut down workers and immediately shutdown manager.
30
+
31
+ bundle exec cap production resque:pool:stop_immediately
32
+
33
+ Reload the config file, reload logfiles, restart all workers.
34
+
35
+ bundle exec cap production resque:pool:restart
36
+
22
37
 
23
38
  ## Contributing
24
39
 
@@ -3,11 +3,11 @@ lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  # Maintain your gem's version:
6
- require 'capistrano-resque-pool/version'
6
+ require 'capistrano/resque/pool/version'
7
7
 
8
8
  Gem::Specification.new do |spec|
9
9
  spec.name = "capistrano-resque-pool"
10
- spec.version = CapistranoResquePool::VERSION
10
+ spec.version = Capistrano::Resque::Pool::VERSION
11
11
  spec.authors = ["Maxim Abramchuk", "Dmitry Zhlobo"]
12
12
  spec.email = ["maximabramchuck@gmail.com"]
13
13
  spec.summary = %q{Capistrano integration for Resque pool}
@@ -0,0 +1,3 @@
1
+ require "capistrano/resque/pool/version"
2
+
3
+ load File.expand_path("../capistrano/tasks/capistrano-resque-pool.rake", __FILE__)
@@ -0,0 +1,7 @@
1
+ module Capistrano
2
+ module Resque
3
+ module Pool
4
+ VERSION = '0.0.2'
5
+ end
6
+ end
7
+ end
@@ -1,10 +1,16 @@
1
1
  namespace :resque do
2
2
  namespace :pool do
3
+ def rails_env
4
+ fetch(:resque_rails_env) ||
5
+ fetch(:rails_env) || # capistrano-rails doesn't automatically set this (yet),
6
+ fetch(:stage) # so we need to fall back to the stage.
7
+ end
8
+
3
9
  desc 'Start all the workers and queus'
4
10
  task :start do
5
11
  on roles(workers) do
6
12
  within app_path do
7
- execute :bundle, :exec, 'resque-pool', "--daemon --environment production"
13
+ execute :bundle, :exec, 'resque-pool', "--daemon --environment #{rails_env}"
8
14
  end
9
15
  end
10
16
  end
@@ -26,7 +32,11 @@ namespace :resque do
26
32
  desc 'Reload the config file, reload logfiles, restart all workers'
27
33
  task :restart do
28
34
  on roles(workers) do
29
- execute :kill, "-s HUP `cat #{pid_path}`"
35
+ if test("[ -f #{pid_path} ]")
36
+ execute :kill, "-s HUP `cat #{pid_path}`"
37
+ else
38
+ invoke 'resque:pool:start'
39
+ end
30
40
  end
31
41
  end
32
42
 
@@ -42,4 +52,4 @@ namespace :resque do
42
52
  fetch(:resque_server_roles) || :app
43
53
  end
44
54
  end
45
- end
55
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-resque-pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxim Abramchuk
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-30 00:00:00.000000000 Z
12
+ date: 2016-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -80,8 +80,9 @@ files:
80
80
  - README.md
81
81
  - Rakefile
82
82
  - capistrano-resque-pool.gemspec
83
- - lib/capistrano-resque-pool/tasks/capistrano-resque-pool.rake
84
- - lib/capistrano-resque-pool/version.rb
83
+ - lib/capistrano-resque-pool.rb
84
+ - lib/capistrano/resque/pool/version.rb
85
+ - lib/capistrano/tasks/capistrano-resque-pool.rake
85
86
  homepage: https://github.com/datarockets/capistrano-resque-pool
86
87
  licenses:
87
88
  - MIT
@@ -102,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
103
  version: '0'
103
104
  requirements: []
104
105
  rubyforge_project:
105
- rubygems_version: 2.2.2
106
+ rubygems_version: 2.4.5.1
106
107
  signing_key:
107
108
  specification_version: 4
108
109
  summary: Capistrano integration for Resque pool
@@ -1,3 +0,0 @@
1
- module CapistranoResquePool
2
- VERSION = "0.0.1"
3
- end