Sha256: d494505166976219b490224cec2381717a438dcdcbae3b7607c6aa3fefa4a7fa

Contents?: true

Size: 690 Bytes

Versions: 12

Compression:

Stored size: 690 Bytes

Contents

module HamlI18nLint
  # Raised if given config file path is not exists
  class LoadConfigError < StandardError; end

  class Options
    # @return [String] path to config file
    attr_accessor :config_path
    attr_writer :files

    # @raise [LoadConfigError] if given config file path is not exists
    # @return [String] the content of config_path
    def config_content
      unless config_path && File.exist?(config_path)
        raise LoadConfigError, "Config not exist: #{config_path.inspect}"
      end

      File.read(config_path)
    end

    # @return [Array<String>] file patterns to list the files to be linted.
    def files
      @files ||= ["**/*.haml"]
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
haml_i18n_lint-0.12.0 lib/haml_i18n_lint/options.rb
haml_i18n_lint-0.11.0 lib/haml_i18n_lint/options.rb
haml_i18n_lint-0.10.0 lib/haml_i18n_lint/options.rb
haml_i18n_lint-0.9.0 lib/haml_i18n_lint/options.rb
haml_i18n_lint-0.8.0 lib/haml_i18n_lint/options.rb
haml_i18n_lint-0.7.0 lib/haml_i18n_lint/options.rb
haml_i18n_lint-0.6.0 lib/haml_i18n_lint/options.rb
haml_i18n_lint-0.5.0 lib/haml_i18n_lint/options.rb
haml_i18n_lint-0.4.0 lib/haml_i18n_lint/options.rb
haml_i18n_lint-0.3.0 lib/haml_i18n_lint/options.rb
haml_i18n_lint-0.2.0 lib/haml_i18n_lint/options.rb
haml_i18n_lint-0.1.0 lib/haml_i18n_lint/options.rb