jdbc-helper 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cd3112f8aa6d3119d13eff732b5a6321ce9a3b68
4
+ data.tar.gz: f80d4ab009b0ac10819c6b8274e2fb981307598a
5
+ SHA512:
6
+ metadata.gz: 061871bc4ce8f9422ea8349d5fce6cf84537ae1e0e40b5cf38f825f2b51d5d576b2031c8b1440fa009bd17b7fd30a8b939b8d0b5056ff3a0313f149407d53436
7
+ data.tar.gz: e54c9555bcffa3e8da8f9ae8ea800f0bffeb5d49887ea49e90d202119d6b5d53186a178ca23f1ecce49ec3afcb7c2cda244daf49f46643e73f97f06612d414c0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.8.1
2
+
3
+ * Allow :driver parameter to be in either String or Class
4
+
1
5
  ### 0.8.0
2
6
 
3
7
  0.8.0 introduces a few backward-incompatible changes.
@@ -146,9 +146,6 @@ class Connection
146
146
  @driver = args.delete :driver
147
147
  @url = args.delete :url
148
148
 
149
- # NameError will be thrown for invalid drivers
150
- Java::JavaClass.for_name @driver
151
-
152
149
  timeout = args.has_key?(:timeout) ? args.delete(:timeout) : Constants::DEFAULT_LOGIN_TIMEOUT
153
150
  if timeout
154
151
  if timeout.is_a?(Fixnum) == false || timeout <= 0
@@ -162,7 +159,16 @@ class Connection
162
159
  props.setProperty(k.to_s, v.to_s) if v
163
160
  end
164
161
 
165
- @conn = Java::java.sql.DriverManager.get_connection(@url, props)
162
+ @conn = case @driver
163
+ when String
164
+ # NameError will be thrown for invalid drivers
165
+ Java::JavaClass.for_name @driver
166
+ Java::java.sql.DriverManager.get_connection(@url, props)
167
+ when Class
168
+ @driver.new.connect(@url, props)
169
+ else
170
+ raise ArgumentError.new('Invalid type for :driver')
171
+ end
166
172
  @spool = StatementPool.send :new, self
167
173
  @bstmt = nil
168
174
  @fetch_size = nil
@@ -1,3 +1,3 @@
1
1
  module JDBCHelper
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jdbc-helper
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.8.0
4
+ version: 0.8.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Junegunn Choi
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-17 00:00:00.000000000 Z
11
+ date: 2014-08-26 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: insensitive_hash
@@ -18,13 +17,11 @@ dependencies:
18
17
  - - '>='
19
18
  - !ruby/object:Gem::Version
20
19
  version: 0.2.4
21
- none: false
22
20
  requirement: !ruby/object:Gem::Requirement
23
21
  requirements:
24
22
  - - '>='
25
23
  - !ruby/object:Gem::Version
26
24
  version: 0.2.4
27
- none: false
28
25
  prerelease: false
29
26
  type: :runtime
30
27
  - !ruby/object:Gem::Dependency
@@ -34,13 +31,11 @@ dependencies:
34
31
  - - ~>
35
32
  - !ruby/object:Gem::Version
36
33
  version: 0.1.1
37
- none: false
38
34
  requirement: !ruby/object:Gem::Requirement
39
35
  requirements:
40
36
  - - ~>
41
37
  - !ruby/object:Gem::Version
42
38
  version: 0.1.1
43
- none: false
44
39
  prerelease: false
45
40
  type: :runtime
46
41
  - !ruby/object:Gem::Dependency
@@ -50,13 +45,11 @@ dependencies:
50
45
  - - '>='
51
46
  - !ruby/object:Gem::Version
52
47
  version: '0'
53
- none: false
54
48
  requirement: !ruby/object:Gem::Requirement
55
49
  requirements:
56
50
  - - '>='
57
51
  - !ruby/object:Gem::Version
58
52
  version: '0'
59
- none: false
60
53
  prerelease: false
61
54
  type: :development
62
55
  - !ruby/object:Gem::Dependency
@@ -66,13 +59,11 @@ dependencies:
66
59
  - - '>='
67
60
  - !ruby/object:Gem::Version
68
61
  version: '0'
69
- none: false
70
62
  requirement: !ruby/object:Gem::Requirement
71
63
  requirements:
72
64
  - - '>='
73
65
  - !ruby/object:Gem::Version
74
66
  version: '0'
75
- none: false
76
67
  prerelease: false
77
68
  type: :development
78
69
  - !ruby/object:Gem::Dependency
@@ -82,13 +73,11 @@ dependencies:
82
73
  - - '>='
83
74
  - !ruby/object:Gem::Version
84
75
  version: '0'
85
- none: false
86
76
  requirement: !ruby/object:Gem::Requirement
87
77
  requirements:
88
78
  - - '>='
89
79
  - !ruby/object:Gem::Version
90
80
  version: '0'
91
- none: false
92
81
  prerelease: false
93
82
  type: :development
94
83
  description: A JDBC helper for JRuby/Database developers.
@@ -146,6 +135,7 @@ files:
146
135
  - test/testrb
147
136
  homepage: https://github.com/junegunn/jdbc-helper
148
137
  licenses: []
138
+ metadata: {}
149
139
  post_install_message:
150
140
  rdoc_options: []
151
141
  require_paths:
@@ -155,18 +145,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
145
  - - '>='
156
146
  - !ruby/object:Gem::Version
157
147
  version: '0'
158
- none: false
159
148
  required_rubygems_version: !ruby/object:Gem::Requirement
160
149
  requirements:
161
150
  - - '>='
162
151
  - !ruby/object:Gem::Version
163
152
  version: '0'
164
- none: false
165
153
  requirements: []
166
154
  rubyforge_project:
167
- rubygems_version: 1.8.24
155
+ rubygems_version: 2.1.9
168
156
  signing_key:
169
- specification_version: 3
157
+ specification_version: 4
170
158
  summary: A JDBC helper for JRuby/Database developers.
171
159
  test_files:
172
160
  - test/database.yml