production_chain 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,13 +30,24 @@ private
30
30
  # result.strip!
31
31
  config_file = YAML::load(ERB.new(result).result)
32
32
  type = filename == "mongoid" ? "mongodb" : config_file[Rails.env]['adapter']
33
- return [
34
- type,
35
- config_file[Rails.env]['database'],
36
- config_file[Rails.env]['username'],
37
- config_file[Rails.env]['password'],
38
- config_file[Rails.env]['host'] || "127.0.0.1"
39
- ]
33
+ if type == "mongodb" && config_file[Rails.env]["sessions"].present?
34
+ # mongoid 3
35
+ return [
36
+ type,
37
+ config_file[Rails.env]['sessions']['default']['database'],
38
+ config_file[Rails.env]['sessions']['default']['username'],
39
+ config_file[Rails.env]['sessions']['default']['password'],
40
+ config_file[Rails.env]['sessions']['default']['hosts'].first || "127.0.0.1"
41
+ ]
42
+ else
43
+ return [
44
+ type,
45
+ config_file[Rails.env]['database'],
46
+ config_file[Rails.env]['username'],
47
+ config_file[Rails.env]['password'],
48
+ config_file[Rails.env]['host'] || "127.0.0.1"
49
+ ]
50
+ end
40
51
  end
41
52
 
42
53
  def archive_name
@@ -110,7 +121,7 @@ private
110
121
 
111
122
  def restore_mongodb_database database, user, password, host
112
123
  cmd = "rm -rf dump/ 2>/dev/null && tar xvzf #{archive_name}"
113
- cmd += " && /usr/bin/env mongorestore --drop -h #{host} -d #{database} --dir dump/*_*"
124
+ cmd += " && /usr/bin/env mongorestore --drop -h #{host} -d #{database} --dir dump/*"
114
125
  if user.blank?
115
126
  puts cmd
116
127
  else
@@ -1,3 +1,3 @@
1
1
  module ProductionChain
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
metadata CHANGED
@@ -1,33 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: production_chain
3
- version: !ruby/object:Gem::Version
4
- hash: 19
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.7
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 6
10
- version: 0.0.6
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Novelys
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-08-22 00:00:00 Z
12
+ date: 2013-02-25 00:00:00.000000000 Z
19
13
  dependencies: []
20
-
21
14
  description: A rails plugin that incorporate various libs, recipes and tasks
22
- email:
15
+ email:
23
16
  - contact@novelys.com
24
17
  executables: []
25
-
26
18
  extensions: []
27
-
28
19
  extra_rdoc_files: []
29
-
30
- files:
20
+ files:
31
21
  - .gitignore
32
22
  - README.md
33
23
  - lib/production_chain.rb
@@ -50,38 +40,26 @@ files:
50
40
  - rails/init.rb
51
41
  homepage: http://github.com/novelys/production_chain
52
42
  licenses: []
53
-
54
43
  post_install_message:
55
44
  rdoc_options: []
56
-
57
- require_paths:
45
+ require_paths:
58
46
  - lib
59
- required_ruby_version: !ruby/object:Gem::Requirement
47
+ required_ruby_version: !ruby/object:Gem::Requirement
60
48
  none: false
61
- requirements:
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- hash: 3
65
- segments:
66
- - 0
67
- version: "0"
68
- required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
54
  none: false
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- hash: 23
74
- segments:
75
- - 1
76
- - 3
77
- - 6
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
78
58
  version: 1.3.6
79
59
  requirements: []
80
-
81
60
  rubyforge_project: production_chain
82
- rubygems_version: 1.8.19
61
+ rubygems_version: 1.8.23
83
62
  signing_key:
84
63
  specification_version: 3
85
64
  summary: Production Chain
86
65
  test_files: []
87
-