jredshift 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3d080c427b01705d8b15ee57188d4c8f94bea52
4
- data.tar.gz: a9ffb5029b984c76fbb2981ec89eb1fd2d1442df
3
+ metadata.gz: 9775960ba8c96ba246556b4d84088ffeecbe542e
4
+ data.tar.gz: 4c09261b6f9f345cc0ddd3f8e5ff2aa5b26ec172
5
5
  SHA512:
6
- metadata.gz: b7f837038cfe93d142cc35bec5f4c8488c8da05a8a5959e16b090c68c2dd046ceb68f16ac08473ddf1b2c53eb8fe688960d330fdd4a510670bd35b66665c9681
7
- data.tar.gz: 643c3d2e6a5d68e49c325679f5191535a11084bf2e9a02e69a25f193c220b92de0c2c3b2413087885bd35698b685cd6d4c2656779ba4660625e0f062003a4fad
6
+ metadata.gz: 7ac71b47b598ebfcfbc5ec3614ca8697c7d99ddb02b0d7d7a22fa1178df0a8203f9838f13e9f2f1f45782b216630def3fba9047979f2e171d55bac320c07439d
7
+ data.tar.gz: aaa965b8b5b754a8970eaaba1e48ae1dea63ce584622cd2f8e89c8b9add9fabdc25962ac785a7d8da777d807ef066b61e8ca6b5ca3dd306cc9ca9886059bbb24
data/lib/jredshift.rb CHANGED
@@ -32,14 +32,14 @@ module Jredshift
32
32
 
33
33
  def drop_table_if_exists(table, options={})
34
34
  cascade = options.fetch(:cascade, false) ? ' CASCADE' : ''
35
- err_msg = "ERROR: table \"#{remove_schema(table)}\" does not exist"
35
+ err_msg = "ERROR: Table \"#{remove_schema(table)}\" does not exist"
36
36
 
37
37
  execute("DROP TABLE #{table}#{cascade};", :quiet => true, :errors_to_ignore => [err_msg])
38
38
  end
39
39
 
40
40
  def drop_view_if_exists(view, options={})
41
41
  cascade = options.fetch(:cascade, false) ? ' CASCADE' : ''
42
- err_msg = "ERROR: view \"#{remove_schema(view)}\" does not exist"
42
+ err_msg = "ERROR: View \"#{remove_schema(view)}\" does not exist"
43
43
 
44
44
  execute("DROP VIEW #{view}#{cascade};", :quiet => true, :errors_to_ignore => [err_msg])
45
45
  end
@@ -115,7 +115,7 @@ module Jredshift
115
115
  return_value
116
116
 
117
117
  rescue Exception => e
118
- if errors_to_ignore.include?(e.message)
118
+ if should_ignore_error?(e.message, errors_to_ignore)
119
119
  @retry_count = 0
120
120
 
121
121
  elsif interpretable_error?(e.message)
@@ -141,6 +141,10 @@ module Jredshift
141
141
  end
142
142
  end
143
143
 
144
+ def should_ignore_error?(err_msg, errors_to_ignore)
145
+ errors_to_ignore.map {|err| err.downcase }.include?(err_msg.downcase)
146
+ end
147
+
144
148
  def interpretable_error?(err_msg)
145
149
  err_msg =~ ERROR_UPDATE_COUNT_OVERFLOW_REGEX
146
150
  end
@@ -1,3 +1,3 @@
1
1
  module Jredshift
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jredshift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Morin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-15 00:00:00.000000000 Z
11
+ date: 2014-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jdbc-postgres
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.2.0
110
+ rubygems_version: 2.2.2
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Redshift wrapper for JRuby.