effective_developer 0.8.1 → 0.8.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
  SHA256:
3
- metadata.gz: 697f11999987598f2f2bfdaf262d5f0e4a4ce5c657bc6d1867dc5a63cccc9c0f
4
- data.tar.gz: 48aeba6c84b1c56f35c7a3878735c792b8bf4d5aeaa44cd28e07ffd474191b15
3
+ metadata.gz: 0f683ab9dcda556c93330af2e81a50c584768c8f0464c1124a6d0af2a9eadf99
4
+ data.tar.gz: 2935dd2fef5e23e7a8470e436f1c7e613c561b556737f6c741273276b1372c5a
5
5
  SHA512:
6
- metadata.gz: 7f4ac0c900f8ea8435b763d275aacb8a1a9319a94165af6b7022fdbac6476643fbd294a36a991e67f1afd36e5bca2e21207a3604f75c5c77c82c859026a7e285
7
- data.tar.gz: fe6b625cac2d782ceb3b57602ae0f88622a7694557953ac2a1ad47ca2affadb6045964cd0faeff196492d77bc6ddafa419e492ac8da821fb7b4e864e7c63f046
6
+ metadata.gz: 706e83a7ed877f3fd686ca4b251db6dc68d393c89401e7266b2f3bfea9cec0c7d8364deda7f1dc3ba393d9f7edec3ec59c2a4d44d2a53e44e443993b5d9e67e9
7
+ data.tar.gz: 639e094e77930330bbd6bc2695b058bea2ddf2333b7b74cfc115be8afadd6f454626b13f77060d8dbb0f0b540ea71bce83953154588e5a7b58e4519045bb8be0
@@ -1,3 +1,3 @@
1
1
  module EffectiveDeveloper
2
- VERSION = '0.8.1'.freeze
2
+ VERSION = '0.8.2'.freeze
3
3
  end
@@ -14,8 +14,8 @@ namespace :pg do
14
14
  # DATABASE=example bundle exec rake pg:load
15
15
  desc 'Creates a new backup on remote server and downloads it to latest.dump'
16
16
  task :pull, [:remote] => :environment do |t, args|
17
- defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump' }
18
- env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS'] }
17
+ defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump', logs: 'false' }
18
+ env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS'].to_s.presence }
19
19
  keywords = ARGV.map { |a| a.split('=') if a.include?('=') }.compact.inject({}) { |h, (k, v)| h[k.to_sym] = v; h }
20
20
  args.with_defaults(defaults.compact.merge(env_keys.compact).merge(keywords))
21
21
 
@@ -59,7 +59,7 @@ namespace :pg do
59
59
  user: ENV['HATCHBOX_USER'] || 'deploy'
60
60
  )
61
61
 
62
- puts "=== Pulling hatchbox '#{args.remote}' #{args.app} #{args.database} database into #{args.filename}"
62
+ puts "=== Pulling hatchbox '#{args.remote}' #{args.app} #{args.database} database into #{args.filename} with#{'out' unless args.logs.to_s == 'true'} logs"
63
63
 
64
64
  # SSH into hatchbox and call rake pg:save there to create latest.dump
65
65
  unless(result = `ssh -T #{args.user}@#{args.remote} << EOF
@@ -143,8 +143,8 @@ namespace :pg do
143
143
  # bundle exec rake pg:save[something.dump] => Will dump the database to something.dump
144
144
  desc 'Saves the development database to a postgresql .dump file (latest.dump by default)'
145
145
  task :save, [:filename] => :environment do |t, args|
146
- defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump' }
147
- env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS'] }
146
+ defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump', logs: 'false' }
147
+ env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS'].to_s.presence }
148
148
  keywords = ARGV.map { |a| a.split('=') if a.include?('=') }.compact.inject({}) { |h, (k, v)| h[k.to_sym] = v; h }
149
149
  args.with_defaults(defaults.compact.merge(env_keys.compact).merge(keywords))
150
150
 
@@ -181,12 +181,12 @@ namespace :pg do
181
181
 
182
182
  db.transform_values! { |v| v.respond_to?(:chomp) ? v.chomp : v }
183
183
 
184
- puts "=== Saving local '#{db[:database]}' database to #{args.filename}"
185
-
186
- exclude_table_data = "--exclude-table-data=logs" unless (args.logs == 'true')
184
+ exclude_table_data = "--exclude-table-data=logs --exclude-table-data=*_logs" unless (args.logs.to_s == 'true')
187
185
 
188
186
  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
187
 
188
+ puts "=== Saving local '#{db[:database]}' database to #{args.filename} with#{'out' unless args.logs.to_s == 'true'} logs"
189
+
190
190
  if system(command)
191
191
  puts "Saving database completed"
192
192
  else
@@ -203,7 +203,6 @@ namespace :pg do
203
203
  exit
204
204
  end
205
205
 
206
-
207
206
  puts "=== Cloning remote '#{args.source}' to '#{args.target}'"
208
207
 
209
208
  Bundler.with_unbundled_env do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_developer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-16 00:00:00.000000000 Z
11
+ date: 2024-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails