censive 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/censive.rb +10 -10
- metadata +2 -2
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
|
@@ -29,7 +29,7 @@ require "stringio"
|
|
29
29
|
require "strscan"
|
30
30
|
|
31
31
|
class Censive < StringScanner
|
32
|
-
VERSION="1.0.
|
32
|
+
VERSION="1.0.4"
|
33
33
|
|
34
34
|
attr :encoding, :out, :rows
|
35
35
|
|
@@ -95,14 +95,14 @@ class Censive < StringScanner
|
|
95
95
|
|
96
96
|
# regexes
|
97
97
|
xsep = Regexp.escape(@sep) # may need to be escaped
|
98
|
-
@eoc = /(?=#{"\\" + xsep}|#{@cr}|#{@lf}|\z)/
|
99
|
-
@eol = /#{@cr}#{@lf}?|#{@lf}/
|
100
|
-
@escapes = /(#{@quote})|#{xsep}|#{@cr}|#{@lf}/
|
101
|
-
@quotable = /#{xsep}|#{@cr}|#{@lf}/
|
102
|
-
@quotes = /#{@quote}/
|
103
|
-
@seps = /#{xsep}+/
|
104
|
-
@quoted = @excel ? /(?:=)?#{@quote}/
|
105
|
-
@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}]*/
|
106
106
|
@leadzero = /\A0\d*\z/
|
107
107
|
|
108
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
|