censive 0.18 → 0.19

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 +5 -8
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3e3d32cc23e58416e6d9c2f962be016beff4f1555af801e969032162fcb9f95
4
- data.tar.gz: 405c48fba04cbf797354d0732a6ccc9238a5d198469a6d927fc37de86da5eaa7
3
+ metadata.gz: ff272ee20f4d6b15b65622fa444b494cd58fd01c651b6b6e3685539c0633299d
4
+ data.tar.gz: e7a5890bf19b674fa63c8268c8f7a6895f9811984ade1368823ee273dc30aa01
5
5
  SHA512:
6
- metadata.gz: 5afd52cdd519854a78977d778c05f0f9bad02bad177523e79c4f3fc96e4291178a2186f021d8a40d1be8ec16d1bc659a3a18a49721994d4c7326a90006362398
7
- data.tar.gz: 378b0f4a3e289a0a1244d0a69ade975d15e6fae99b000d00d507e8ebd1ae0d29605b43bbb08e25b18f0306d3e54eb327f75f94e390de0fe3cb02da2fafe7185b
6
+ metadata.gz: 3156bc0abdf0b59d4f95be11e396f18421a17bf21b0e0cdc4c6e9b63f864ac9bb75a5db6480df07fba82633a11ce4b43dd24e917352f15f2db27de517a08f314
7
+ data.tar.gz: cc688477d6b85152241fd6619cd58441c4805f1cef762a819de2e7a69cb4a5ba4f2b2a688a9e32590dbe32ef4c0fdbd796d8ffe2607ae635b192da04054ad571
data/censive.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "censive"
3
- s.version = "0.18"
3
+ s.version = "0.19"
4
4
  s.author = "Steve Shreeve"
5
5
  s.email = "steve.shreeve@gmail.com"
6
6
  s.summary =
data/lib/censive.rb CHANGED
@@ -47,9 +47,13 @@ class Censive < StringScanner
47
47
  strip: false , # strip fields when reading
48
48
  **opts # grab bag
49
49
  )
50
+ # data source
51
+ str = File.open(str, "r:#{encoding}").read if !str[100] && File.readable?(str)
52
+ super(str)
53
+ reset
54
+
50
55
  # options
51
56
  @drop = drop
52
- @encoding = encoding
53
57
  @excel = excel
54
58
  @mode = mode
55
59
  @out = out
@@ -67,13 +71,6 @@ class Censive < StringScanner
67
71
  @esc = (@quote * 2)
68
72
  @eol = /#{@cr}#{@lf}?|#{@lf}|\z/o # end of line
69
73
  @eoc = /(?=#{"\\" + @sep}|#{@cr}|#{@lf}|\z)/o # end of cell
70
-
71
- # data source
72
- if str.size < 100 && File.readable?(str)
73
- str = File.open(str, "r:#{encoding}").read
74
- end
75
- super(str)
76
- reset
77
74
  end
78
75
 
79
76
  def reset(str=nil)
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.18'
4
+ version: '0.19'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve