capistrano3-postgres 0.1.1 → 0.1.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: 5cadbc1ab83d70005145bf3b402d00603b09ec44
4
- data.tar.gz: e93cb5ec0d64c3a76ce6d0f62ac8651f0275e85b
3
+ metadata.gz: 98eadadd989d6092c76aee573e1307d96af1ed9a
4
+ data.tar.gz: 46ab9e6a5d382febadc2a6267c63a5b8d626b9bd
5
5
  SHA512:
6
- metadata.gz: 1d68b4d312738cb1c84e1789b4f7c267f744434789714eebb93324ee5660d469a42eac0ed462743186b8c1060f1ff75e4c5aea7d499345ee4bd04121ac2ed159
7
- data.tar.gz: f0a7127c3de88976231a06800a0c61f73608cdecf1ba421648553dbf6b13aab680036d06675148a13a6957b68ab2e3e3c95662a8b7901985e91c792fe70ff004
6
+ metadata.gz: a22da966f93180428de06d40cc73747bff99dd31f57c3e48e89fc5b8d2cceeda5a3b51b89716ea341c9c1284eb54d506f6e77aec9f5c7d1bc7199aeececd3b22
7
+ data.tar.gz: 70a4e5e92d5268b3fa3c70727bd2917e6e964c1b0ecb8e3e14cae1161f6cb2c6806324f83ba4131646d1c0a6c9c8d18915914ff0ce062f48a83e2f2420f5ae39
@@ -1,5 +1,5 @@
1
1
  module Capistrano3
2
2
  module Postgres
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -137,10 +137,13 @@ namespace :postgres do
137
137
  def grab_remote_database_config
138
138
  return if fetch(:postgres_remote_database_config)
139
139
  on roles(fetch(:postgres_role)) do |role|
140
- env = fetch(:postgres_env).to_s.downcase
141
- filename = "#{deploy_to}/current/config/database.yml"
142
- yaml_content = capture "ruby -e \"require 'erb'; puts ERB.new(File.read('#{filename}')).result\""
143
- set :postgres_remote_database_config, database_config_defaults.merge(YAML::load(yaml_content)[env])
140
+ within release_path do
141
+ env = fetch(:postgres_env).to_s.downcase
142
+ filename = "#{deploy_to}/current/config/database.yml"
143
+ capture_config_cmd = "ruby -e \"require 'erb'; puts ERB.new(File.read('#{filename}')).result\""
144
+ yaml_content = test('ruby -v') ? capture(capture_config_cmd) : capture(:bundle, :exec, capture_config_cmd)
145
+ set :postgres_remote_database_config, database_config_defaults.merge(YAML::load(yaml_content)[env])
146
+ end
144
147
  end
145
148
  end
146
149
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano3-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Krasynskyi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-22 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano