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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95b4cb17ab1361191fd71e849c6f8a3e61c40c4e
4
- data.tar.gz: 2950c4de8f4f7e941b12a6125847aedb37dde99a
3
+ metadata.gz: 3b715c9cf03fdacc41dc06b26abb55d6cb863e36
4
+ data.tar.gz: 191c3f755d4e0e1a2058f215da8d1daf0e3d83e5
5
5
  SHA512:
6
- metadata.gz: 28eb81154e70497be33d0c155156ab7d5b5b88ecaa11eed6656d934f9e3d4ef80d9ba5b964b53c8a2eb5da9d5b2bfadb71f2b1dbd394dee3900c3cb86734626c
7
- data.tar.gz: 642ad94982d6fae8702fb9f53d12f6e85209060d42e41eb4b047337525e5a721ebd095e7cb53059549ea7d1d25f3d9b1920ac7e47fff7405137c7640d0672187
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.26
130
+ git checkout 0.9.27
131
131
  ruby ./configure.rb
132
132
  sudo ./install.rb
133
133
 
@@ -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 the database user password")
21
+ SchemaEvolutionManager::Ask.for_password("Please enter your password: ")
22
22
  else
23
23
  nil
24
24
  end
@@ -1,5 +1,6 @@
1
1
  require 'fileutils'
2
2
  require 'pathname'
3
+ require 'tempfile'
3
4
 
4
5
  dir = File.dirname(__FILE__)
5
6
  lib_dir = File.join(dir, "schema-evolution-manager")
@@ -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
- STDIN.gets
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'] = Library.write_to_temp_file(connection_data.pgpass(password))
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
@@ -2,7 +2,7 @@ module SchemaEvolutionManager
2
2
 
3
3
  module SemVersion
4
4
 
5
- VERSION = '0.9.26' # Automatically updated by util/create-release.rb
5
+ VERSION = '0.9.27' # Automatically updated by util/create-release.rb
6
6
 
7
7
  end
8
8
 
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.26
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-02 00:00:00.000000000 Z
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