schema-evolution-manager 0.9.26 → 0.9.27
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/README.md +1 -1
- data/bin/sem-apply +1 -1
- data/lib/schema-evolution-manager.rb +1 -0
- data/lib/schema-evolution-manager/ask.rb +19 -4
- data/lib/schema-evolution-manager/db.rb +8 -2
- data/lib/schema-evolution-manager/sem_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: 3b715c9cf03fdacc41dc06b26abb55d6cb863e36
|
4
|
+
data.tar.gz: 191c3f755d4e0e1a2058f215da8d1daf0e3d83e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e827b45cc139543d65a2055b272ef7c9933583db3f4f8a1242093c2f6494550967e621ea261afbec5a7a7008031c42c11fc5479afdf9f312d649de930b4753d7
|
7
|
+
data.tar.gz: ff685021c28187c7204c8c0fb92fea8251b092b87656e429c10474315f35a0f33f19e1bcc5990bd9ee1aa58069a4c6effd0acac41bf1add4eb1e97ff19adf57a
|
data/README.md
CHANGED
@@ -127,7 +127,7 @@ There are two ways to install schema evolution manager:
|
|
127
127
|
|
128
128
|
git clone git://github.com/mbryzek/schema-evolution-manager.git
|
129
129
|
cd schema-evolution-manager
|
130
|
-
git checkout 0.9.
|
130
|
+
git checkout 0.9.27
|
131
131
|
ruby ./configure.rb
|
132
132
|
sudo ./install.rb
|
133
133
|
|
data/bin/sem-apply
CHANGED
@@ -18,7 +18,7 @@ load File.join(File.dirname(__FILE__), 'sem-config')
|
|
18
18
|
args = SchemaEvolutionManager::Args.from_stdin(:optional => %w(url host port name user dry_run password))
|
19
19
|
|
20
20
|
password = if args.password
|
21
|
-
SchemaEvolutionManager::Ask.for_password("Please enter
|
21
|
+
SchemaEvolutionManager::Ask.for_password("Please enter your password: ")
|
22
22
|
else
|
23
23
|
nil
|
24
24
|
end
|
@@ -9,8 +9,11 @@ module SchemaEvolutionManager
|
|
9
9
|
# Asks the user a question. Expects a string back.
|
10
10
|
#
|
11
11
|
# @param default: A default value
|
12
|
+
# @param echo: If true (the default), we echo what the user types
|
13
|
+
# to the screen. If false, we do NOT echo.
|
12
14
|
def Ask.for_string(message, opts={})
|
13
15
|
default = opts.delete(:default)
|
16
|
+
echo = opts[:echo].nil? ? true : opts.delete(:echo)
|
14
17
|
Preconditions.assert_empty_opts(opts)
|
15
18
|
|
16
19
|
final_message = message.dup
|
@@ -21,7 +24,7 @@ module SchemaEvolutionManager
|
|
21
24
|
value = nil
|
22
25
|
while value.to_s == ""
|
23
26
|
print final_message
|
24
|
-
value = get_input.strip
|
27
|
+
value = get_input(echo).strip
|
25
28
|
if value.to_s == "" && default
|
26
29
|
value = default.to_s.strip
|
27
30
|
end
|
@@ -37,12 +40,24 @@ module SchemaEvolutionManager
|
|
37
40
|
end
|
38
41
|
|
39
42
|
def Ask.for_password(message)
|
40
|
-
Ask.for_string(message)
|
43
|
+
Ask.for_string(message, :echo => false)
|
41
44
|
end
|
42
45
|
|
43
46
|
# here to help with tests
|
44
|
-
def Ask.get_input
|
45
|
-
|
47
|
+
def Ask.get_input(echo)
|
48
|
+
if echo
|
49
|
+
STDIN.gets
|
50
|
+
else
|
51
|
+
settings = `stty -g`.strip
|
52
|
+
begin
|
53
|
+
`stty -echo`
|
54
|
+
input = STDIN.gets
|
55
|
+
puts ""
|
56
|
+
ensure
|
57
|
+
`stty #{settings}`
|
58
|
+
end
|
59
|
+
input
|
60
|
+
end
|
46
61
|
end
|
47
62
|
|
48
63
|
end
|
@@ -11,8 +11,7 @@ module SchemaEvolutionManager
|
|
11
11
|
connection_data = ConnectionData.parse_url(@url)
|
12
12
|
|
13
13
|
if password
|
14
|
-
ENV['PGPASSFILE'] =
|
15
|
-
puts "Created PGPASSFILE=%s" % ENV['PGPASSFILE']
|
14
|
+
ENV['PGPASSFILE'] = Db.password_to_tempfile(connection_data.pgpass(password))
|
16
15
|
end
|
17
16
|
end
|
18
17
|
|
@@ -111,6 +110,13 @@ module SchemaEvolutionManager
|
|
111
110
|
"schema_evolution_manager"
|
112
111
|
end
|
113
112
|
|
113
|
+
def Db.password_to_tempfile(contents)
|
114
|
+
file = Tempfile.new("sem-db")
|
115
|
+
file.write(contents)
|
116
|
+
file.rewind
|
117
|
+
file.path
|
118
|
+
end
|
119
|
+
|
114
120
|
end
|
115
121
|
|
116
122
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema-evolution-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bryzek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: '["Michael Bryzek"]'
|
14
14
|
email: mbryzek@alum.mit.edu
|