jredshift 0.0.2 → 0.0.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: 441d5b148ca3cc9369e7d7a1c3676bf4d8c3a493
4
- data.tar.gz: ec0cdab3abcbdf9140cbda283b858c20152d4cea
3
+ metadata.gz: db12692389bfe5cda6bc08190d017ee7f33cdefe
4
+ data.tar.gz: bbf2bdcec247bd3b00917833efe587370f1d2b87
5
5
  SHA512:
6
- metadata.gz: 5f996f9be95ee32fcbc107a332736bfa3bdcc88017d78233431ae2bb45f091f4fdb1de34c8411066d0764774593cf362fd9e40bc43adbb6f0b3631d261611bec
7
- data.tar.gz: dfe9f4013460c69c629008d174252c82465f186abd41948ae8e64edd8f4ba2e1934400e483947a4223e73b336f9aa6cf6234aee0fcde57450d743c37566d587a
6
+ metadata.gz: 3f836191c700760f02067bde54291d5cce3ac06596820f42d718100f85e02f178c9b6513f48fb2e779b4298af6aac631a839139bc5d5e2ba8f7e331c7460ac11
7
+ data.tar.gz: 5c30e5fb096f78fae249ef390f85cbd2683716756c89acffc2a9e88f15552e5941e02ee0c8bb264366f5fee14c6c148c9e0ffd1a70a024535829f3c9ed4c9069
@@ -23,10 +23,13 @@ module Jredshift
23
23
  @password = password
24
24
  @error_occurred = false
25
25
  @retry_count = 0
26
- init_connection
26
+
27
+ validate_connection_credentials
27
28
 
28
29
  secrets = options.fetch(:secrets, [])
29
30
  @logger = Logger.new(:secrets => secrets)
31
+
32
+ init_connection
30
33
  end
31
34
 
32
35
  def execute(sql, options={})
@@ -90,6 +93,12 @@ module Jredshift
90
93
 
91
94
  private
92
95
 
96
+ def validate_connection_credentials
97
+ fail ArgumentError, 'jdbc_url needs to be a string' unless @jdbc_url.is_a?(String)
98
+ fail ArgumentError, 'user needs to be a string' unless @user.is_a?(String)
99
+ fail ArgumentError, 'password needs to be a string' unless @password.is_a?(String)
100
+ end
101
+
93
102
  def init_connection
94
103
  Jdbc::Postgres.load_driver
95
104
  with_error_handling do
@@ -1,3 +1,3 @@
1
1
  module Jredshift
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jredshift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Morin