bcdatabase 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.markdown CHANGED
@@ -1,6 +1,12 @@
1
1
  Bcdatabase history
2
2
  ==================
3
3
 
4
+ 1.2.0
5
+ -----
6
+
7
+ - Add automatic transform for `jruby_adapter` when running under
8
+ JRuby. (#14)
9
+
4
10
  1.1.0
5
11
  -----
6
12
 
data/README.markdown CHANGED
@@ -221,6 +221,13 @@ JRuby (tested on 1.6+), provided that `jruby-openssl` is also
221
221
  installed. It is [continuously tested][ci] on all three of these
222
222
  platforms.
223
223
 
224
+ There is support for having a different adapter defined for
225
+ JRuby. It's very similar to the DataMapper support described above: if
226
+ you define a key called `jruby_adapter` in a configuration, it will be
227
+ copied to `adapter` when Bcdatabase is running under JRuby. Unlike the
228
+ DataMapper support, it is automatic — no need to specify a
229
+ transform.
230
+
224
231
  [ci]: https://public-ci.nubic.northwestern.edu/job/bcdatabase/
225
232
 
226
233
  ## Credits
@@ -1,3 +1,3 @@
1
1
  module Bcdatabase
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
data/lib/bcdatabase.rb CHANGED
@@ -120,16 +120,27 @@ module Bcdatabase
120
120
  },
121
121
  :datamapper => lambda { |entry, name, group|
122
122
  entry.merge('adapter' => entry['datamapper_adapter']) if entry['datamapper_adapter']
123
+ },
124
+ :jruby => lambda { |entry, name, group|
125
+ entry.merge('adapter' => entry['jruby_adapter']) if entry['jruby_adapter']
123
126
  }
124
127
  }
125
128
 
129
+ def self.automatic_transforms
130
+ @automatic_transforms ||= [
131
+ :key_defaults,
132
+ :decrypt,
133
+ (:jruby if RUBY_PLATFORM =~ /java/)
134
+ ].compact
135
+ end
136
+
126
137
  ##
127
138
  # Creates a configuration from a set of YAML files.
128
139
  #
129
140
  # General use of the library should not use this method, but
130
141
  # instead should use {Bcdatabase.load}.
131
142
  def initialize(files, transforms=[])
132
- @transforms = ([:key_defaults, :decrypt] + transforms).collect do |t|
143
+ @transforms = (self.class.automatic_transforms + transforms).collect do |t|
133
144
  case t
134
145
  when Symbol
135
146
  BUILT_IN_TRANSFORMS[t] or fail "No built-in transform named #{t.inspect}"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcdatabase
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 1.1.0
10
+ version: 1.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rhett Sutphin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-30 00:00:00 -05:00
18
+ date: 2011-09-01 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency