code: public static <T> T eachLine(CharSequence self, @ClosureParams(value=FromString.class, options={"String","String,Integer"}) Closure<T> closure) throws IOException {
          return eachLine(self.toString(), 0, closure);
      }
docs: Iterates through this CharSequence line by line.  Each line is passed
  to the given 1 or 2 arg closure. If a 2 arg closure is found
  the line count is passed as the second argument.
  
  @param self    a CharSequence
  @param closure a closure
  @return the last value returned by the closure
  @throws java.io.IOException if an error occurs
  @see #eachLine(String, groovy.lang.Closure)
  @since 1.8.2