Class: Lintress::Runner
- Inherits:
-
Object
- Object
- Lintress::Runner
- Defined in:
- lib/lintress/runner.rb
Instance Attribute Summary collapse
-
#offenses ⇒ Object
readonly
Returns the value of attribute offenses.
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Runner
Returns a new instance of Runner.
10 11 12 |
# File 'lib/lintress/runner.rb', line 10 def initialize @rubocop = RuboCop::CLI.new end |
Instance Attribute Details
#offenses ⇒ Object (readonly)
Returns the value of attribute offenses.
8 9 10 |
# File 'lib/lintress/runner.rb', line 8 def offenses @offenses end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/lintress/runner.rb', line 14 def run nsout = StringIO.new osout = $stdout # store the old STDOUT construct $stdout = nsout @rubocop.run @offenses = $stdout.string # return to old STDOUT $stdout = osout # puts @offenses end |