Class: RubyCritic::Generator::Text::Lint
- Inherits:
-
Object
- Object
- RubyCritic::Generator::Text::Lint
- Defined in:
- lib/rubycritic/generators/text/lint.rb
Constant Summary collapse
- TEMPLATE_PATH =
File.('templates/lint.erb', __dir__)
- FILE_NAME =
'lint.txt'.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(analysed_module) ⇒ Lint
constructor
A new instance of Lint.
- #render ⇒ Object
Constructor Details
#initialize(analysed_module) ⇒ Lint
Returns a new instance of Lint.
25 26 27 |
# File 'lib/rubycritic/generators/text/lint.rb', line 25 def initialize(analysed_module) @analysed_module = analysed_module end |
Class Method Details
.erb_template ⇒ Object
20 21 22 |
# File 'lib/rubycritic/generators/text/lint.rb', line 20 def erb_template @erb_template ||= ERB.new(File.read(TEMPLATE_PATH), nil, '-') end |
.file_directory ⇒ Object
12 13 14 |
# File 'lib/rubycritic/generators/text/lint.rb', line 12 def file_directory @file_directory ||= Pathname.new(Config.root) end |
.file_pathname ⇒ Object
16 17 18 |
# File 'lib/rubycritic/generators/text/lint.rb', line 16 def file_pathname Pathname.new(file_directory).join FILE_NAME end |
Instance Method Details
#render ⇒ Object
29 30 31 |
# File 'lib/rubycritic/generators/text/lint.rb', line 29 def render erb_template.result(binding) end |