zfben_rails_rake 0.0.21 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -14,11 +14,12 @@ This is plugin to add some useful tasks to rails.
14
14
  rake unicorn:stop # Stop unicorn server
15
15
 
16
16
  # has config/mongoid.yml
17
+ rake mongodb:start # Start Mongodb
18
+ rake mongodb:stop # Stop Mongodb
17
19
  rake mongodb:dump # mongodump
18
20
  rake mongodb:clear # Clear mongo folder
19
21
  rake mongodb:restore # mongorestore
20
- rake mongodb:start # Start Mongodb
21
- rake mongodb:stop # Stop Mongodb
22
+ rake mongodb:repair # Repair Mongodb
22
23
 
23
24
  # has initializers/resque.rb
24
25
  rake resque:clear # Clear Resque data
@@ -1,21 +1,11 @@
1
1
  if File.exist? Rails.root.join('config/mongoid.yml')
2
2
  namespace :mongodb do
3
3
  config = YAML.load(File.read(Rails.root.join('config/mongoid.yml')))
4
- backup = "mongodump --host #{config['production']['host']} --port #{config['production']['port']}"
5
- desc backup
6
- task :dump do
7
- zfben_rails_rake_system backup
8
- end
9
-
10
- restore = "mongorestore --host #{config['production']['host']} --port #{config['production']['port']}"
11
- desc restore
12
- task :restore do
13
- zfben_rails_rake_system restore
14
- end
15
4
 
16
5
  desc 'Start Mongodb'
17
6
  task :start do
18
7
  zfben_rails_rake_system "mkdir #{Rails.root}/mongo" unless File.exists?(Rails.root.join('mongo'))
8
+ zfben_rails_rake_system "mkdir #{Rails.root}/log" unless File.exists?(Rails.root.join('log'))
19
9
  zfben_rails_rake_system "mongod --nohttpinterface --nojournal --port #{config['production']['port']} --bind_ip #{config['production']['host']} --dbpath #{Rails.root}/mongo --fork --logpath #{Rails.root}/log/mongodb.log"
20
10
  end
21
11
 
@@ -32,5 +22,22 @@ if File.exist? Rails.root.join('config/mongoid.yml')
32
22
  task :clear do
33
23
  zfben_rails_rake_system 'rm -r mongo/*'
34
24
  end
25
+
26
+ backup = "mongodump --host #{config['production']['host']} --port #{config['production']['port']}"
27
+ desc backup
28
+ task :dump do
29
+ zfben_rails_rake_system backup
30
+ end
31
+
32
+ restore = "mongorestore --host #{config['production']['host']} --port #{config['production']['port']}"
33
+ desc restore
34
+ task :restore do
35
+ zfben_rails_rake_system restore
36
+ end
37
+
38
+ desc 'Repair Mongodb'
39
+ task :repair do
40
+ "mongod --nohttpinterface --nojournal --port #{config['production']['port']} --bind_ip #{config['production']['host']} --dbpath #{Rails.root}/mongo --repair"
41
+ end
35
42
  end
36
43
  end
@@ -8,6 +8,7 @@ if File.exists? Rails.root.join('unicorn.rb')
8
8
  cmd = 'unicorn_rails'
9
9
  end
10
10
  cmd << ' -c unicorn.rb -E production -D'
11
+ zfben_rails_rake_system 'mkdir tmp' unless File.exists? Rails.root.join('tmp')
11
12
  zfben_rails_rake_system cmd
12
13
  end
13
14
 
@@ -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.21'
6
+ s.version = '0.0.22'
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.21
4
+ version: 0.0.22
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: 2012-01-05 00:00:00.000000000 Z
12
+ date: 2012-04-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rainbow
16
- requirement: &14494240 !ruby/object:Gem::Requirement
16
+ requirement: &15759040 !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: *14494240
24
+ version_requirements: *15759040
25
25
  description: ''
26
26
  email:
27
27
  - ben@zfben.com