kugiru 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 1712cf8f2801261cea455006d3bd516864cbdf916bb603b691f219fcfb612bb8
4
- data.tar.gz: aa4af397a1d2a683d84b566ddc7562b0b72a41380f3298b00187f9b0de578322
3
+ metadata.gz: fa7bc91575fcd4bcba43119d4939f7fbad250e3907fcecbf2831cc5b054c696d
4
+ data.tar.gz: 2d740938aa02d08b411cd957ca71ad7856d3176700544afdb55ea8b403c8dded
5
5
  SHA512:
6
- metadata.gz: eb14fcdf352f0778b6495bf6f991aabce3ebb9aac4ec2c6092ad0b533b395507950d734496a8d70efcca3ceaba3fff93287c3bd1f9cc2bc91269f6cf24774b7f
7
- data.tar.gz: 94a4bab5f7c2a75c2e5159d7731a9e909de6d81829bc99d4fbe5b8f25b83bee0a1451075cbdcc1e557e7860511f01a24a700fba0f276a3069efd646933d170ca
6
+ metadata.gz: 15b6ed5b697ab277f56236724cdb6718f4125827945002958cb1ac96a996621cbde11123777bf99f2b356164649f798c752d215817b23617872b5090a689261d
7
+ data.tar.gz: 928177c225872a231cb4664e58ac15b4da2e7ca445b6cb5f88edbada940ebf30956395fe4f3644aa91e7202066c6a766840f42ab704ae3a07c1e8968af5cb610
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kugiru (0.1.0)
4
+ kugiru (0.1.1)
5
5
  csv
6
6
  rails (~> 5.2.0)
7
7
 
data/README.md CHANGED
@@ -66,6 +66,10 @@ In `config/initializers/kugiru.rb`, you can configure the following values.
66
66
  Kugiru.configure do |config|
67
67
  config.utf8_bom = true # default: false
68
68
  config.streaming = false # default: true
69
+ config.after_streaming_error = ->(error) do # default: nil
70
+ Rails.logger.error(error)
71
+ Bugsnag.notify(error)
72
+ end
69
73
  end
70
74
  ```
71
75
 
@@ -29,7 +29,12 @@ module Kugiru
29
29
 
30
30
  def self.build_enumerator(**args)
31
31
  Enumerator.new do |y|
32
- self.new(y, args).build
32
+ begin
33
+ self.new(y, args).build
34
+ rescue => error
35
+ Kugiru.configuration.after_streaming_error.try(:call, error)
36
+ raise error
37
+ end
33
38
  end
34
39
  end
35
40
  end
@@ -1,6 +1,6 @@
1
1
  module Kugiru
2
2
  class Configuration
3
- attr_accessor :utf8_bom, :streaming
3
+ attr_accessor :utf8_bom, :streaming, :after_streaming_error
4
4
 
5
5
  def initialize
6
6
  @utf8_bom = false
@@ -1,3 +1,3 @@
1
1
  module Kugiru
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kugiru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - aki77