censive 0.11 → 0.12
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/censive.gemspec +1 -1
- data/lib/censive.rb +8 -2
- 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: 3343af27996e08f7c83ae7327e60fc8c225095c457be3141a471f105d596e165
|
4
|
+
data.tar.gz: 4ccdfe64a1314628ca9070c5a50678c29933ba87c11b160ec25494a21772090b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b5e4d4e3f3f0ec4898fe91ef0f4033c068c68f79fe1acf0f41e45a9d96380751fed6a852920e2a9aa1ae2e477750d972a2838ba5fc7212ea940af534560d183
|
7
|
+
data.tar.gz: f58137689118ff3546d9d973ffdd5f9a7f686aa61e4d813e2adf7557b6d0e6303b8f9d9d21bc084ba82f73c50119c522049a066757ab7cead0d5d69dc6037d63
|
data/censive.gemspec
CHANGED
data/lib/censive.rb
CHANGED
@@ -143,7 +143,7 @@ class Censive < StringScanner
|
|
143
143
|
|
144
144
|
# returns 2 (must be quoted and escaped), 1 (must be quoted), 0 (neither)
|
145
145
|
def grok(str)
|
146
|
-
if idx = str.index(/(#{@quote})|#{@sep}|#{@cr}|#{@lf}/o) #!# FIXME: regex injection
|
146
|
+
if idx = str.index(/(#{@quote})|#{@sep}|#{@cr}|#{@lf}/o) #!# FIXME: regex injection?
|
147
147
|
$1 ? 2 : str.index(/#{@quote}/o, idx) ? 2 : 1
|
148
148
|
else
|
149
149
|
0
|
@@ -177,7 +177,13 @@ class Censive < StringScanner
|
|
177
177
|
end
|
178
178
|
end
|
179
179
|
when :full
|
180
|
-
|
180
|
+
if @excel
|
181
|
+
row.map do |col|
|
182
|
+
col =~ /\A0\d*\z/ ? "=#{q}#{col}#{q}" : "#{q}#{col.gsub(q, @esc)}#{q}"
|
183
|
+
end
|
184
|
+
else
|
185
|
+
row.map {|col| "#{q}#{col.gsub(q, @esc)}#{q}" }
|
186
|
+
end
|
181
187
|
end.join(s)
|
182
188
|
|
183
189
|
@out << out + @eol
|
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.
|
4
|
+
version: '0.12'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Shreeve
|
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
|
-
rubygems_version: 3.4.
|
57
|
+
rubygems_version: 3.4.6
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: A quick and lightweight CSV handling library for Ruby
|