zfben_rails_rake 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,14 @@
1
1
  if File.exist? Rails.root.join('config/mongoid.yml')
2
2
  namespace :mongodb do
3
- config = YAML.load(File.read(Rails.root.join('config/mongoid.yml')))
3
+ config = YAML.load(File.read(Rails.root.join('config/mongoid.yml')))[Rails.env.to_s]['sessions']['default']['hosts'][0]
4
+ host = config.split(':')[0]
5
+ port = config.split(':')[1]
4
6
 
5
7
  desc 'Start Mongodb'
6
8
  task :start do
7
9
  zfben_rails_rake_system "mkdir #{Rails.root}/mongo" unless File.exists?(Rails.root.join('mongo'))
8
10
  zfben_rails_rake_system "mkdir #{Rails.root}/log" unless File.exists?(Rails.root.join('log'))
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"
11
+ zfben_rails_rake_system "mongod --nohttpinterface --nojournal --port #{port} --bind_ip #{host} --dbpath #{Rails.root}/mongo --fork --logpath #{Rails.root}/log/mongodb.log"
10
12
  end
11
13
 
12
14
  desc 'Stop Mongodb'
@@ -23,13 +25,13 @@ if File.exist? Rails.root.join('config/mongoid.yml')
23
25
  zfben_rails_rake_system 'rm -r mongo/*'
24
26
  end
25
27
 
26
- backup = "mongodump --host #{config['production']['host']} --port #{config['production']['port']}"
28
+ backup = "mongodump --host #{host} --port #{port}"
27
29
  desc backup
28
30
  task :dump do
29
31
  zfben_rails_rake_system backup
30
32
  end
31
33
 
32
- restore = "mongorestore --host #{config['production']['host']} --port #{config['production']['port']}"
34
+ restore = "mongorestore --host #{host} --port #{port}"
33
35
  desc restore
34
36
  task :restore do
35
37
  zfben_rails_rake_system restore
@@ -37,7 +39,7 @@ if File.exist? Rails.root.join('config/mongoid.yml')
37
39
 
38
40
  desc 'Repair Mongodb'
39
41
  task :repair do
40
- "mongod --nohttpinterface --nojournal --port #{config['production']['port']} --bind_ip #{config['production']['host']} --dbpath #{Rails.root}/mongo --repair"
42
+ "mongod --nohttpinterface --nojournal --port #{port} --bind_ip #{host} --dbpath #{Rails.root}/mongo --repair"
41
43
  end
42
44
  end
43
45
  end
@@ -3,21 +3,13 @@ $:.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.22'
6
+ s.version = '0.0.23'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ['Ben']
9
9
  s.email = ['ben@zfben.com']
10
10
  s.homepage = 'https://github.com/benz303/zfben_rails_rake'
11
11
  s.summary = %q{}
12
12
  s.description = %q{}
13
-
14
- s.post_install_message =%q{********************************************************************************
15
- Thank you for using zfben_rails_rake!
16
-
17
- Please follow @zfben on Twitter for announcements, updates, and news.
18
- https://twitter.com/zfben
19
- ********************************************************************************
20
- }
21
13
 
22
14
  s.files = `git ls-files`.split("\n")
23
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
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.22
4
+ version: 0.0.23
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-04-02 00:00:00.000000000 Z
12
+ date: 2012-11-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rainbow
16
- requirement: &15759040 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,12 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *15759040
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  description: ''
26
31
  email:
27
32
  - ben@zfben.com
@@ -42,9 +47,7 @@ files:
42
47
  - zfben_rails_rake.gemspec
43
48
  homepage: https://github.com/benz303/zfben_rails_rake
44
49
  licenses: []
45
- post_install_message: ! "********************************************************************************\n
46
- \ Thank you for using zfben_rails_rake!\n \n Please follow @zfben on Twitter for
47
- announcements, updates, and news.\n https://twitter.com/zfben\n********************************************************************************\n"
50
+ post_install_message:
48
51
  rdoc_options: []
49
52
  require_paths:
50
53
  - lib
@@ -62,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
65
  version: '0'
63
66
  requirements: []
64
67
  rubyforge_project:
65
- rubygems_version: 1.8.10
68
+ rubygems_version: 1.8.24
66
69
  signing_key:
67
70
  specification_version: 3
68
71
  summary: ''