Class: Sloc::Runner
- Inherits:
-
Object
- Object
- Sloc::Runner
- Defined in:
- lib/sloc/runner.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #raw_report(paths) ⇒ Object
- #report(paths) ⇒ Object
- #run(paths) ⇒ Object
Constructor Details
Instance Method Details
#raw_report(paths) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/sloc/runner.rb', line 19 def raw_report(paths) target_files = find_target_files(paths) # TODO: count sloc report = target_files.each_with_object({}) do |path, h| code = File.read(path) extension = File.extname(path) h[path] = @analyzer.analyze(code, extension) end (report) end |
#report(paths) ⇒ Object
14 15 16 17 |
# File 'lib/sloc/runner.rb', line 14 def report(paths) require 'pp' PP.pp(raw_report(paths), '') end |
#run(paths) ⇒ Object
10 11 12 |
# File 'lib/sloc/runner.rb', line 10 def run(paths) report(paths) end |