Class: Koality::Runner::RailsBestPractices
- Inherits:
-
Object
- Object
- Koality::Runner::RailsBestPractices
- Defined in:
- lib/koality/runner/rails_best_practices.rb
Instance Attribute Summary collapse
-
#output_file ⇒ Object
readonly
Returns the value of attribute output_file.
-
#rbp_options ⇒ Object
readonly
Returns the value of attribute rbp_options.
Instance Method Summary collapse
-
#initialize(options) ⇒ RailsBestPractices
constructor
A new instance of RailsBestPractices.
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ RailsBestPractices
Returns a new instance of RailsBestPractices.
7 8 9 10 11 12 |
# File 'lib/koality/runner/rails_best_practices.rb', line 7 def initialize() require 'rails_best_practices' @output_file = .output_file(:rails_bp_error_file) @rbp_options = () end |
Instance Attribute Details
#output_file ⇒ Object (readonly)
Returns the value of attribute output_file.
5 6 7 |
# File 'lib/koality/runner/rails_best_practices.rb', line 5 def output_file @output_file end |
#rbp_options ⇒ Object (readonly)
Returns the value of attribute rbp_options.
5 6 7 |
# File 'lib/koality/runner/rails_best_practices.rb', line 5 def @rbp_options end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/koality/runner/rails_best_practices.rb', line 14 def run analyzer = ::RailsBestPractices::Analyzer.new('.', ) Koality::Reporter::RailsBestPractices.start do |reporter| analyzer.analyze reporter.report(analyzer.errors) end File.open(output_file, 'w') do |f| f << analyzer.errors.count end end |