Class: Glyph::Reporter

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/glyph/reporter.rb

Overview

This class is used to display statistics collected by a Glyph::Analyzer.

Since:

  • 0.4.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#clean_xml_document, #complex_output?, #current_output_setting, #debug, #error, #file_copy, #file_load, #file_write, #info, #load_files_from_dir, #macro_alias?, #macro_aliases_for, #macro_definition_for, #macro_eq?, #msg, #multiple_output_files?, #project?, #run_external_command, #titled_sections, #warning, #with_files_from, #yaml_dump, #yaml_load

Constructor Details

#initialize(stats) ⇒ Reporter

Initializes the reporter

Parameters:

  • stats (Hash)

    the collected statistics

Since:

  • 0.4.0



15
16
17
18
# File 'lib/glyph/reporter.rb', line 15

def initialize(stats)
	@stats = stats
	@detailed = true
end

Instance Attribute Details

#detailedObject

Since:

  • 0.4.0



11
12
13
# File 'lib/glyph/reporter.rb', line 11

def detailed
  @detailed
end

Instance Method Details

#displayObject

Displays the statistics

Since:

  • 0.4.0



21
22
23
24
25
26
27
28
29
# File 'lib/glyph/reporter.rb', line 21

def display
	[:files, :macros, :snippets, :bookmarks, :links, 
		:macro, :snippet, :bookmark, :link].each do |s|
		unless @stats[s].blank? then
			send :"display_#{s}" 
			puts
		end
	end
end