killbill-currency-plugin 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
@@ -1,5 +1,10 @@
1
1
 
2
+ require 'bigdecimal'
3
+ require 'pathname'
2
4
  require 'active_record'
5
+ require 'yaml'
6
+
3
7
  require 'killbill'
4
8
 
9
+ require 'currency_plugin/properties'
5
10
  require 'currency_plugin/api'
@@ -9,6 +9,23 @@ module Killbill
9
9
  module CurrencyPlugin
10
10
  class DefaultPlugin < Killbill::Plugin::Currency
11
11
 
12
+
13
+ def self.initialize!(conf_dir=File.expand_path('../../../', File.dirname(__FILE__)))
14
+
15
+ config_file = "#{conf_dir}/currency.yml"
16
+
17
+ @@config = Killbill::CurrencyPlugin::Properties.new(config_file)
18
+ @@config.parse!
19
+
20
+ if defined?(JRUBY_VERSION)
21
+ # See https://github.com/jruby/activerecord-jdbc-adapter/issues/302
22
+ require 'jdbc/mysql'
23
+ Jdbc::MySQL.load_driver(:require) if Jdbc::MySQL.respond_to?(:load_driver)
24
+ end
25
+
26
+ ActiveRecord::Base.establish_connection(@@config[:database])
27
+ end
28
+
12
29
  def initialize()
13
30
  @raise_exception = false
14
31
  super()
@@ -17,6 +34,7 @@ module Killbill
17
34
 
18
35
  def start_plugin
19
36
  super
37
+ DefaultPlugin.initialize! @conf_dir
20
38
  end
21
39
 
22
40
  # return DB connections to the Pool if required
data/pom.xml CHANGED
@@ -25,7 +25,7 @@
25
25
  <groupId>com.ning.killbill.ruby</groupId>
26
26
  <artifactId>killbill-currency-plugin</artifactId>
27
27
  <packaging>pom</packaging>
28
- <version>1.1.0</version>
28
+ <version>1.1.1</version>
29
29
  <name>killbill-currency-plugin</name>
30
30
  <description></description>
31
31
  <scm>
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: killbill-currency-plugin
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.0
5
+ version: 1.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kill Bill core team
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-29 00:00:00.000000000 Z
12
+ date: 2013-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: killbill