csb 0.2.4 → 0.3.0
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 +4 -4
- data/.github/workflows/rspec.yml +47 -0
- data/CHANGELOG.md +4 -0
- data/README.md +3 -0
- data/gemfiles/rails52.gemfile +5 -0
- data/gemfiles/rails60.gemfile +5 -0
- data/lib/csb/builder.rb +4 -0
- data/lib/csb/configuration.rb +2 -1
- data/lib/csb/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33f036f7ba6fd0b859614ef5722b7ed44c5b054ca95533dfd7e854517f42938b
|
4
|
+
data.tar.gz: b70c62e432421635302197a6c4f74734d5ed850fdc7ffb468ec05e2e537a0117
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be0ba57cc6ea7ee16f4db2176328b4d894d88c74e07e844ce8facefb13a65478a5d6f92b9127aebc4667dbd2b22a52fe070ee53f74d4ca75387dbade5d1f3203
|
7
|
+
data.tar.gz: 4b8669fc14cba34be3d435adb23ff0b8e8158b90cb7d2d3b9fa5e7ec1df4bc89b420303c8aaef66ffb4473a81409f9cafcdc1ffb6e2a9f385ba283997ecd8fa2
|
@@ -0,0 +1,47 @@
|
|
1
|
+
name: Build
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
rspec:
|
10
|
+
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
env:
|
13
|
+
BUNDLE_JOBS: 4
|
14
|
+
BUNDLE_RETRY: 3
|
15
|
+
strategy:
|
16
|
+
fail-fast: false
|
17
|
+
matrix:
|
18
|
+
ruby: [2.6, 2.7]
|
19
|
+
gemfile: [
|
20
|
+
"gemfiles/rails52.gemfile",
|
21
|
+
"gemfiles/rails60.gemfile",
|
22
|
+
]
|
23
|
+
steps:
|
24
|
+
- name: Install packages
|
25
|
+
run: |
|
26
|
+
sudo apt update -y
|
27
|
+
sudo apt install -y libsqlite3-dev
|
28
|
+
- uses: actions/checkout@v2
|
29
|
+
- uses: actions/cache@v1
|
30
|
+
with:
|
31
|
+
path: /home/runner/bundle
|
32
|
+
key: bundle-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles(matrix.gemfile) }}-${{ hashFiles('**/*.gemspec') }}
|
33
|
+
restore-keys: |
|
34
|
+
bundle-${{ matrix.ruby }}-${{ matrix.gemfile }}-
|
35
|
+
- name: Set up Ruby
|
36
|
+
uses: ruby/setup-ruby@v1
|
37
|
+
with:
|
38
|
+
ruby-version: ${{ matrix.ruby }}
|
39
|
+
- name: Install dependencies
|
40
|
+
run: |
|
41
|
+
bundle config path /home/runner/bundle
|
42
|
+
bundle config --global gemfile ${{ matrix.gemfile }}
|
43
|
+
bundle install
|
44
|
+
bundle update
|
45
|
+
bundle clean
|
46
|
+
- name: Run rspec
|
47
|
+
run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
[](https://rubygems.org/gems/csb)
|
2
|
+
[](https://github.com/aki77/csb/actions)
|
3
|
+
|
1
4
|
# Csb
|
2
5
|
|
3
6
|
A simple and streaming support CSV template engine for Ruby on Rails.
|
data/lib/csb/builder.rb
CHANGED
@@ -20,6 +20,10 @@ module Csb
|
|
20
20
|
output << CSV.generate_line(cols.headers)
|
21
21
|
items.each do |item|
|
22
22
|
output << CSV.generate_line(cols.values_by_item(item))
|
23
|
+
rescue => error
|
24
|
+
break if Csb.configuration.ignore_class_names.include?(error.class.name)
|
25
|
+
|
26
|
+
raise error
|
23
27
|
end
|
24
28
|
output
|
25
29
|
end
|
data/lib/csb/configuration.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
module Csb
|
2
2
|
class Configuration
|
3
|
-
attr_accessor :utf8_bom, :streaming, :after_streaming_error
|
3
|
+
attr_accessor :utf8_bom, :streaming, :after_streaming_error, :ignore_class_names
|
4
4
|
|
5
5
|
def initialize
|
6
6
|
@utf8_bom = false
|
7
7
|
@streaming = true
|
8
|
+
@ignore_class_names = %w[Puma::ConnectionError]
|
8
9
|
end
|
9
10
|
end
|
10
11
|
end
|
data/lib/csb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aki77
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -87,6 +87,7 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".github/workflows/rspec.yml"
|
90
91
|
- ".gitignore"
|
91
92
|
- ".rspec"
|
92
93
|
- ".travis.yml"
|
@@ -99,6 +100,8 @@ files:
|
|
99
100
|
- bin/console
|
100
101
|
- bin/setup
|
101
102
|
- csb.gemspec
|
103
|
+
- gemfiles/rails52.gemfile
|
104
|
+
- gemfiles/rails60.gemfile
|
102
105
|
- lib/csb.rb
|
103
106
|
- lib/csb/builder.rb
|
104
107
|
- lib/csb/col.rb
|