Class: Regex::FromConfig
- Inherits:
-
Object
- Object
- Regex::FromConfig
- Defined in:
- lib/puppet-lint-infrasecure/regex.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
-
#whitelist ⇒ Object
Returns the value of attribute whitelist.
Instance Method Summary collapse
-
#initialize ⇒ FromConfig
constructor
A new instance of FromConfig.
- #load_dependencies(path) ⇒ Object
- #load_whitelist(path) ⇒ Object
Constructor Details
#initialize ⇒ FromConfig
Returns a new instance of FromConfig.
5 6 7 8 |
# File 'lib/puppet-lint-infrasecure/regex.rb', line 5 def initialize() @whitelist = nil @dependencies = nil end |
Instance Attribute Details
#dependencies ⇒ Object
Returns the value of attribute dependencies.
3 4 5 |
# File 'lib/puppet-lint-infrasecure/regex.rb', line 3 def dependencies @dependencies end |
#whitelist ⇒ Object
Returns the value of attribute whitelist.
3 4 5 |
# File 'lib/puppet-lint-infrasecure/regex.rb', line 3 def whitelist @whitelist end |
Instance Method Details
#load_dependencies(path) ⇒ Object
14 15 16 |
# File 'lib/puppet-lint-infrasecure/regex.rb', line 14 def load_dependencies(path) @dependencies = Regexp.new YAML.load_file(path).join('|') end |
#load_whitelist(path) ⇒ Object
10 11 12 |
# File 'lib/puppet-lint-infrasecure/regex.rb', line 10 def load_whitelist(path) @whitelist = Regexp.new File.open(path).read.gsub("\n",'|') end |