Sha256: 8871a550506263cc562db840c7679bb6aa68c08e0a767572f7137fc8f1b9f11a
Contents?: true
Size: 672 Bytes
Versions: 3
Compression:
Stored size: 672 Bytes
Contents
module ESLintRails class Config def self.read(force_default: false) self.new(force_default: force_default).send(:read) end private CONFIG_PATH = 'config/eslint.json' private_constant :CONFIG_PATH def initialize(force_default: nil) raise(ArgumentError, 'force_default is required') if force_default.nil? @force_default = force_default @custom_file = Rails.root.join(CONFIG_PATH) @default_file = ESLintRails::Engine.root.join(CONFIG_PATH) end def read config_file.read end def config_file (@custom_file.exist? && !@force_default) ? @custom_file : @default_file end end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
eslint-rails-ee-1.0.3 | lib/eslint-rails-ee/config.rb |
eslint-rails-ee-1.0.2 | lib/eslint-rails-ee/config.rb |
eslint-rails-1.3.0 | lib/eslint-rails/config.rb |