effective_developer 0.6.12 → 0.6.14

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
  SHA256:
3
- metadata.gz: 844b526090ef245bc157e80ba4d3a5e7af98e6e9cb5df20c6b0f18404f34be44
4
- data.tar.gz: b5e9934fceb5b1648efa59ed87fadadd1e19e19b5f350ac04e53631e1542e7e4
3
+ metadata.gz: dbd086f75e05dc03da801c3bf6bcb86b258f991abde5d978a3abb3d4da58a7c2
4
+ data.tar.gz: ca825d18e1e8a26aa322a7568077b289621740433f086d6ae8884c39c2878108
5
5
  SHA512:
6
- metadata.gz: a99fa228a455346d6d3079eda6ec2138a1e1dcb10023dd851740a1af68e97971393a0f5cff7a78f7c7dee745f3277543c10a71161de0d9c9c1b8e7df731b5f68
7
- data.tar.gz: cb1cd2a3ecaf14d8c1e63cb59cb7cb71752df6ed010fb0b745606c3c6eb86341af888ebaff4730ffc434816c4f5b66c1e584db719affff0f5119e2bd2f96a865
6
+ metadata.gz: fd6047921324421646b30036becf8121edeaa65131d16099396a73e24ae21cac26ad9e22804ec01b589a9cd481a4c58ee7a4e8c6de73d5525ea8afd7ad4bc59c
7
+ data.tar.gz: 7d878b2634da808b13f00fcd7d857ee0b649481108f0eb1104cc99ce04079d92a5483e879a623259d4791ed713356485d25fb1442fe7a8be0384381e4284dcd4
@@ -1,3 +1,3 @@
1
1
  module EffectiveDeveloper
2
- VERSION = '0.6.12'.freeze
2
+ VERSION = '0.6.14'.freeze
3
3
  end
@@ -130,10 +130,12 @@ namespace :pg do
130
130
 
131
131
  puts "=== Loading #{args.filename} into local '#{db[:database]}' database"
132
132
 
133
- if system("export PGPASSWORD=#{db[:password]}; pg_restore --no-acl --no-owner --clean --if-exists -h #{db[:host]} -U #{db[:username]} -d #{db[:database]} #{args.filename}")
134
- puts "Loading database completed"
133
+ command = "export PGPASSWORD=#{db[:password]}; pg_restore --no-acl --no-owner --clean --if-exists -h #{db[:host]} -U #{db[:username]} -d #{db[:database]} #{args.filename}"
134
+
135
+ if system(command)
136
+ puts "\nLoading database completed"
135
137
  else
136
- abort "Error loading database"
138
+ abort "\nLoading database completed with errors. It probably worked just fine."
137
139
  end
138
140
  end
139
141
 
@@ -146,7 +148,7 @@ namespace :pg do
146
148
  keywords = ARGV.map { |a| a.split('=') if a.include?('=') }.compact.inject({}) { |h, (k, v)| h[k.to_sym] = v; h }
147
149
  args.with_defaults(defaults.compact.merge(env_keys.compact).merge(keywords))
148
150
 
149
- db = if ENV['DATABASE_URL'].to_s.length > 0
151
+ db = if ENV['DATABASE_URL'].to_s.length > 0 && args.database.blank?
150
152
  uri = URI.parse(ENV['DATABASE_URL']) rescue nil
151
153
  abort("Invalid DATABASE_URL") unless uri.present?
152
154
 
@@ -183,7 +185,9 @@ namespace :pg do
183
185
 
184
186
  exclude_table_data = "--exclude-table-data=logs" unless (args.logs == 'true')
185
187
 
186
- if system("export PGPASSWORD=#{db[:password]}; pg_dump -Fc --no-acl --no-owner #{exclude_table_data} -h #{db[:host]} -p #{db[:port]} -U #{db[:username]} #{db[:database]} > #{args.filename}")
188
+ command = "export PGPASSWORD=#{db[:password]}; pg_dump -Fc --no-acl --no-owner #{exclude_table_data} -h #{db[:host]} -p #{db[:port]} -U #{db[:username]} #{db[:database]} > #{args.filename}"
189
+
190
+ if system(command)
187
191
  puts "Saving database completed"
188
192
  else
189
193
  abort "Error saving database"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_developer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.12
4
+ version: 0.6.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect