lib/rio/if/grande_stream.rb in rio-0.3.9 vs lib/rio/if/grande_stream.rb in rio-0.4.0

- old
+ new

@@ -89,11 +89,11 @@ # def lines(*args,&block) target.lines(*args,&block); self end # Sets the rio to read bytes and returns the rio # - # _n_ specifies the number of bytes to be returned on each iteration of IF::Grande#each or by IF::Grande#getrec. If _args_ + # _n_ specifies the number of bytes to be returned on each iteration of IF::Grande#each or by IF::GrandeStream#getrec. If _args_ # are provided, they are treated as record selectors as if <tt>ario.bytes(n).records(*args)</tt> had been # called. See also #records, #lines, IF::Grande#each, IF::Grande#[] # # If called with a block behaves as if <tt>ario.bytes(n,*args).each(&block)</tt> had been called # @@ -113,23 +113,23 @@ # rio('f.dat').bytes[0...100] # returns an array of the first 100 bytes of f.dat # def bytes(n=1,*args,&block) target.bytes(n,*args,&block); self end - # Specifies which records will be iterated through by IF::Grande#each or returned by IF::Grande#getrec + # Specifies which records will be iterated through by IF::Grande#each or returned by IF::GrandeStream#getrec # # If called with a block behaves as if <tt>records(*args).each(&block)</tt> had been called # # Returns the Rio # # If no args are provided, all records are selected. # What constitutes a record is affected by #lines,#bytes, # and extensions such as IF::CSV#csv and IF::YAML#yaml. # # If args are provided they may be one or more of the following: - # Regexp:: any matching record will be iterated over by IF::Grande#each or returned by IF::Grande#getrec - # Integer:: specifies a record-number (zero-based) to be iterated over by IF::Grande#each or returned by IF::Grande#getrec + # Regexp:: any matching record will be iterated over by IF::Grande#each or returned by IF::GrandeStream#getrec + # Integer:: specifies a record-number (zero-based) to be iterated over by IF::Grande#each or returned by IF::GrandeStream#getrec # Range:: specifies a range of records (zero-based) to included in the iteration # Proc:: a proc which will be called for each record, records are included unless nil or false is returned # Symbol:: a symbol which will _sent_ to each record, records are included unless nil or false is returned # Array:: an array of any of above. All must match for a line to be included # @@ -155,11 +155,11 @@ # rio('f.csv').csv.records[0] #==>[["h0", "h1"]] # def records(*args,&block) target.records(*args,&block); self end - # Specifies records which should *not* be iterated through by IF::Grande#each or returned by IF::Grande#getrec + # Specifies records which should *not* be iterated through by IF::Grande#each or returned by IF::GrandeStream#getrec # # If called with a block behaves as if <tt>skiprecords(*args).each(&block)</tt> # had been called # # Returns the Rio @@ -188,11 +188,11 @@ # def skiprecords(*args,&block) target.skiprecords(*args,&block); self end # Sets the Rio to read lines and specifies lines which should *not* be iterated through by IF::Grande#each or - # returned by IF::Grande#getrec + # returned by IF::GrandeStream#getrec # # If called with a block behaves as if <tt>skiplines(*args).each(&block)</tt> had been called # # Returns the Rio # @@ -215,18 +215,18 @@ # def skiplines(*args,&block) target.skiplines(*args,&block); self end # Sets the Rio to read rows and specifies rows which should be iterated through - # by IF::Grande#each or returned by IF::Grande#getrec. + # by IF::Grande#each or returned by IF::GrandeStream#getrec. # #rows is intended for use by extensions, where the concept of a row is reasonable. # In the absensence of an extension behaves like #records. def rows(*args,&block) target.rows(*args,&block); self end # Sets the Rio to read rows and specifies lines which should *not* be iterated - # through by IF::Grande#each or returned by IF::Grande#getrec + # through by IF::Grande#each or returned by IF::GrandeStream#getrec # #skiprows is intended for use by extensions, where the concept of a row is # reasonable. In the absence of an extension behaves like #skiprecords def skiprows(*args,&block) target.skiprows(*args,&block); self end @@ -356,9 +356,11 @@ # Sets the implicit output mode to 'w+'. # # The implicit output mode is the mode Rio will use for output when no mode is specified. # # Returns the Rio + # + # rio(?-,'cat').w!.puts!("Hello Kitty").readline #=> "Hello Kitty" # # See the discussion for #a. # def w!() target.w!(); self end