class RailsRouteChecker::ConfigFile

Attributes

filename[R]

Public Class Methods

new(filename) click to toggle source
# File lib/rails-route-checker/config_file.rb, line 5
def initialize(filename)
  @filename = filename
end

Public Instance Methods

config() click to toggle source
# File lib/rails-route-checker/config_file.rb, line 9
def config
  @config ||= begin
    hash = load_yaml_file
    {
      ignored_controllers: hash['ignored_controllers'] || [],
      ignored_paths: hash['ignored_paths'] || [],
      ignored_path_whitelist: hash['ignored_path_whitelist'] || []
    }
  end
end

Private Instance Methods

load_yaml_file() click to toggle source
# File lib/rails-route-checker/config_file.rb, line 24
def load_yaml_file
  require 'yaml'
  YAML.safe_load(File.read(filename))
end