strong_csv 0.8.4 → 0.8.6
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/README.md +1 -1
- data/lib/strong_csv/let.rb +2 -2
- data/lib/strong_csv/type_wrapper.rb +1 -1
- data/lib/strong_csv/version.rb +1 -1
- data/sig/strong_csv.rbs +2 -2
- metadata +32 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 642cc6ac08fe76d56643c190d645fc65f4c5d8a7dbe8a304ad38c265918ae40e
|
|
4
|
+
data.tar.gz: b83f3232be02019f69ee13774a2b0299bacb25810ed7b7b35bd5b2e68126332f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a9d429bfef2e5c40ff3c1b1e9d37f299f2f0f66607b5fc513357a1d03b8b20a16721ead6b12c1a7e8533ad8b31d8c35fea777c870a70c6ee9cfd8b5a912646dc
|
|
7
|
+
data.tar.gz: 4d393b455dbcd89a8a6fd051f781c6776ed5ae5c802ab582898843457748fb37d10d0cdd94c7b430a89decd9532bc9e6267a02d402433e00ea15fcdf00833612
|
data/README.md
CHANGED
|
@@ -66,7 +66,7 @@ strong_csv = StrongCSV.new do
|
|
|
66
66
|
# Literal declaration
|
|
67
67
|
let :status, 0..6
|
|
68
68
|
let :priority, 10, 20, 30, 40, 50
|
|
69
|
-
let :size, "S", "M", "L" do |value|
|
|
69
|
+
let :size, "S", "M", "L" do |value| # The input must be one of "S", "M", or "L", and it will be casted as the returned value of the block.
|
|
70
70
|
case value
|
|
71
71
|
when "S"
|
|
72
72
|
1
|
data/lib/strong_csv/let.rb
CHANGED
|
@@ -20,8 +20,8 @@ class StrongCSV
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# @param name [String, Symbol, Integer]
|
|
23
|
-
# @param type [StrongCSV::
|
|
24
|
-
# @param types [Array<StrongCSV::
|
|
23
|
+
# @param type [StrongCSV::Types::Base]
|
|
24
|
+
# @param types [Array<StrongCSV::Types::Base>]
|
|
25
25
|
def let(name, type, *types, error_message: nil, &block)
|
|
26
26
|
type = Types::Union.new(type, *types) unless types.empty?
|
|
27
27
|
case name
|
|
@@ -9,7 +9,7 @@ class StrongCSV # rubocop:disable Style/Documentation
|
|
|
9
9
|
# @!attribute name
|
|
10
10
|
# @return [Symbol, Integer] The name for the type. This is the CSV header name. If the CSV does not have its header, Integer should be set.
|
|
11
11
|
# @!attribute type
|
|
12
|
-
# @return [StrongCSV::
|
|
12
|
+
# @return [StrongCSV::Types::Base]
|
|
13
13
|
# @!attribute error_message
|
|
14
14
|
# @return [String, nil] The error message returned if #cast fails. If omitted, the default error message will be used.
|
|
15
15
|
# @!attribute block
|
data/lib/strong_csv/version.rb
CHANGED
data/sig/strong_csv.rbs
CHANGED
|
@@ -22,9 +22,9 @@ class StrongCSV
|
|
|
22
22
|
@value: (casted)?
|
|
23
23
|
@original_value: untyped
|
|
24
24
|
|
|
25
|
-
attr_reader error_messages: [::String]?
|
|
25
|
+
attr_reader error_messages: Array[::String]?
|
|
26
26
|
|
|
27
|
-
def initialize: (original_value: ::String | nil, ?value: (casted | ::Object)?, ?error_messages: [::String]?) -> void
|
|
27
|
+
def initialize: (original_value: ::String | nil, ?value: (casted | ::Object)?, ?error_messages: Array[::String]?) -> void
|
|
28
28
|
|
|
29
29
|
def value: -> ((casted | ::Object | nil)?)
|
|
30
30
|
|
metadata
CHANGED
|
@@ -1,15 +1,42 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: strong_csv
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yutaka Kamei
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
-
dependencies:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: csv
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: forwardable
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
13
40
|
description: strong_csv is a type checker for a CSV file. It lets developers declare
|
|
14
41
|
types for each column to ensure all cells are satisfied with desired types.
|
|
15
42
|
email:
|
|
@@ -42,7 +69,6 @@ licenses:
|
|
|
42
69
|
metadata:
|
|
43
70
|
homepage_uri: https://github.com/yykamei/strong_csv
|
|
44
71
|
rubygems_mfa_required: 'true'
|
|
45
|
-
post_install_message:
|
|
46
72
|
rdoc_options: []
|
|
47
73
|
require_paths:
|
|
48
74
|
- lib
|
|
@@ -57,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
57
83
|
- !ruby/object:Gem::Version
|
|
58
84
|
version: '0'
|
|
59
85
|
requirements: []
|
|
60
|
-
rubygems_version: 3.
|
|
61
|
-
signing_key:
|
|
86
|
+
rubygems_version: 3.6.9
|
|
62
87
|
specification_version: 4
|
|
63
88
|
summary: Type check CSV objects
|
|
64
89
|
test_files: []
|