lib/vas/shared/logs.rb
# Retrieves the content of the log from the server
#
# @param [Hash] options the options that control the content that is returned
#
# @option options [Integer] :start_line the start point, in lines, of the content to pass to
#   the block. Omitting the parameter will result in content from the start of the file being
#   passed. If the provided value is greater than the number of lines in the file, no content
#   will be passed.
#
# @option options [Integer] :end_line the end point, in lines, of the content to pass to the
#   block. Omitting the parameter will result in content up to the end of the file being
#   passed. If the provided value is greater than the number of lines in the file, content up
#   to and including the last line in the file will be passed.
#
# @yield [chunk] a chunk of the log's content
#
# @return [void]
Retrieves the content of the log from the server
Retrieves the content of the log from the server
def content(options = {}, &block)
      query=""
      if (!options[:start_line].nil?)
        query << "start-line=#{options[:start_line]}"
      end
      if (!options[:end_line].nil?)
        if (query.length > 0)
          query << '&'
        end
        query << "end-line=#{options[:end_line]}"
      end
      if (query.length > 0)
        client.get_stream("#{@content_location}?#{query}", &block)
      else
        client.get_stream(@content_location, &block)
      end
    end
def content ( options = { } , & block ) query = "" if ( ! options [ :start_line ] . nil? ) query << "start-line=#{options[:start_line]}" end if ( ! options [ :end_line ] . nil? ) if ( query . length > 0 ) query << '&' end query << "end-line=#{options[:end_line]}" end if ( query . length > 0 ) client . get_stream ( "#{@content_location}?#{query}" , & block ) else client . get_stream ( @content_location , & block ) end end
Retrieves the content of the log from the server
Retrieves the content of the log from the server
None
void
options
:end_line the end point, in lines, of the content to pass to the block. Omitting the parameter will result in content up to the end of the file being passed. If the provided value is greater than the number of lines in the file, content up to and including the last line in the file will be passed.
: end_line the end point in lines of the content to pass to the block . Omitting the parameter will result in content up to the end of the file being passed . If the provided value is greater than the number of lines in the file content up to and including the last line in the file will be passed .
block
options the options that control the content that is returned
options the options that control the content that is returned
]
a chunk of the log's content
a chunk of the log ' s content