effective_developer 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/effective_developer/version.rb +1 -1
- data/lib/tasks/pg_pull.rake +8 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f683ab9dcda556c93330af2e81a50c584768c8f0464c1124a6d0af2a9eadf99
|
4
|
+
data.tar.gz: 2935dd2fef5e23e7a8470e436f1c7e613c561b556737f6c741273276b1372c5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 706e83a7ed877f3fd686ca4b251db6dc68d393c89401e7266b2f3bfea9cec0c7d8364deda7f1dc3ba393d9f7edec3ec59c2a4d44d2a53e44e443993b5d9e67e9
|
7
|
+
data.tar.gz: 639e094e77930330bbd6bc2695b058bea2ddf2333b7b74cfc115be8afadd6f454626b13f77060d8dbb0f0b540ea71bce83953154588e5a7b58e4519045bb8be0
|
data/lib/tasks/pg_pull.rake
CHANGED
@@ -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
|
-
|
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.
|
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-
|
11
|
+
date: 2024-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|