Sha256: c8cad0e72da77ab94f61e1fc783257c20712625f67b3b2e916a32f01cd8bb055

Contents?: true

Size: 866 Bytes

Versions: 25

Compression:

Stored size: 866 Bytes

Contents

# frozen_string_literal: true

require 'erb'
module RubyCritic
  module Generator
    module Text
      class Lint
        class << self
          TEMPLATE_PATH = File.expand_path('templates/lint.erb', __dir__)
          FILE_NAME = 'lint.txt'.freeze

          def file_directory
            @file_directory ||= Pathname.new(Config.root)
          end

          def file_pathname
            Pathname.new(file_directory).join FILE_NAME
          end

          def erb_template
            @erb_template ||= ERB.new(File.read(TEMPLATE_PATH), nil, '-')
          end
        end

        def initialize(analysed_module)
          @analysed_module = analysed_module
        end

        def render
          erb_template.result(binding)
        end

        private

        def erb_template
          self.class.erb_template
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
rubycritic-4.7.0 lib/rubycritic/generators/text/lint.rb
rubycritic-4.6.1 lib/rubycritic/generators/text/lint.rb
rubycritic-4.6.0 lib/rubycritic/generators/text/lint.rb
rubycritic-4.5.2 lib/rubycritic/generators/text/lint.rb
rubycritic-4.5.1 lib/rubycritic/generators/text/lint.rb
rubycritic-4.5.0 lib/rubycritic/generators/text/lint.rb
rubycritic-4.4.1 lib/rubycritic/generators/text/lint.rb
rubycritic-4.4.0 lib/rubycritic/generators/text/lint.rb
rubycritic-4.3.3 lib/rubycritic/generators/text/lint.rb
rubycritic-4.3.2 lib/rubycritic/generators/text/lint.rb
rubycritic-4.3.1 lib/rubycritic/generators/text/lint.rb
rubycritic-4.3.0 lib/rubycritic/generators/text/lint.rb
rubycritic-4.2.2 lib/rubycritic/generators/text/lint.rb
rubycritic-4.2.1 lib/rubycritic/generators/text/lint.rb
rubycritic-4.2.0 lib/rubycritic/generators/text/lint.rb
rubycritic-simplecov-4.1.1 lib/rubycritic/generators/text/lint.rb
rubycritic-simplecov-4.1.0 lib/rubycritic/generators/text/lint.rb
rubycritic-4.1.0 lib/rubycritic/generators/text/lint.rb
rubycritic-4.0.2 lib/rubycritic/generators/text/lint.rb
rubycritic-4.0.1 lib/rubycritic/generators/text/lint.rb