iron-import 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31bf806c52f39edb39cbd3f7f2992ff1723c562e4c3a3859be0c341165746960
4
- data.tar.gz: c140bc5f1a6affcb5e7b940a04f5a0d74c165b49ab5683815c3a63b706447c3f
3
+ metadata.gz: e0c9cad49ed06dfb8000477555421a8c109c3d13a112619039372c58ea0e3475
4
+ data.tar.gz: 9a686352b1c0158fd87fdcda9c021390e6707508dfdc77a9712f6f8a372c32e5
5
5
  SHA512:
6
- metadata.gz: 10f52ae0c423c8e9b0feb2bb560141d45a0d607be502ad74d6f1168a130e4d8932c6c28d666e94fc26344a570a6893f7828c02a854ef889018812466ac965968
7
- data.tar.gz: 9f555bcf49f432cb8e3d35f3384633741280ba4853491dcaa895895d1fd00eaef1e8a33f1f780ee7efee8659b11d4f4499b9519badf7f0d9d665460a355d1aaf
6
+ metadata.gz: 7c38498e700b3bc7174cb5cc5762c15b390cf0f9dbb83bd5af12a43fa702eed58245c43fdba71b1a201fc0c8bab5c79e3aa287c82bd1074cf1a9844318beb702
7
+ data.tar.gz: 24b26fec53dfb0b348413754e66b628aa1008eaf98e6c5fbaacb5b546ba7c3bff969e96657b0866ee5f0dc591f1c4a32f2a2cd9b89e7908eb057e22d7b98209d
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.8.7 / 2018-05-03
2
+ * Improve Importer#read_lines and Importer#import to rewind the stream at end of processing
3
+
1
4
  == 0.8.6 / 2018-04-11
2
5
  * Add Importer#read_lines to allow reading an arbitrary number of raw rows from a file with format detection
3
6
 
data/Version.txt CHANGED
@@ -1 +1 @@
1
- 0.8.6
1
+ 0.8.7
@@ -146,6 +146,7 @@ class Importer
146
146
  if supports_stream?
147
147
  # Stream loader defined, run it
148
148
  load_each(:stream, path_or_stream, scopes, &block)
149
+ path_or_stream.rewind
149
150
  else
150
151
  # Write to temp file, as some of our readers only read physical files, annoyingly
151
152
  file = Tempfile.new(['importer', ".#{format}"])
@@ -157,6 +158,7 @@ class Importer
157
158
  ensure
158
159
  file.close
159
160
  file.unlink
161
+ path_or_stream.rewind
160
162
  end
161
163
  end
162
164
 
@@ -328,4 +328,11 @@ describe Importer do
328
328
  ]
329
329
  end
330
330
 
331
+ it 'should rewind stream after reading' do
332
+ stream = File.open(SpecHelper.sample_path('2-sheets.xlsx'))
333
+ stream.pos.should == 0
334
+ rows = Importer.read_lines(2, stream, :scope => 'Sheet 2')
335
+ stream.pos.should == 0
336
+ end
337
+
331
338
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron-import
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Morris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-11 00:00:00.000000000 Z
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iron-extensions