uas2git 0.9.9.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d82ac2c9be77f157b32319899b5eb719ae8776c5
4
- data.tar.gz: 1b1543704763786aba03ff97832f08ab04f989f5
3
+ metadata.gz: 33e4c936e2e84745d64afd2b1c3e90c1e1e4b23e
4
+ data.tar.gz: 1952c53c0975c08207a72ef0668549d3ee8d2e99
5
5
  SHA512:
6
- metadata.gz: 5aa346382650b2811904e2a7da64840a88e3629f7b0f4373ffcc77769a51a52ef5a7409b986404d3dd29d835cd39a202ec22a497d76a903b19c327aea211c0a4
7
- data.tar.gz: fee6c35918a28e4fb3292f8b7b9f06c337e6d923337868f8d198c45062ffde524fa12efed0ce07200b1e2d0fc24f092729a9f2972e11e138baea1ee63a59fb21
6
+ metadata.gz: 148a452bd412ac36590e3e4819804ae59cd3e05fd601b3854c04c57cec57b040609782fc5f034852e45d02936486cb40a3340d1b6baeb728ca0aaffb6bd01c73
7
+ data.tar.gz: 98c40a4275c49bbcc5b3b07d5d1c999525799b4806b4b565c5b45910d18435795a7badb96fd8c878671ca141b6dbf6a8cd646b3ae002d9795dab30418e6bb1f4
@@ -1,6 +1,7 @@
1
1
  require 'highline/import'
2
2
  require 'optparse'
3
3
  require 'rugged'
4
+ require 'pg'
4
5
  require 'progress'
5
6
 
6
7
  module Uas2Git
@@ -23,13 +24,23 @@ module Uas2Git
23
24
  def run!
24
25
  password = ask('Enter password for ' + @options[:username] + '@' + @options[:host] + ': ') { |q| q.echo = false }
25
26
 
27
+ connection = PG::connect(
28
+ :host => @options[:host],
29
+ :port => '10733',
30
+ :user => @options[:username],
31
+ :password => password,
32
+ :dbname => 'template1'
33
+ )
34
+
35
+ result = connection.exec_params("SELECT db_name($1)", [ @project_name ])
36
+
26
37
  ActiveRecord::Base.establish_connection(
27
38
  :adapter => 'postgresql',
28
39
  :host => @options[:host],
29
40
  :port => '10733',
30
41
  :username => @options[:username],
31
42
  :password => password,
32
- :database => @project_name
43
+ :database => result[0]['db_name']
33
44
  )
34
45
 
35
46
  # Initialize a git repository
@@ -1,3 +1,3 @@
1
1
  module Uas2Git
2
- VERSION = '0.9.9.1'
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uas2git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toru Nayuki