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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/censive.rb +11 -10
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25f6217fb31687025a210892368bc405a34cc6628a5736f28f02ed02d76d93f1
4
- data.tar.gz: daebdb56f27c498e1c0268a2bdc0df927242f193404d1f2bb8dd9995ec1a79ad
3
+ metadata.gz: 14b2b860b44e06018a627322fe8cb2d6b2e437a0f24cd21ad110d6a7f8f6170e
4
+ data.tar.gz: 942fc5ddcff3239e654ba391a72209e09844ac4e9df430c762ef0d54d38095b4
5
5
  SHA512:
6
- metadata.gz: a6a1770695f7a9974ab0add960b9f8f6c1430746006899f04245a2dcd6c584a9227b596bd1d6d6a6a3c9d9229a420e7ae69e29944ce08d9fbd3b448fbb2b37c8
7
- data.tar.gz: 991e9eca701c3c51ca72c6615bd322b9032b1e7642c96693fa02125629787e15a6193b4ac67b573406d03b0bdc5591e18152ca822d4ea105c8397c243bd42586
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: Mar 22, 2023
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.2"
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)/o # end of cell
98
- @eol = /#{@cr}#{@lf}?|#{@lf}/o # end of line
99
- @escapes = /(#{@quote})|#{xsep}|#{@cr}|#{@lf}/o
100
- @quotable = /#{xsep}|#{@cr}|#{@lf}/o
101
- @quotes = /#{@quote}/o
102
- @seps = /#{xsep}+/o
103
- @quoted = @excel ? /(?:=)?#{@quote}/o : @quote
104
- @unquoted = /[^#{xsep}#{@cr}#{@lf}][^#{@quote}#{@cr}#{@lf}]*/o
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.2
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-08 00:00:00.000000000 Z
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.1
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