zfben_rails_rake 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -2,21 +2,31 @@
2
2
 
3
3
  This is plugin to add some useful tasks to rails.
4
4
 
5
+ # has .git folder
5
6
  rake git:clear # Clear files in .gitignore
6
7
  rake git:commit[comment] # Git commit with your comment
7
8
  rake git:pull # Git pull
8
9
  rake git:push[comment] # Git push with your comment
9
10
 
11
+ # has unicorn.rb
10
12
  rake unicorn:restart # Hot restart unicorn server
11
13
  rake unicorn:start # Start unicorn server
12
14
  rake unicorn:stop # Stop unicorn server
13
15
 
16
+ # has config/mongoid.yml
14
17
  rake mongodb:backup # mongodump
15
18
  rake mongodb:clear # Clear mongo folder
16
19
  rake mongodb:restore # mongorestore
17
20
  rake mongodb:start # Start Mongodb
18
21
  rake mongodb:stop # Stop Mongodb
19
22
 
23
+ # has initializers/resque.rb
24
+ rake resque:clear # Clear Resque data
25
+ rake resque:debug # Start Resque for debug
26
+ rake resque:start # Start Resque daemon worker
27
+ rake resque:stop # Stop Resque worker
28
+ rake resque:web # Start Resque web interface
29
+
20
30
  == Getting Started
21
31
 
22
32
  1. adding gem to Gemfile
@@ -0,0 +1,44 @@
1
+ if File.exists?(ROOT + '/config/initializers/resque.rb')
2
+ namespace :resque do
3
+ desc 'Start Resque for debug'
4
+ task :debug => :environment do
5
+ require ROOT + '/config/initializers/resque.rb'
6
+ worker = Resque::Worker.new('*')
7
+ worker.work
8
+ end
9
+
10
+ desc 'Start Resque daemon worker'
11
+ task :start => 'resque:stop' do
12
+ RAILS_ENV = 'production'
13
+ Rake::Task[:environment].execute
14
+ work = fork do
15
+ worker = Resque::Worker.new('*')
16
+ Process.daemon true
17
+ File.open(ROOT + '/tmp/resque.pid', 'w') { |f| f << Process.pid.to_s }
18
+ worker.work
19
+ end
20
+ print "Resque worker running at #{work}\n"
21
+ end
22
+
23
+ desc 'Stop Resque worker'
24
+ task :stop do
25
+ path = ROOT + '/tmp/resque.pid'
26
+ if File.exists?(path)
27
+ sys "kill `cat #{path}`;rm #{path}"
28
+ end
29
+ end
30
+
31
+ desc 'Clear Resque data'
32
+ task :clear do
33
+ require ROOT + '/config/initializers/resque.rb'
34
+ Resque.redis.keys('*').each{ |k| Resque.redis.del k }
35
+ end
36
+
37
+ desc 'Start Resque web interface'
38
+ task :web do
39
+ require ROOT + '/config/initializers/resque.rb'
40
+ require 'resque/server'
41
+ Resque::Server.run!
42
+ end
43
+ end
44
+ end
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'zfben_rails_rake'
6
- s.version = '0.0.15'
6
+ s.version = '0.0.16'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ['Ben']
9
9
  s.email = ['ben@zfben.com']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zfben_rails_rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-28 00:00:00.000000000Z
12
+ date: 2011-11-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rainbow
16
- requirement: &21215700 !ruby/object:Gem::Requirement
16
+ requirement: &20644000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *21215700
24
+ version_requirements: *20644000
25
25
  description: ''
26
26
  email:
27
27
  - ben@zfben.com
@@ -39,6 +39,7 @@ files:
39
39
  - lib/zfben_rails_rake/helper.rb
40
40
  - lib/zfben_rails_rake/tasks/git.rb
41
41
  - lib/zfben_rails_rake/tasks/mongodb.rb
42
+ - lib/zfben_rails_rake/tasks/resque.rb
42
43
  - lib/zfben_rails_rake/tasks/unicorn.rb
43
44
  - zfben_rails_rake.gemspec
44
45
  homepage: https://github.com/benz303/zfben_rails_rake