Module: GLRubocop::HamlContentHelper

Included in:
GLCops::TailwindNoContradictingClassName, GLCops::ValidDataTestId
Defined in:
lib/gl_rubocop/helpers/haml_content_helper.rb

Instance Method Summary collapse

Instance Method Details

#haml_file?Boolean

Returns:

  • (Boolean)


3
4
5
6
# File 'lib/gl_rubocop/helpers/haml_content_helper.rb', line 3

def haml_file?
  file_path = processed_source.file_path
  file_path&.end_with?('.html.haml') && File.exist?(file_path)
end

#read_haml_fileObject



8
9
10
11
12
# File 'lib/gl_rubocop/helpers/haml_content_helper.rb', line 8

def read_haml_file
  File.read(processed_source.file_path)
rescue StandardError
  nil
end