censive 0.23 → 0.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/censive.gemspec +1 -1
  3. data/lib/censive.rb +8 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a787932ff608f1df361b6faca419ce69eac2cafe853aa7c16155c5f2ace4621
4
- data.tar.gz: 1818249a3e778223297adaff85216c6497d2f802c25e77664ec1525e51dc9d2d
3
+ metadata.gz: 76c05b90f6a522a328f86d7d142ed150b33c487e74619707e10f40453c7e9079
4
+ data.tar.gz: 1e5a93d293ad708b323e20e1323926f2bf70e219ffc502e8fc87025be7be23b6
5
5
  SHA512:
6
- metadata.gz: 9ecf977a34e9cd5f86fdc8843aa64b2212bcf608a30eef579593e5af5d3c9ab00164d0dac1030738898ccfe4b541366d711ac8a029b2f907071c113543d10003
7
- data.tar.gz: 90780a1b7ca9be28eb7e83392ba00f0d4a7374c05b91845605cf9f8c64d58d5e187d468de96dfabe2126f331944ca94b4d4f5af286750c054db13731bfe8830d
6
+ metadata.gz: e56b1a6a0f943d962ff8c240625a8354283fcbccd1a640cd66054873e1803779ddb36e128841590e8a8aa0022694e1e22a4fa25b6f88eba7056dc68b838262fb
7
+ data.tar.gz: 41ddfb9d77a686bef546836d0a110b9603ac7e4f205b7d9760ed37203d23f32f6ba9d2cc5fcb9f8996713fbcdec8fcb924298b1052c1ecc5e9f6442deed3078f
data/censive.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "censive"
3
- s.version = "0.23"
3
+ s.version = "0.24"
4
4
  s.author = "Steve Shreeve"
5
5
  s.email = "steve.shreeve@gmail.com"
6
6
  s.summary =
data/lib/censive.rb CHANGED
@@ -153,6 +153,7 @@ class Censive < StringScanner
153
153
  scan(@eoc) and break
154
154
  @relax or bomb "invalid character after quote"
155
155
  token << @quote + (scan_until(@quotes) or bomb "bad inline quote")
156
+ scan(@eoc) and break
156
157
  end
157
158
  scan(@sep)
158
159
  @strip ? token.strip : token
@@ -190,7 +191,7 @@ class Censive < StringScanner
190
191
  # returns 2 (must be quoted and escaped), 1 (must be quoted), 0 (neither)
191
192
  def grok(str)
192
193
  if idx = str.index(@escapes)
193
- $1 ? 2 : str.index(@quotes, idx) ? 2 : 1
194
+ $1 ? 2 : str.index(@quote, idx) ? 2 : 1
194
195
  else
195
196
  0
196
197
  end
@@ -263,10 +264,13 @@ if __FILE__ == $0
263
264
  # out = csv.export
264
265
  # puts out.out
265
266
 
266
- Censive.parse(str, excel: true, relax: true).to_csv
267
+ puts Censive.parse(str, excel: true, relax: true).to_csv
267
268
  end
268
269
 
269
270
  __END__
271
+ "AAA "BBB",CCC,"DDD"
272
+
273
+ "CHUI, LOK HANG "BENNY",224325325610,="001453","Hemoglobin A1c",=""
270
274
  "Don",="007",10,"Ed"
271
275
  Name,Age,,,Shoe,,,
272
276
  "Alice",27,5
@@ -277,6 +281,8 @@ A,B,C,D
277
281
  A,B,"C",D
278
282
  A,B,C",D
279
283
  A,B,"C",D
284
+ 08/27/2022,="73859443",="04043260",,"Crossover @ Mathilda","CHO, JOELLE "JOJO"",08/19/2022
285
+ 123,
280
286
  123,"CHO, JOELLE "JOJO"",456
281
287
  123,"CHO, JOELLE ""JOJO""",456
282
288
  =,=x,x=,="x",="","","=",123,0123,="123",="0123"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: censive
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.23'
4
+ version: '0.24'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve