Skip to content

Commit

Permalink
Handling scratch files which have a size of 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
khall authored and jscruggs committed Jun 12, 2009
1 parent 550ebe5 commit 67ea48f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/generators/saikuro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def initialize(path)

def self.is_valid_text_file?(path)
File.open(path, "r") do |f|
unless f.readline.match /--/
if f.eof? || !f.readline.match /--/
return false
else
return true
Expand All @@ -125,8 +125,8 @@ def to_h
def get_elements
begin
while ( line = @file_handle.readline) do
element ||= nil
while (line = @file_handle.readline) do
return [] if line.blank?
if line.match /START/
unless element.nil?
@elements << element
Expand Down

0 comments on commit 67ea48f

Please sign in to comment.