eventhub-command 0.3.8 → 0.3.9
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/eh/commands/db.rb +11 -4
- data/lib/eh/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 034f834daeb4c0cdb78f28ece401a2476856ce60
|
|
4
|
+
data.tar.gz: db6943677d99c2e5de4ff1fe573e3169195e7671
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16b498eda37a837306c4a0f29bcf4797553720aa648790db179798bd64179a0c018a9af5aa7685a8dce06d3de673c8ee0ec04d980a10ced21bb1f9b90ab7c508
|
|
7
|
+
data.tar.gz: 9e5da5232f76c5467304fdc3389f5f1a4443b60c2c9c1fb685b8eb9564581dedc37696fca7db7e65c0dbf007744439d15af626bab38e4cbdffc0dcf6b954c268
|
data/lib/eh/commands/db.rb
CHANGED
|
@@ -17,6 +17,7 @@ command :db do |command|
|
|
|
17
17
|
puts "will execute '#{cmd}'"
|
|
18
18
|
end
|
|
19
19
|
system cmd
|
|
20
|
+
puts "Dumped DB to #{target}"
|
|
20
21
|
end
|
|
21
22
|
end
|
|
22
23
|
|
|
@@ -31,11 +32,17 @@ command :db do |command|
|
|
|
31
32
|
if source.nil?
|
|
32
33
|
raise ArgumentError.new("No source file found in #{base} and none passed via --file")
|
|
33
34
|
end
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
puts "This will destroy the contents of #{options[:db]}. Is this OK? [yes/NO]:"
|
|
36
|
+
answer = $stdin.gets.chomp.downcase
|
|
37
|
+
if answer == 'yes'
|
|
38
|
+
cmd = "psql -U#{options[:user]} -d#{options[:db]} -f#{source}"
|
|
39
|
+
if options[:verbose]
|
|
40
|
+
puts "will execute '#{cmd}'"
|
|
41
|
+
end
|
|
42
|
+
system cmd
|
|
43
|
+
else
|
|
44
|
+
puts "Abort."
|
|
37
45
|
end
|
|
38
|
-
system cmd
|
|
39
46
|
end
|
|
40
47
|
end
|
|
41
48
|
|
data/lib/eh/version.rb
CHANGED