Class: RulesConfig
- Inherits:
-
Object
- Object
- RulesConfig
- Defined in:
- lib/jekyll_frontmatter_tests/jekyll_frontmatter_tests_rules.rb
Instance Attribute Summary collapse
-
#empty_rule ⇒ Object
readonly
Returns the value of attribute empty_rule.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
Instance Method Summary collapse
-
#initialize ⇒ RulesConfig
constructor
A new instance of RulesConfig.
Constructor Details
#initialize ⇒ RulesConfig
Returns a new instance of RulesConfig.
42 43 44 45 46 47 48 49 |
# 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 |
Instance Attribute Details
#empty_rule ⇒ Object (readonly)
Returns the value of attribute empty_rule.
51 52 53 |
# File 'lib/jekyll_frontmatter_tests/jekyll_frontmatter_tests_rules.rb', line 51 def empty_rule @empty_rule end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
51 52 53 |
# File 'lib/jekyll_frontmatter_tests/jekyll_frontmatter_tests_rules.rb', line 51 def rules @rules end |