censive 1.0.2 → 1.0.4
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/lib/censive.rb +11 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14b2b860b44e06018a627322fe8cb2d6b2e437a0f24cd21ad110d6a7f8f6170e
|
4
|
+
data.tar.gz: 942fc5ddcff3239e654ba391a72209e09844ac4e9df430c762ef0d54d38095b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38677787034eb1de1d4272fe0e5b8f5629c14fe28f69d3d1b05652644fc76d3b2fcdd80bdde3c91b5c4107ec634a28f7d7e58b7f417ada84fa2190d76ba3c2d5
|
7
|
+
data.tar.gz: 1f6496e143fd7ee75cea6797cf59f55fdda5fc877a5aeb53580de0680827666e66f97b15018db7fd197169366af8ce1f09e2f9a8a014eea70faf784bdb276ef6
|
data/lib/censive.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# censive - A quick and lightweight CSV handling library for Ruby
|
5
5
|
#
|
6
6
|
# Author: Steve Shreeve (steve.shreeve@gmail.com)
|
7
|
-
# Date:
|
7
|
+
# Date: June 16, 2023
|
8
8
|
#
|
9
9
|
# https://crystal-lang.org/api/1.7.2/CSV.html (Crystal's CSV library)
|
10
10
|
# https://github.com/ruby/strscan/blob/master/ext/strscan/strscan.c
|
@@ -25,10 +25,11 @@
|
|
25
25
|
# 5. Implement support for scan_until(string) <= right now only regex is valid
|
26
26
|
# ============================================================================
|
27
27
|
|
28
|
+
require "stringio"
|
28
29
|
require "strscan"
|
29
30
|
|
30
31
|
class Censive < StringScanner
|
31
|
-
VERSION="1.0.
|
32
|
+
VERSION="1.0.4"
|
32
33
|
|
33
34
|
attr :encoding, :out, :rows
|
34
35
|
|
@@ -94,14 +95,14 @@ class Censive < StringScanner
|
|
94
95
|
|
95
96
|
# regexes
|
96
97
|
xsep = Regexp.escape(@sep) # may need to be escaped
|
97
|
-
@eoc = /(?=#{"\\" + xsep}|#{@cr}|#{@lf}|\z)/
|
98
|
-
@eol = /#{@cr}#{@lf}?|#{@lf}/
|
99
|
-
@escapes = /(#{@quote})|#{xsep}|#{@cr}|#{@lf}/
|
100
|
-
@quotable = /#{xsep}|#{@cr}|#{@lf}/
|
101
|
-
@quotes = /#{@quote}/
|
102
|
-
@seps = /#{xsep}+/
|
103
|
-
@quoted = @excel ? /(?:=)?#{@quote}/
|
104
|
-
@unquoted = /[^#{xsep}#{@cr}#{@lf}][^#{@quote}#{@cr}#{@lf}]*/
|
98
|
+
@eoc = /(?=#{"\\" + xsep}|#{@cr}|#{@lf}|\z)/ # end of cell
|
99
|
+
@eol = /#{@cr}#{@lf}?|#{@lf}/ # end of line
|
100
|
+
@escapes = /(#{@quote})|#{xsep}|#{@cr}|#{@lf}/
|
101
|
+
@quotable = /#{xsep}|#{@cr}|#{@lf}/
|
102
|
+
@quotes = /#{@quote}/
|
103
|
+
@seps = /#{xsep}+/
|
104
|
+
@quoted = @excel ? /(?:=)?#{@quote}/ : @quote
|
105
|
+
@unquoted = /[^#{xsep}#{@cr}#{@lf}][^#{@quote}#{@cr}#{@lf}]*/
|
105
106
|
@leadzero = /\A0\d*\z/
|
106
107
|
|
107
108
|
yield self if block_given?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: censive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Shreeve
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A quick and lightweight CSV handling library for Ruby
|
14
14
|
email: steve.shreeve@gmail.com
|
@@ -47,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
requirements: []
|
50
|
-
rubygems_version: 3.4.
|
50
|
+
rubygems_version: 3.4.14
|
51
51
|
signing_key:
|
52
52
|
specification_version: 4
|
53
53
|
summary: A quick and lightweight CSV handling library for Ruby
|