Class: Puncsig::Report
- Inherits:
-
Object
- Object
- Puncsig::Report
- Defined in:
- lib/puncsig.rb
Instance Method Summary collapse
-
#initialize(*filename_methods) ⇒ Report
constructor
A new instance of Report.
- #run ⇒ Object
Constructor Details
#initialize(*filename_methods) ⇒ Report
Returns a new instance of Report.
55 56 57 |
# File 'lib/puncsig.rb', line 55 def initialize(*filename_methods) @filenames = filename_methods.flatten end |
Instance Method Details
#run ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/puncsig.rb', line 59 def run parser = Parser.new @filenames.each do |filename| file_report = parser.parse(filename) len = file_report.method_names.map(&:size).max puts file_report.filename file_report.method_sigs.sort_by { |n, s| -s.size }.each do |name, sig| print "#{name}:".ljust(len + 3) puts sig end puts end end |