killbill 3.1.6 → 3.1.7

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: ce31dbfe71c1ea2aae402a3a5f30d4635f1f44dc
4
- data.tar.gz: 028044c61a02e5957099524601055f15c596e9a8
3
+ metadata.gz: 840154880668dbe44506afa06448cca00b735211
4
+ data.tar.gz: ab55ade3ab7c798f73dd41ae6ea5416ccee13b54
5
5
  SHA512:
6
- metadata.gz: 579efbe60b305303205c3e2cedc03b66cd6b2622244f304b0d05f5fe87729edeff61c07c7117819f38d422d48e8cb8d563c5e5f6759f3ba4fd79eaf061ffc55d
7
- data.tar.gz: 99c8c98f3085e9fa83b1745cef3bd224c74c23efdd394a56cf9dde919ffc1090f59d96873d8fe7c64a1d0d9eadcef0a72fe7bdcff7d38dbc94310c5e37ad398d
6
+ metadata.gz: 4a45e5751639706d0796ef92704f9ef92b3ee7ac14ff8e292254560d5b7e4bcb2bf59c0ff019948af8962c3b8810b82f168113d4d514f6746551238c2ae24bd9
7
+ data.tar.gz: ce45e19db6c7fa36e955fd250c36cbae052f0d4b86761d10974928e03596b98058a045a571eb757704fc8f85aae4ed8635a919091759a44405d3bbd8fadf8744
data/NEWS CHANGED
@@ -1,3 +1,6 @@
1
+ 3.1.7
2
+ Support more Logger APIs
3
+
1
4
  3.1.6
2
5
  Updates to support killbill-api 0.9.8
3
6
  Fix properties handling in add_payment_method
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.6
1
+ 3.1.7
@@ -6,8 +6,13 @@
6
6
  :adapter: sqlite3
7
7
  :database: test.db
8
8
  # For MySQL
9
- # :adapter: 'jdbc'
9
+ # :adapter: 'jdbcmysql'
10
10
  # :username: 'killbill'
11
11
  # :password: 'killbill'
12
12
  # :driver: 'com.mysql.jdbc.Driver'
13
13
  # :url: 'jdbc:mysql://127.0.0.1:3306/killbill'
14
+ # In Kill Bill
15
+ # :adapter: 'jdbcmysql'
16
+ # :jndi: 'killbill/osgi/jdbc'
17
+ # :driver: 'com.mysql.jdbc.Driver'
18
+ # :connection_alive_sql: 'select 1'
@@ -8,24 +8,24 @@ module Killbill
8
8
  attr_accessor :log_level
9
9
 
10
10
  def initialize(delegate)
11
- @logger = delegate
11
+ @logger = delegate
12
12
  # Match Logger levels
13
13
  @log_level = 1 # Logger::INFO
14
14
  end
15
15
 
16
- def debug(message, &block)
16
+ def debug(message=nil, &block)
17
17
  @logger.log(4, build_message(message, &block))
18
18
  end
19
19
 
20
- def info(message, &block)
20
+ def info(message=nil, &block)
21
21
  @logger.log(3, build_message(message, &block))
22
22
  end
23
23
 
24
- def warn(message, &block)
24
+ def warn(message=nil, &block)
25
25
  @logger.log(2, build_message(message, &block))
26
26
  end
27
27
 
28
- def error(message, &block)
28
+ def error(message=nil, &block)
29
29
  @logger.log(1, build_message(message, &block))
30
30
  end
31
31
 
@@ -39,15 +39,34 @@ module Killbill
39
39
  def close
40
40
  end
41
41
 
42
- def build_message(message, &block)
42
+ def add(severity, message = nil, progname = nil, &block)
43
+ case severity
44
+ when 0 # Logger::DEBUG
45
+ debug(message || progname, &block)
46
+ when 1 # Logger::INFO
47
+ info(message || progname, &block)
48
+ when 2 # Logger::WARN
49
+ warn(message || progname, &block)
50
+ when 3 # Logger::ERROR
51
+ error(message || progname, &block)
52
+ when 4 # Logger::FATAL
53
+ fatal(message || progname, &block)
54
+ when 5 # Logger::UNKNOWN
55
+ info(message || progname, &block)
56
+ else
57
+ info(message || progname, &block)
58
+ end
59
+ end
60
+
61
+ def build_message(message=nil, &block)
43
62
  if message.nil?
44
63
  if block_given?
45
64
  message = yield
46
65
  else
47
- message = "(nil)"
66
+ message = '(nil)'
48
67
  end
49
68
  end
50
- message.nil? ? "(nil)" : message.to_s
69
+ message.nil? ? '(nil)' : message.to_s
51
70
  end
52
71
 
53
72
  alias_method :fatal, :error
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe Killbill::Plugin::KillbillLogger do
4
+
5
+ it 'should support Logger APIs' do
6
+ logger = Killbill::Plugin::KillbillLogger.new(::Logger.new(STDOUT))
7
+ logger.fatal { "Argument 'foo' not given." }
8
+ logger.error "Argument #{@foo} mismatch."
9
+ logger.info('initialize') { 'Initializing...' }
10
+ logger.add(Logger::FATAL) { 'Fatal error!' }
11
+ logger.close
12
+ end
13
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.6
4
+ version: 3.1.7
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: 2014-08-07 00:00:00.000000000 Z
11
+ date: 2014-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -353,6 +353,7 @@ files:
353
353
  - spec/killbill/helpers/transaction_spec.rb
354
354
  - spec/killbill/helpers/utils_spec.rb
355
355
  - spec/killbill/killbill_integration_spec.rb
356
+ - spec/killbill/killbill_logger_spec.rb
356
357
  - spec/killbill/killbillapi_spec.rb
357
358
  - spec/killbill/notification_plugin_api_spec.rb
358
359
  - spec/killbill/notification_plugin_spec.rb
@@ -400,6 +401,7 @@ test_files:
400
401
  - spec/killbill/helpers/transaction_spec.rb
401
402
  - spec/killbill/helpers/utils_spec.rb
402
403
  - spec/killbill/killbill_integration_spec.rb
404
+ - spec/killbill/killbill_logger_spec.rb
403
405
  - spec/killbill/killbillapi_spec.rb
404
406
  - spec/killbill/notification_plugin_api_spec.rb
405
407
  - spec/killbill/notification_plugin_spec.rb