kpm 0.5.2 → 0.5.3

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: a487717568c5814d90fd062a8b006b66ec550dbb
4
- data.tar.gz: 3c533f57e8f2bf257bd36f66553cdd49d43be34e
3
+ metadata.gz: 9d42c3f647760630bf77cd1b747651801726d523
4
+ data.tar.gz: b8bb3427daf343b4b58da5381241bfddda7c038f
5
5
  SHA512:
6
- metadata.gz: 0802e436f2889109ce4a05ad99e220a4e051ff5e34c96589611ea77a479aebf6ee8727ef5afe1e5ad0fa32e24ccecebd27629d9a02a6295b2ebef393be1e582a
7
- data.tar.gz: 122a71247e5a187d3b440d1cc600215920c80d98599258a36986a19a04f1d2ea5fb9b3d660a0e699f8cd27514cdfddd566431e59a55ef9cf731dced9f84b605d
6
+ metadata.gz: 321702e297c7ef18cb523e474e59ba12780d289b336cc541f58964e95fd72b5cb841b66826528b4cbac424cb7c858f307377e4c71fd7ac3d663b4947b7d71417
7
+ data.tar.gz: 6c60dceeba121d962c8d71e953ece53f427638be7531f9351174cba8e3824008cf7aedae34eacf0c044c49f1e118ce33071f6696c1151c8382564b69e2c2ddbb
data/.gitignore CHANGED
@@ -6,3 +6,4 @@ kpm-*-linux-x86.tar.gz
6
6
  kpm-*-linux-x86_64.tar.gz
7
7
  kpm-*-osx.tar.gz
8
8
  traveling-ruby-*.tar.gz
9
+ *.asc
data/lib/kpm/account.rb CHANGED
@@ -72,7 +72,7 @@ module KPM
72
72
  DEFAULT_DELIMITER = "|"
73
73
 
74
74
  def initialize(config_file = nil, killbill_api_credentials = nil, killbill_credentials = nil, killbill_url = nil,
75
- database_name = nil, database_credentials = nil, data_delimiter = nil, logger = nil)
75
+ database_name = nil, database_credentials = nil, database_host = nil, data_delimiter = nil, logger = nil)
76
76
  @killbill_api_key = KILLBILL_API_KEY
77
77
  @killbill_api_secrets = KILLBILL_API_SECRET
78
78
  @killbill_url = KILLBILL_URL
@@ -84,7 +84,7 @@ module KPM
84
84
 
85
85
 
86
86
  set_killbill_options(killbill_api_credentials,killbill_credentials,killbill_url)
87
- set_database_options(database_name,database_credentials,logger)
87
+ set_database_options(database_host,database_name,database_credentials,logger)
88
88
 
89
89
  load_config_from_file(config_file)
90
90
 
@@ -460,7 +460,7 @@ module KPM
460
460
  config_db = @config['database']
461
461
 
462
462
  if not config_db.nil?
463
- set_database_options(config_db['database'],
463
+ set_database_options(config_db['host'],config_db['name'],
464
464
  [config_db['username'],config_db['password']],
465
465
  @logger)
466
466
 
@@ -479,17 +479,13 @@ module KPM
479
479
 
480
480
  end
481
481
 
482
- def set_database_options(database_name = nil, database_credentials = nil, logger)
482
+ def set_database_options(database_host = nil, database_name = nil, database_credentials = nil, logger)
483
483
 
484
484
  Database.set_logger(logger)
485
485
 
486
- if not database_credentials.nil?
487
- Database.set_credentials(database_credentials[0],database_credentials[1])
488
- end
489
-
490
- if not database_name.nil?
491
- Database.set_database_name(database_name)
492
- end
486
+ Database.set_credentials(database_credentials[0],database_credentials[1]) unless database_credentials.nil?
487
+ Database.set_database_name(database_name) unless database_name.nil?
488
+ Database.set_host(database_host) unless database_host.nil?
493
489
 
494
490
  Database.set_mysql_command_line
495
491
  end
data/lib/kpm/database.rb CHANGED
@@ -13,6 +13,8 @@ module KPM
13
13
  DATABASE = ENV['DATABASE'] || 'killbill'
14
14
  USERNAME = ENV['USERNAME'] || 'root'
15
15
  PASSWORD = ENV['PASSWORD'] || 'root'
16
+ HOST = ENV['HOST'] || 'localhost'
17
+
16
18
  COLUMN_NAME_POS = 3
17
19
 
18
20
  STATEMENT_TMP_FILE = Dir.mktmpdir('statement') + File::SEPARATOR + 'statement.sql'
@@ -23,6 +25,7 @@ module KPM
23
25
  @@username = USERNAME
24
26
  @@password = PASSWORD
25
27
  @@database = DATABASE
28
+ @@host = HOST
26
29
 
27
30
  def set_logger(logger)
28
31
  @@logger = logger
@@ -33,12 +36,16 @@ module KPM
33
36
  @@password = password
34
37
  end
35
38
 
39
+ def set_host(host)
40
+ @@host = host
41
+ end
42
+
36
43
  def set_database_name(database_name = nil)
37
44
  @@database = database_name
38
45
  end
39
46
 
40
47
  def set_mysql_command_line
41
- @@mysql_command_line = "mysql #{@@database} --user=#{@@username} --password=#{@@password} "
48
+ @@mysql_command_line = "mysql #{@@database} --host=#{@@host} --user=#{@@username} --password=#{@@password} "
42
49
  end
43
50
 
44
51
  def execute_insert_statement(table_name, query, qty_to_insert, table_data, record_id = nil)
data/lib/kpm/tasks.rb CHANGED
@@ -479,7 +479,11 @@ module KPM
479
479
  method_option :data_delimiter,
480
480
  :type => :string,
481
481
  :default => "|",
482
- :desc => 'Data delimiter'
482
+ :desc => 'Data delimiter'
483
+ method_option :database_host,
484
+ :type => :string,
485
+ :default => nil,
486
+ :desc => 'Database Host name'
483
487
  desc 'account', 'export/import accounts'
484
488
  def account
485
489
  logger.info 'Please wait processing the request!!!'
@@ -515,7 +519,7 @@ module KPM
515
519
 
516
520
 
517
521
  account = KPM::Account.new(config_file || options[:config_file],options[:killbill_api_credentials],options[:killbill_credentials],
518
- options[:killbill_url],options[:database_name],options[:database_credentials],options[:data_delimiter], logger)
522
+ options[:killbill_url],options[:database_name],options[:database_credentials],options[:database_host],options[:data_delimiter], logger)
519
523
  export_file = nil
520
524
  round_trip_export_import = false
521
525
 
data/lib/kpm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module KPM
2
- VERSION = '0.5.2'
2
+ VERSION = '0.5.3'
3
3
  end
data/pom.xml CHANGED
@@ -26,7 +26,7 @@
26
26
  <groupId>org.kill-bill.billing.installer</groupId>
27
27
  <artifactId>kpm</artifactId>
28
28
  <packaging>pom</packaging>
29
- <version>0.5.2</version>
29
+ <version>0.5.3</version>
30
30
  <name>KPM</name>
31
31
  <url>http://github.com/killbill/killbill-cloud</url>
32
32
  <description>KPM: the Kill Bill Package Manager</description>
data/release.sh CHANGED
@@ -27,6 +27,8 @@ if [[ -z "$NO_RELEASE" ]]; then
27
27
  $BUNDLE rake release
28
28
  fi
29
29
 
30
+ $BUNDLE rake package
31
+
30
32
  if [[ -z "$NO_RELEASE" ]]; then
31
33
  GOAL=gpg:sign-and-deploy-file
32
34
  REPOSITORY_ID=ossrh-releases
@@ -5,9 +5,10 @@ describe KPM::Account do
5
5
  shared_context 'account' do
6
6
  include_context 'connection_setup'
7
7
 
8
+ let(:db_host) {'localhost'}
8
9
  let(:account_class) { described_class.new(nil,[killbill_api_key,killbill_api_secrets],
9
10
  [killbill_user, killbill_password],url,
10
- db_name, [db_username, db_password],nil,logger)}
11
+ db_name, [db_username, db_password],db_host,nil,logger)}
11
12
  let(:dummy_account_id) {SecureRandom.uuid}
12
13
  let(:account_id_invalid) {SecureRandom.uuid}
13
14
  let(:dummy_data) {
@@ -22,6 +23,7 @@ describe KPM::Account do
22
23
  let(:obfuscating_marker) {:email}
23
24
  let(:mysql_cli) {"mysql #{db_name} --user=#{db_username} --password=#{db_password} "}
24
25
  let(:test_ddl) {Dir["#{Dir.pwd}/**/account_test_ddl.sql"][0]}
26
+
25
27
  end
26
28
 
27
29
  describe '#initialize' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-14 00:00:00.000000000 Z
11
+ date: 2017-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline