Class: Regex::FromConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet-lint-infrasecure/regex.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFromConfig

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

#dependenciesObject

Returns the value of attribute dependencies.



3
4
5
# File 'lib/puppet-lint-infrasecure/regex.rb', line 3

def dependencies
  @dependencies
end

#whitelistObject

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