Skip to content

Commit

Permalink
Fix unitialized instance var warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbuenemann committed Oct 30, 2017
1 parent 9ca621e commit 1752e2c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/xlsxtream/io/directory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module IO
class Directory
def initialize(path)
@path = Pathname(path)
@file = nil
end

def <<(data)
Expand All @@ -19,7 +20,7 @@ def add_file(path)
end

def close
@file.close if @file.respond_to? :close
@file.close if @file
end
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/xlsxtream/io/stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module IO
class Stream
def initialize(stream)
@stream = stream
@path = nil
end

def <<(data)
Expand Down
1 change: 1 addition & 0 deletions lib/xlsxtream/io/zip_tricks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module IO
class ZipTricks
def initialize(body)
@streamer = ::ZipTricks::Streamer.new(body)
@wf = nil
end

def <<(data)
Expand Down
2 changes: 2 additions & 0 deletions lib/xlsxtream/workbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ def initialize(output, options = {})
@file = File.open(output, 'wb')
@io = IO::ZipTricks.new(@file)
elsif output.respond_to? :add_file
@file = nil
@io = output
else
@file = nil
@io = IO::ZipTricks.new(output)
end
@sst = SharedStringTable.new
Expand Down

0 comments on commit 1752e2c

Please sign in to comment.