censive 0.21 → 0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/censive.gemspec +1 -1
- data/lib/censive.rb +7 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f9bbebb5cd4aba5b0d22ec2f87e129a47292fc999ada61284ea53e5458c1d42
|
4
|
+
data.tar.gz: 9db7f322767ab0fe4275e2c40c0e466dd3654b1180aed55a4aa8826bddee3f78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6b3eda844db32d8f50a9972eff3a2c1d690dc8bdcc0eb0276df6dea722d6a45790236e2b0dfaceb17555e153ce44f54c7b18df961babea70ac764ca03aeffa5
|
7
|
+
data.tar.gz: f3c153d47ddc3e2e27be33407d0ca9159776590d42b79e4cfa41c932b9cde3daa3dfdc68de238b3e34a243bc6aff4cfc34df7cc0a1b1aafc27cd0a77c185a8fa
|
data/censive.gemspec
CHANGED
data/lib/censive.rb
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
require "strscan"
|
29
29
|
|
30
30
|
class Censive < StringScanner
|
31
|
-
attr :encoding, :out
|
31
|
+
attr :encoding, :out, :rows
|
32
32
|
|
33
33
|
def self.parse(...)
|
34
34
|
new(...).parse
|
@@ -180,9 +180,9 @@ class Censive < StringScanner
|
|
180
180
|
end
|
181
181
|
|
182
182
|
def export(**opts)
|
183
|
-
|
184
|
-
each {|row|
|
185
|
-
|
183
|
+
dest = opts.empty? ? self : self.class.writer(**opts)
|
184
|
+
each {|row| dest << row }
|
185
|
+
dest
|
186
186
|
end
|
187
187
|
|
188
188
|
# ==[ Helpers ]==
|
@@ -259,7 +259,9 @@ if __FILE__ == $0
|
|
259
259
|
# csv.export(out: out) # (excel: true) # sep: "|")
|
260
260
|
# puts out # .string
|
261
261
|
|
262
|
-
|
262
|
+
csv = Censive.new(str, excel: true, relax: true, out: "")
|
263
|
+
out = csv.export
|
264
|
+
puts out.out
|
263
265
|
end
|
264
266
|
|
265
267
|
__END__
|