Class: Watchr::Analyse
- Inherits:
-
Object
- Object
- Watchr::Analyse
- Defined in:
- lib/watchr/analyse.rb
Overview
Code analyse information for a given path. Returns list of files, each containing its own detailed data for used metrics.
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Analysed file data.
-
#path ⇒ Object
readonly
Analysed file data.
Instance Method Summary collapse
-
#initialize(path) ⇒ Analyse
constructor
Run the analyse.
Constructor Details
#initialize(path) ⇒ Analyse
Run the analyse.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/watchr/analyse.rb', line 23 def initialize(path) files = Paths.files_by_dirs(['rb'], path) # Flay essentially cant be done on file level because its first class # citizen is duplication of code between files. Its done once for all # the files in the analyse and results are injected to the proper file # later. # flay = Watchr::FlayMetric::Report.new(files) # Create report for each file. @files = files.map do |file| Watchr::FileAnalyse.new(file).tap { |file| # file.flay(flay.duplications_by_file(file)) } end @path = path end |
Instance Attribute Details
#files ⇒ Object (readonly)
Analysed file data.
16 17 18 |
# File 'lib/watchr/analyse.rb', line 16 def files @files end |
#path ⇒ Object (readonly)
Analysed file data.
16 17 18 |
# File 'lib/watchr/analyse.rb', line 16 def path @path end |