lib/alf/reader.rb
# Coerces the input object to an IO and yields the block with it.
#
# StringIO and IO input are yield directly while file paths are first
# opened in read mode and then yield.
Coerces the input object to an IO and yields the block with it.
StringIO and IO input are yield directly while file paths are first
opened in read mode and then yield.
Coerces the input object to an IO and yields the block with it . StringIO and IO input are yield directly while file paths are first opened in read mode and then yield .
def with_input_io(&bl)
      case input
      when IO, StringIO
        begin
          input.rewind unless input.pos==0
        rescue Errno::ESPIPE => ex
        end
        yield input
      when String, Path
        Path(input).open('r', &bl)
      else
        raise "Unable to convert `#{input}` to an IO object"
      end
    end
def with_input_io ( & bl ) case input when IO , StringIO begin input . rewind unless input . pos == 0 rescue Errno :: ESPIPE => ex end yield input when String , Path Path ( input ) . open ( 'r' , & bl ) else raise "Unable to convert `#{input}` to an IO object" end end
Coerces the input object to an IO and yields the block with it.
Coerces the input object to an IO and yields the block with it .
bl
<not_specific>