Sha256: 1d733f07cf2445eedc78800c4a6b0b4b70f0ef80e8ce566d51728b7a33cb2d23

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

module Coco

  # Contextual information for ERB template, representing each covered files.
  class Context

    # Public: Initialize a Context for a covered file shown in the HTML
    # report.
    #
    # filename - A String name of the source file.
    # lines    - An Array of lines.
		def initialize(filename, lines)
			@filename = filename
      @lines = lines
		end
		
    # Public: Get the object's binding.
    #
    # Returns Binding.
		def get_binding
			binding
		end
	end

  # Contextual information for ERB template, representing index.html.
  class IndexContext

    # Public: Initialize an IndexContext for the index file in the HTML
    # report.
    #
    # title     - The String title for the report.
    # covered   - Array of subarrays. Each subarray is:
    #             [
    #               Fixnum coverage percentage,
    #               String formatted filename (HTML ready),
    #               String real filename
    #             ]
    #             FIXME Need a class to handle subarrays.
    # uncovered - Array of String filenames. The filenames are already
    #             formatted, ready to be display in an HTML file.
    #
		def initialize(title, covered, uncovered)
			@title = title
      @covered = covered
      @uncovered = uncovered
		end
		
    # Public: Get the object's binding.
    #
    # Returns Binding.
		def get_binding
			binding
		end
	end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
coco-0.13.0 lib/coco/formatter/context.rb