Class: JRuby::Lint::Project
- Inherits:
-
Object
- Object
- JRuby::Lint::Project
- Defined in:
- lib/jruby/lint/project.rb
Constant Summary collapse
- DEFAULT_TAGS =
%w(error warning info)
Instance Attribute Summary collapse
-
#collectors ⇒ Object
readonly
Returns the value of attribute collectors.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#findings ⇒ Object
readonly
Returns the value of attribute findings.
-
#libraries ⇒ Object
readonly
Returns the value of attribute libraries.
-
#reporters ⇒ Object
readonly
Returns the value of attribute reporters.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(options = OpenStruct.new) ⇒ Project
constructor
A new instance of Project.
- #run ⇒ Object
Constructor Details
#initialize(options = OpenStruct.new) ⇒ Project
Returns a new instance of Project.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/jruby/lint/project.rb', line 10 def initialize( = OpenStruct.new) = DEFAULT_TAGS.dup @collectors = [] @files = Set.new if .eval .eval.each {|e| @collectors << JRuby::Lint::Collectors::Ruby.new(self, '-e', e) } @files += @collectors end if . += . end @sources = .files || (.eval ? [] : Dir['./**/*']) load_collectors load_reporters() load_libraries end |
Instance Attribute Details
#collectors ⇒ Object (readonly)
Returns the value of attribute collectors.
8 9 10 |
# File 'lib/jruby/lint/project.rb', line 8 def collectors @collectors end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
8 9 10 |
# File 'lib/jruby/lint/project.rb', line 8 def files @files end |
#findings ⇒ Object (readonly)
Returns the value of attribute findings.
8 9 10 |
# File 'lib/jruby/lint/project.rb', line 8 def findings @findings end |
#libraries ⇒ Object (readonly)
Returns the value of attribute libraries.
8 9 10 |
# File 'lib/jruby/lint/project.rb', line 8 def libraries @libraries end |
#reporters ⇒ Object (readonly)
Returns the value of attribute reporters.
8 9 10 |
# File 'lib/jruby/lint/project.rb', line 8 def reporters @reporters end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/jruby/lint/project.rb', line 8 def end |
Instance Method Details
#run ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/jruby/lint/project.rb', line 30 def run @findings = [] collectors.each do |c| c.run reporters.each {|r| r.report(c.findings)} @findings += c.findings end reporters.each {|r| r.print_report(@findings) if r.respond_to?(:print_report) } end |