tempfile_for 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,9 +8,7 @@ module TempfileFor
8
8
 
9
9
  tempfile = self.class.open("tempfile", :encoding => encoding)
10
10
 
11
- File.open path, :encoding => encoding do |stream|
12
- tempfile.write_ext stream
13
- end
11
+ File.open(path, :encoding => encoding) { |stream| tempfile.write_ext stream }
14
12
 
15
13
  tempfile.rewind
16
14
  tempfile
@@ -18,7 +16,9 @@ module TempfileFor
18
16
 
19
17
  def write_ext(io_or_data)
20
18
  if io_or_data.respond_to?(:read)
21
- write(io_or_data.read(1024)) until io_or_data.eof?
19
+ while data = io_or_data.read(1024)
20
+ write data
21
+ end
22
22
  else
23
23
  write io_or_data
24
24
  end
@@ -1,3 +1,3 @@
1
1
  module TempfileFor
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tempfile_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: