Class: HamlI18nLint::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/haml_i18n_lint/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#config_pathString

Returns path to config file.

Returns:

  • (String)

    path to config file



7
8
9
# File 'lib/haml_i18n_lint/options.rb', line 7

def config_path
  @config_path
end

#filesArray<String>

Returns file patterns to list the files to be linted.

Returns:

  • (Array<String>)

    file patterns to list the files to be linted.



21
22
23
# File 'lib/haml_i18n_lint/options.rb', line 21

def files
  @files ||= ["**/*.haml"]
end

Instance Method Details

#config_contentString

Returns the content of config_path.

Returns:

  • (String)

    the content of config_path

Raises:



12
13
14
15
16
17
18
# File 'lib/haml_i18n_lint/options.rb', line 12

def config_content
  unless config_path && File.exist?(config_path)
    raise LoadConfigError, "Config not exist: #{config_path.inspect}"
  end

  File.read(config_path)
end