recite_csv 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +19 -0
- data/.rubocop.yml +2 -1
- data/CHANGELOG.md +18 -0
- data/Gemfile +7 -1
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/lib/recite_csv/header/definition.rb +5 -3
- data/lib/recite_csv/reader/builder.rb +3 -1
- data/lib/recite_csv/reader/core.rb +1 -1
- data/lib/recite_csv/version.rb +1 -1
- data/recite_csv.gemspec +6 -9
- metadata +15 -84
- data/.travis.yml +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90a7dbd617f57a71f28be00e86a5f492010cb042175f78f1b9ba9dcf024d8f56
|
4
|
+
data.tar.gz: bc47489c30d200d851751ad170012d44029e10ef45c9143fccd57985f5c7b6c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5750c6e702e8af1b8272a8583a4913a1929ebad5527fae173281b3c7253336cef264a76e33dbac9a3b5fddc14384c5a2aaa80f72586b673db48f6711ca57a0c2
|
7
|
+
data.tar.gz: 97de737c90a8daf462ab0ba3944628bab5de081e9b7e404319f7b38859db453aa23c4348e4bdcde05add4cd917664c073d6ebb7eb7cf5a0de3da3422c4a6a43c
|
@@ -0,0 +1,19 @@
|
|
1
|
+
name: Build
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby: ['3.0', '3.1', '3.2', '3.3']
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- name: Set up Ruby
|
14
|
+
uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: ${{ matrix.ruby }}
|
17
|
+
bundler-cache: true
|
18
|
+
- name: Run tests
|
19
|
+
run: bundle exec rake spec
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
|
4
|
+
## 2.1.0 (2023-12-25)
|
5
|
+
|
6
|
+
### Changes
|
7
|
+
|
8
|
+
* Add csv gem to runtime dependencies
|
9
|
+
* Drop Ruby 2.x support
|
10
|
+
|
11
|
+
### Misc
|
12
|
+
|
13
|
+
* Migrate CI from Travis CI to GitHub Actions
|
14
|
+
* CI against for Ruby 3.0, 3.1, 3.2, and 3.3
|
15
|
+
* Require MFA to release gem
|
16
|
+
* Change the default branch from master to main
|
17
|
+
* Correct RuboCop offenses
|
18
|
+
* Update dev dependencies
|
19
|
+
|
20
|
+
|
3
21
|
## 2.0.0 (2020-01-09)
|
4
22
|
|
5
23
|
### Breaking changes
|
data/Gemfile
CHANGED
@@ -2,5 +2,11 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
# Specify your gem's dependencies in recite_csv.gemspec
|
6
5
|
gemspec
|
6
|
+
|
7
|
+
gem "bundler", ">= 2.2.3"
|
8
|
+
gem "pry", ">= 0.14.2"
|
9
|
+
gem "rake", ">= 13.1"
|
10
|
+
gem "rspec", "~> 3.12"
|
11
|
+
gem "rubocop", ">= 1.59.0"
|
12
|
+
gem "rubocop-performance", ">= 1.20.1"
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ ReciteCSV assists to implement a class for CSV reader.
|
|
4
4
|
A reader class implemented by ReciteCSV iterate each row as PORO(Plain Old Ruby Object).
|
5
5
|
|
6
6
|
[![Gem Version](https://badge.fury.io/rb/recite_csv.svg)](https://badge.fury.io/rb/recite_csv)
|
7
|
-
[![Build
|
7
|
+
[![Build](https://github.com/yujideveloper/recite_csv/actions/workflows/ruby.yml/badge.svg)](https://github.com/yujideveloper/recite_csv/actions/workflows/ruby.yml)
|
8
8
|
[![Maintainability](https://api.codeclimate.com/v1/badges/eb04cab6d55b0c7a1f7f/maintainability)](https://codeclimate.com/github/yujideveloper/recite_csv/maintainability)
|
9
9
|
|
10
10
|
## Installation
|
@@ -32,6 +32,8 @@ module ReciteCSV
|
|
32
32
|
|
33
33
|
class ColumnMethodsBuilder < ::Module
|
34
34
|
def initialize(raw_definition)
|
35
|
+
super()
|
36
|
+
|
35
37
|
raw_definition.each_pair do |method_name, header_name|
|
36
38
|
define_method method_name do
|
37
39
|
self[header_name]
|
@@ -48,6 +50,8 @@ module ReciteCSV
|
|
48
50
|
class Array < Base
|
49
51
|
class ColumnMethodsBuilder < ::Module
|
50
52
|
def initialize(raw_definition)
|
53
|
+
super()
|
54
|
+
|
51
55
|
raw_definition.each.with_index do |name, idx|
|
52
56
|
next if name.nil? || name.empty?
|
53
57
|
|
@@ -70,9 +74,7 @@ module ReciteCSV
|
|
70
74
|
_, definition_class = DEFINITIONS.find do |klass, _|
|
71
75
|
header_definition.is_a? klass
|
72
76
|
end
|
73
|
-
unless definition_class
|
74
|
-
raise ::ArgumentError, "Unexpected header definition type"
|
75
|
-
end
|
77
|
+
raise ::ArgumentError, "Unexpected header definition type" unless definition_class
|
76
78
|
|
77
79
|
definition_class.new(header_definition)
|
78
80
|
end
|
@@ -9,11 +9,13 @@ module ReciteCSV
|
|
9
9
|
module Reader
|
10
10
|
class Builder < ::Module
|
11
11
|
def initialize(header_definition, &block)
|
12
|
+
super()
|
13
|
+
|
12
14
|
definition = Header::Definition.dispatch(header_definition)
|
13
15
|
@definition = definition
|
14
16
|
@row_class = ::Class.new(Row::Base) do |klass|
|
15
17
|
klass.include definition.build_column_methods_module
|
16
|
-
klass.class_exec(&block) if
|
18
|
+
klass.class_exec(&block) if block
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
data/lib/recite_csv/version.rb
CHANGED
data/recite_csv.gemspec
CHANGED
@@ -4,7 +4,7 @@ lib = File.expand_path("lib", __dir__)
|
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
require "recite_csv/version"
|
6
6
|
|
7
|
-
Gem::Specification.new do |spec|
|
7
|
+
Gem::Specification.new do |spec|
|
8
8
|
spec.name = "recite_csv"
|
9
9
|
spec.version = ReciteCSV::VERSION
|
10
10
|
spec.authors = ["Yuji Hanamura"]
|
@@ -21,7 +21,9 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
21
21
|
|
22
22
|
spec.metadata["homepage_uri"] = spec.homepage
|
23
23
|
spec.metadata["source_code_uri"] = spec.homepage
|
24
|
-
spec.metadata["changelog_uri"] = "https://github.com/yujideveloper/recite_csv/tree/
|
24
|
+
spec.metadata["changelog_uri"] = "https://github.com/yujideveloper/recite_csv/tree/main/CHANGELOG.md"
|
25
|
+
|
26
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
25
27
|
|
26
28
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
27
29
|
`git ls-files -z`
|
@@ -32,12 +34,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
32
34
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
35
|
spec.require_paths = ["lib"]
|
34
36
|
|
35
|
-
spec.required_ruby_version = ">=
|
37
|
+
spec.required_ruby_version = ">= 3.0"
|
36
38
|
|
37
|
-
spec.
|
38
|
-
spec.add_development_dependency "pry", ">= 0.10.0"
|
39
|
-
spec.add_development_dependency "rake", ">= 10.0"
|
40
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
41
|
-
spec.add_development_dependency "rubocop", ">= 0.70.0"
|
42
|
-
spec.add_development_dependency "rubocop-performance", ">= 1.3.0"
|
39
|
+
spec.add_dependency "csv"
|
43
40
|
end
|
metadata
CHANGED
@@ -1,113 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recite_csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Hanamura
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: csv
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
type: :
|
19
|
+
version: '0'
|
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: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: pry
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.10.0
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.10.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '10.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '10.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '3.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '3.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubocop
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 0.70.0
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 0.70.0
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rubocop-performance
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 1.3.0
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 1.3.0
|
26
|
+
version: '0'
|
97
27
|
description: 'ReciteCSV assists to implement a class for CSV reader. A reader class
|
98
28
|
implemented by ReciteCSV iterate each row as PORO(Plain Old Ruby Object).
|
99
29
|
|
100
|
-
'
|
30
|
+
'
|
101
31
|
email:
|
102
32
|
- yuji.developer@gmail.com
|
103
33
|
executables: []
|
104
34
|
extensions: []
|
105
35
|
extra_rdoc_files: []
|
106
36
|
files:
|
37
|
+
- ".github/workflows/ruby.yml"
|
107
38
|
- ".gitignore"
|
108
39
|
- ".rspec"
|
109
40
|
- ".rubocop.yml"
|
110
|
-
- ".travis.yml"
|
111
41
|
- CHANGELOG.md
|
112
42
|
- Gemfile
|
113
43
|
- LICENSE.txt
|
@@ -134,8 +64,9 @@ metadata:
|
|
134
64
|
allowed_push_host: https://rubygems.org
|
135
65
|
homepage_uri: https://github.com/yujideveloper/recite_csv
|
136
66
|
source_code_uri: https://github.com/yujideveloper/recite_csv
|
137
|
-
changelog_uri: https://github.com/yujideveloper/recite_csv/tree/
|
138
|
-
|
67
|
+
changelog_uri: https://github.com/yujideveloper/recite_csv/tree/main/CHANGELOG.md
|
68
|
+
rubygems_mfa_required: 'true'
|
69
|
+
post_install_message:
|
139
70
|
rdoc_options: []
|
140
71
|
require_paths:
|
141
72
|
- lib
|
@@ -143,15 +74,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
74
|
requirements:
|
144
75
|
- - ">="
|
145
76
|
- !ruby/object:Gem::Version
|
146
|
-
version: '
|
77
|
+
version: '3.0'
|
147
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
79
|
requirements:
|
149
80
|
- - ">="
|
150
81
|
- !ruby/object:Gem::Version
|
151
82
|
version: '0'
|
152
83
|
requirements: []
|
153
|
-
rubygems_version: 3.
|
154
|
-
signing_key:
|
84
|
+
rubygems_version: 3.5.3
|
85
|
+
signing_key:
|
155
86
|
specification_version: 4
|
156
87
|
summary: ReciteCSV assists to implement a class for CSV reader.
|
157
88
|
test_files: []
|