geordi 0.13.0 → 0.13.1

Sign up to get free protection for your applications and to get access to all the features.
data/bin/dump-for CHANGED
@@ -20,16 +20,11 @@ catching_errors do
20
20
  # source dump if option was given
21
21
  if ARGV.include?("-s")
22
22
  puts "Sourcing dump into development database..."
23
- if File.exists?("script/dbconsole")
24
- `script/dbconsole -p < #{destination_path}`
25
- else
26
- `rails dbconsole -p < #{destination_path}`
27
- end
28
-
23
+ puts `load-dump #{destination_path}`
29
24
  if $?.to_i == 0
30
25
  puts "Your database is now sourced with a fresh #{env} dump."
31
26
  else
32
- puts "Could not source the downloaded #{env} dump."
27
+ $stderr.puts "Could not source the downloaded #{env} dump."
33
28
  end
34
29
  end
35
30
  else
data/bin/load-dump CHANGED
@@ -17,10 +17,18 @@ class DumpLoader
17
17
  File.join(user_dir, 'dumps')
18
18
  end
19
19
 
20
+ def db_console_command
21
+ if File.exists?("script/dbconsole")
22
+ "script/dbconsole -p"
23
+ else
24
+ "rails dbconsole -p"
25
+ end
26
+ end
27
+
20
28
  def source_dump(dump)
21
29
  require 'pty'
22
30
  output_buffer = StringIO.new
23
- PTY.spawn("script/dbconsole -p") do |output, input, pid|
31
+ PTY.spawn(db_console_command) do |output, input, pid|
24
32
  input.write("source #{dump};\nexit;\n")
25
33
  output_buffer.write output.read
26
34
  end
@@ -1,3 +1,3 @@
1
1
  module Geordi
2
- VERSION = '0.13.0'
2
+ VERSION = '0.13.1'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geordi
3
3
  version: !ruby/object:Gem::Version
4
- hash: 43
4
+ hash: 41
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 13
9
- - 0
10
- version: 0.13.0
9
+ - 1
10
+ version: 0.13.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Henning Koch