class RulesConfig

Attributes

empty_rule[R]
rules[R]

Public Class Methods

new() click to toggle source
# File lib/jekyll_frontmatter_tests/jekyll_frontmatter_tests_rules.rb, line 42
def initialize
  rules_yml = File.join(Dir.pwd, 'tests', 'schema', 'rules.yml')
  gem_path = $LOAD_PATH.select { |p| p.include? 'jekyll_frontmatter_tests' }
  default_rules_yml = File.join(gem_path, 'rules.yml')
  rules_config = File.exists?(rules_yml) ? rules_yml : default_rules_yml
  @rules = YAML.load_file(rules_config)
  @empty_rule = { "exceptions"=>[] }
end