voomify_tasks 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/run_psql.rb +11 -0
  2. data/lib/tasks/databases.rake +2 -11
  3. metadata +3 -5
data/lib/run_psql.rb ADDED
@@ -0,0 +1,11 @@
1
+ module RunPSQL
2
+ def run_psql_file(config, filename)
3
+ file_with_path = "#{Rails.root}/db/sql/#{filename}"
4
+ puts "Executing sql file: #{file_with_path}"
5
+ database = config["database"]
6
+ username = config["username"]
7
+ host = config["host"]
8
+ port = config["port"]
9
+ `psql -f #{file_with_path} -U #{username} -h #{host} -p #{port} #{database} `
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  require 'replace_rake_tasks'
2
-
2
+ require 'run_psql'
3
3
  # we override these tasks to use ddl file instead of ruby
4
4
 
5
5
  namespace :db do
@@ -28,16 +28,7 @@ namespace :db do
28
28
  end
29
29
 
30
30
  private
31
-
32
- def run_psql_file(config, filename)
33
- file_with_path = "#{Rails.root}/db/sql/#{filename}"
34
- puts "Executing sql file: #{file_with_path}"
35
- database = config["database"]
36
- username = config["username"]
37
- host = config["host"]
38
- port = config["port"]
39
- `psql -f #{file_with_path} -U #{username} -h #{host} -p #{port} #{database} `
40
- end
41
31
 
32
+ include RunPSQL
42
33
 
43
34
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voomify_tasks
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
11
10
  platform: ruby
12
11
  authors:
13
12
  - Russell Edens
@@ -29,6 +28,7 @@ extra_rdoc_files:
29
28
  - README
30
29
  files:
31
30
  - lib/replace_rake_tasks.rb
31
+ - lib/run_psql.rb
32
32
  - lib/tasks/databases.rake
33
33
  - lib/tasks/dependent_projects.rake
34
34
  - lib/tasks/enviornments.rake
@@ -49,7 +49,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- hash: 3
53
52
  segments:
54
53
  - 0
55
54
  version: "0"
@@ -58,7 +57,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - ">="
60
59
  - !ruby/object:Gem::Version
61
- hash: 3
62
60
  segments:
63
61
  - 0
64
62
  version: "0"