voomify_tasks 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/run_psql.rb CHANGED
@@ -4,7 +4,6 @@ module RunPSQL
4
4
  end
5
5
  def run_psql_file(config, filename)
6
6
  file_with_path = db_file_path(filename)
7
- puts "Executing sql file: #{file_with_path}"
8
7
  run_pg_command(config, "psql -f #{file_with_path}")
9
8
  end
10
9
 
@@ -15,7 +14,10 @@ module RunPSQL
15
14
  port = config["port"]
16
15
  password = config["password"]
17
16
  pipe_to_file = output_file ? "> #{output_file}" : ""
18
- `export PGPASSWORD="#{password}";#{command} -U #{username} -h #{host} #{port ? '-p '+-port : ''} #{database} #{pipe_to_file};export PGPASSWORD=""`
17
+ variables = "-v PGPASSWORD=\"#{password}\" -v ON_ERROR_STOP=1"
18
+ puts "Executing: #{command} -U #{username} #{host ? '-h '+host : ''} #{port ? '-p '+port : ''} #{database} #{pipe_to_file}"
19
+ `#{command} #{variables} -U #{username} #{host ? '-h '+host : ''} #{port ? '-p '+port : ''} #{database} #{pipe_to_file}`
20
+ puts "exit status: #{$?.exitstatus}"
19
21
  if $?.exitstatus != 0
20
22
  raise "pg command failed"
21
23
  end
@@ -37,7 +37,7 @@ private
37
37
 
38
38
  include RunPSQL
39
39
 
40
- def current_env
40
+ def curr ent_env
41
41
  ActiveRecord::Base.configurations[Rails.env]
42
42
  end
43
43
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voomify_tasks
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 9
10
- version: 0.1.9
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Russell Edens
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-19 00:00:00 -04:00
18
+ date: 2011-03-20 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21