prodder 1.7 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/dump.feature +7 -2
- data/features/step_definitions/prodder_steps.rb +2 -2
- data/lib/prodder/pg.rb +8 -1
- data/lib/prodder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f6f4835acc6e6921b002818c3cb4f9dde1547b5
|
4
|
+
data.tar.gz: 8b8710f6358a343ec57afa2629c60c48aee99ca7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dda8578941499f02a56e411914ede00f636e4287194f7cc7b0dff4f668577ace27e5b8b8242d9c4360198bca23fe80be5ea9b039029ae16eacb3d6b08942dfa
|
7
|
+
data.tar.gz: 67d62816e83f9a0001e48886b46b7bb5fcdf597eff76fa3a9b8a7e36548e1018553aaa55df859c231b8c41bf4f89497f8ea554b4e6682e137bb26be17607b290
|
data/features/dump.feature
CHANGED
@@ -120,9 +120,14 @@ Feature: prodder dump
|
|
120
120
|
And the workspace file "blog/db/structure.sql" should not match /CREATE TABLE authors/
|
121
121
|
|
122
122
|
Scenario: Verify settings file contents
|
123
|
-
Given I add a
|
123
|
+
Given I add a custom parameter "c.p" with value "v" in the "blog" project's database
|
124
124
|
When I run `prodder dump -c prodder.yml`
|
125
|
-
Then the workspace file "blog/db/settings.sql" should match /ALTER DATABASE
|
125
|
+
Then the workspace file "blog/db/settings.sql" should match /ALTER DATABASE :DBNAME SET c.p=v;/
|
126
|
+
|
127
|
+
Scenario: Verify empty db setting is quoted
|
128
|
+
Given I add a custom parameter "empty.setting" with value "" in the "blog" project's database
|
129
|
+
When I run `prodder dump -c prodder.yml`
|
130
|
+
Then the workspace file "blog/db/settings.sql" should match /ALTER DATABASE :DBNAME SET empty.setting='';/
|
126
131
|
|
127
132
|
Scenario: Exclude specified schemas from structure dump
|
128
133
|
Given the prodder config in "prodder.yml" excludes the schema "ads" from the dump of "blog"
|
@@ -13,8 +13,8 @@ Given 'I add an index to table "$table" on column "$column" in the "$project" pr
|
|
13
13
|
Prodder::PG.new.psql "prodder__#{project}_prod", "CREATE INDEX test_index ON #{table} (#{column});"
|
14
14
|
end
|
15
15
|
|
16
|
-
Given 'I add a
|
17
|
-
Prodder::PG.new.psql "prodder__#{project}_prod", "ALTER DATABASE prodder__#{project}_prod SET #{parameter} = #{value};"
|
16
|
+
Given 'I add a custom parameter "$parameter" with value "$value" in the "$project" project\'s database' do |parameter, value, project|
|
17
|
+
Prodder::PG.new.psql "prodder__#{project}_prod", "ALTER DATABASE prodder__#{project}_prod SET #{parameter} = '#{value}';"
|
18
18
|
end
|
19
19
|
|
20
20
|
Given 'I add a foreign key from table "$table1" and column "$column1" to table "$table2" and column "$column2" in the "$project" project\'s database' do |table1, column1, table2, column2, project|
|
data/lib/prodder/pg.rb
CHANGED
@@ -52,6 +52,8 @@ module Prodder
|
|
52
52
|
SQL
|
53
53
|
|
54
54
|
arguments = [
|
55
|
+
'--host', credentials['host'],
|
56
|
+
'--username', credentials['user'],
|
55
57
|
'-t',
|
56
58
|
'-c', sql
|
57
59
|
]
|
@@ -60,7 +62,12 @@ module Prodder
|
|
60
62
|
raise PGDumpError.new(err) if !success
|
61
63
|
File.open(filename, 'w') do |f|
|
62
64
|
out.each_line do |setting|
|
63
|
-
|
65
|
+
unless setting.gsub(/\s+/, '').empty?
|
66
|
+
setting.chomp!
|
67
|
+
setting += "''" if setting.match /.*=$/
|
68
|
+
# using the magic of psql variables through :DBNAME
|
69
|
+
f.puts "ALTER DATABASE :DBNAME SET #{setting};"
|
70
|
+
end
|
64
71
|
end
|
65
72
|
end
|
66
73
|
end
|
data/lib/prodder/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prodder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Hargraves
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deject
|