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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c298ef2aa39df7011b9d1afc8c560f3dd592a50a19ec0263eedab8161ccb5862
4
- data.tar.gz: 898cc5881c87e69528cb6f5f0706f0ea7b06f53b135c749b1659257b90f4c308
3
+ metadata.gz: 90a7dbd617f57a71f28be00e86a5f492010cb042175f78f1b9ba9dcf024d8f56
4
+ data.tar.gz: bc47489c30d200d851751ad170012d44029e10ef45c9143fccd57985f5c7b6c5
5
5
  SHA512:
6
- metadata.gz: e60318a166eb1cf3ee24985768160abae268ce240bf4c14ffa746cf036182913b8dd7e5b9831b68c62420d39af26517eabf2b9e0e52a0fb06491badeef78e166
7
- data.tar.gz: f1a8a86af8299d4ff2344bc44460457bd00f094b36e8d71ade70ea09c4511966cdce2c2bd219eec99cc17259116d76fd03ee043e26f2533d872e63b40c4650a5
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
@@ -1,7 +1,8 @@
1
1
  require: rubocop-performance
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.4
4
+ TargetRubyVersion: 3.0
5
+ NewCops: enable
5
6
 
6
7
  Style/AsciiComments:
7
8
  Enabled: false
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
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017-2020 Yuji Hanamura
3
+ Copyright (c) 2017-2023 Yuji Hanamura
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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 Status](https://travis-ci.org/yujideveloper/recite_csv.svg?branch=master)](https://travis-ci.org/yujideveloper/recite_csv)
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 block_given?
18
+ klass.class_exec(&block) if block
17
19
  end
18
20
  end
19
21
 
@@ -16,7 +16,7 @@ module ReciteCSV
16
16
  end
17
17
 
18
18
  def each(&block)
19
- if block_given?
19
+ if block
20
20
  _each(&block)
21
21
  else
22
22
  self.to_enum
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReciteCSV
4
- VERSION = "2.0.0"
4
+ VERSION = "2.1.0"
5
5
  end
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| # rubocop:disable Metrics/BlockLength
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/master/CHANGELOG.md"
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 = ">= 2.4"
37
+ spec.required_ruby_version = ">= 3.0"
36
38
 
37
- spec.add_development_dependency "bundler", ">= 1.14"
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.0.0
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: 2020-01-09 00:00:00.000000000 Z
11
+ date: 2023-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: csv
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.14'
20
- type: :development
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: '1.14'
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/master/CHANGELOG.md
138
- post_install_message:
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: '2.4'
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.1.2
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: []
data/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.9
5
- - 2.5.7
6
- - 2.6.5
7
- - 2.7.0
8
- script:
9
- - bundle exec rake spec