csb 0.2.1 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rspec.yml +47 -0
- data/CHANGELOG.md +20 -0
- data/README.md +3 -0
- data/csb.gemspec +3 -3
- 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/handler.rb +4 -0
- data/lib/csb/template.rb +1 -1
- data/lib/csb/version.rb +1 -1
- metadata +16 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3037dfb042638fd3c0ed0e186b48bdcd0a36224e0b786f4f04f948c294c61bcf
|
4
|
+
data.tar.gz: f93eeb95cfd751cf0c8df6aaf43479f1c3201aad49f979df1cd3f44bd480b9d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fb5514caecd51087c07e5ef4cb2af9134f7049b8f9d5a00d3a691577a689e6f18e856cb45302b285f2bb197aaa432f0f55d24e640b3e8278533acee701e2a4c
|
7
|
+
data.tar.gz: 956abb986cc239759b16576638072bc55612ed6806c47bf65273fc507c1513405df95bc7fb26239f646979c434a73559133ce72aeacef2758e7cfdcf64007ba5
|
@@ -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
@@ -1,3 +1,23 @@
|
|
1
|
+
## 0.3.1
|
2
|
+
|
3
|
+
- Refactor
|
4
|
+
|
5
|
+
## 0.3.0
|
6
|
+
|
7
|
+
- Add ignore_class_names config
|
8
|
+
|
9
|
+
## 0.2.4
|
10
|
+
|
11
|
+
- Clean up rack@2.2.x monkey patch.
|
12
|
+
|
13
|
+
## 0.2.3
|
14
|
+
|
15
|
+
- Fix rack@2.2.x bug https://github.com/rack/rack/issues/1619
|
16
|
+
|
17
|
+
## 0.2.2
|
18
|
+
|
19
|
+
- Update dependency
|
20
|
+
|
1
21
|
## 0.2.1
|
2
22
|
|
3
23
|
- Update dependency
|
data/README.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/csb.svg)](https://rubygems.org/gems/csb)
|
2
|
+
[![Build](https://github.com/aki77/csb/workflows/Build/badge.svg)](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/csb.gemspec
CHANGED
@@ -22,10 +22,10 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
|
-
spec.add_dependency "rails", ">= 5.2.
|
25
|
+
spec.add_dependency "rails", ">= 5.2.4.2"
|
26
26
|
spec.add_dependency "csv"
|
27
27
|
|
28
28
|
spec.add_development_dependency "bundler", "~> 2.0"
|
29
|
-
spec.add_development_dependency "rake"
|
30
|
-
spec.add_development_dependency "rspec"
|
29
|
+
spec.add_development_dependency "rake"
|
30
|
+
spec.add_development_dependency "rspec"
|
31
31
|
end
|
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/handler.rb
CHANGED
@@ -20,6 +20,10 @@ module Csb
|
|
20
20
|
if csv.streaming?
|
21
21
|
response.headers['Cache-Control'] = 'no-cache'
|
22
22
|
response.headers['X-Accel-Buffering'] = 'no'
|
23
|
+
# SEE: https://github.com/rack/rack/issues/1619
|
24
|
+
if Gem::Version.new('2.2.0') <= Gem::Version.new(Rack::RELEASE)
|
25
|
+
response.headers['Last-Modified'] = '0'
|
26
|
+
end
|
23
27
|
end
|
24
28
|
csv.build
|
25
29
|
RUBY
|
data/lib/csb/template.rb
CHANGED
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aki77
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.2.
|
19
|
+
version: 5.2.4.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 5.2.
|
26
|
+
version: 5.2.4.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: csv
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,30 +56,30 @@ dependencies:
|
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
description: A simple and streaming support CSV template engine for Ruby on Rails.
|
84
84
|
email:
|
85
85
|
- aki77@users.noreply.github.com
|
@@ -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
|
@@ -127,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
130
|
- !ruby/object:Gem::Version
|
128
131
|
version: '0'
|
129
132
|
requirements: []
|
130
|
-
rubygems_version: 3.
|
133
|
+
rubygems_version: 3.1.2
|
131
134
|
signing_key:
|
132
135
|
specification_version: 4
|
133
136
|
summary: A simple and streaming support CSV template engine for Ruby on Rails.
|