sdm 0.5 → 0.6

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.
Files changed (3) hide show
  1. data/{README → README.md} +5 -0
  2. data/lib/sdm.rb +12 -3
  3. metadata +4 -4
@@ -3,6 +3,11 @@ Stack DB Migrator Helper
3
3
 
4
4
  Wraps the mvn command for the [LDS Stack DB Migrator][1] to make it easier to use.
5
5
 
6
+ Installation
7
+ ------------
8
+
9
+ [sudo] gem install sdm
10
+
6
11
  Commands
7
12
  --------
8
13
 
data/lib/sdm.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'openssl'
2
+ require 'base64'
3
+
1
4
  # local
2
5
  require File.expand_path('../sdm/color', __FILE__)
3
6
  require File.expand_path('../sdm/config', __FILE__)
@@ -8,6 +11,7 @@ module Sdm
8
11
 
9
12
  SUB_COMMANDS = %w(st status envs migrate exec execute x new drop mi)
10
13
  SCHEMA_VERSIONS = "schema-versions"
14
+ PRIVATE_KEY = File.expand_path('~') + "/.db.key"
11
15
 
12
16
  class Start
13
17
 
@@ -35,10 +39,15 @@ module Sdm
35
39
 
36
40
  config = parseconf("#{Sdm::SCHEMA_VERSIONS}/base-db.properties")
37
41
  config.merge!(parseconf(properties_file))
38
- schema = config['owningSchema']
39
- database = config['database']
40
- password = `pw get #{schema} #{database}`.chomp!
41
42
 
43
+ password = ''
44
+ epass = config['ePassword']
45
+ if File.exists?(Sdm::PRIVATE_KEY) && !epass.nil?
46
+
47
+ private_key = OpenSSL::PKey::RSA.new(File.read(Sdm::PRIVATE_KEY))
48
+ password = private_key.private_decrypt(Base64.decode64(epass))
49
+
50
+ end
42
51
 
43
52
  cmd = "mvn -q " +
44
53
  "-Ddb.configurationFile=#{env}.properties " +
metadata CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 5
8
- version: "0.5"
7
+ - 6
8
+ version: "0.6"
9
9
  platform: ruby
10
10
  authors:
11
11
  - Miles Pomeroy
@@ -13,7 +13,7 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2012-05-22 00:00:00 -06:00
16
+ date: 2012-07-23 00:00:00 -06:00
17
17
  default_executable:
18
18
  dependencies: []
19
19
 
@@ -26,7 +26,7 @@ extensions: []
26
26
  extra_rdoc_files: []
27
27
 
28
28
  files:
29
- - README
29
+ - README.md
30
30
  - TODO
31
31
  - bin/sdm
32
32
  - lib/trollop.rb