Class: Fukuzatsu::Parser
- Inherits:
-
Object
- Object
- Fukuzatsu::Parser
- Defined in:
- lib/fukuzatsu/parser.rb
Constant Summary collapse
- DEFAULT_OUTPUT_DIRECTORY =
"doc/fukuzatsu/"
Instance Attribute Summary collapse
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
-
#path_to_files ⇒ Object
readonly
Returns the value of attribute path_to_files.
-
#threshold ⇒ Object
readonly
Returns the value of attribute threshold.
Instance Method Summary collapse
- #explain ⇒ Object
-
#initialize(path_to_files, formatter, threshold, output_path = nil) ⇒ Parser
constructor
A new instance of Parser.
- #report ⇒ Object
Constructor Details
#initialize(path_to_files, formatter, threshold, output_path = nil) ⇒ Parser
Returns a new instance of Parser.
12 13 14 15 16 17 |
# File 'lib/fukuzatsu/parser.rb', line 12 def initialize(path_to_files, formatter, threshold, output_path=nil) @path_to_files = path_to_files @formatter = formatter @threshold = threshold @output_path = output_path || DEFAULT_OUTPUT_DIRECTORY end |
Instance Attribute Details
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
8 9 10 |
# File 'lib/fukuzatsu/parser.rb', line 8 def formatter @formatter end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
8 9 10 |
# File 'lib/fukuzatsu/parser.rb', line 8 def output_path @output_path end |
#path_to_files ⇒ Object (readonly)
Returns the value of attribute path_to_files.
8 9 10 |
# File 'lib/fukuzatsu/parser.rb', line 8 def path_to_files @path_to_files end |
#threshold ⇒ Object (readonly)
Returns the value of attribute threshold.
8 9 10 |
# File 'lib/fukuzatsu/parser.rb', line 8 def threshold @threshold end |
Instance Method Details
#explain ⇒ Object
19 20 21 22 |
# File 'lib/fukuzatsu/parser.rb', line 19 def explain puts "Processed #{summaries.count} file(s)." puts "Results written to #{output_path}." if formatter.writes_to_file_system? end |
#report ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/fukuzatsu/parser.rb', line 24 def report self.formatter.reset_output_directory(output_path) self.formatter.index(summaries, output_path) summaries.uniq(&:container_name).each do |summary| self.formatter.new(summary: summary, base_output_path: self.output_path).export end explain check_complexity end |