Method: Shadow#initialize
- Defined in:
- lib/resources/shadow.rb
#initialize(path = '/etc/shadow', opts = nil) ⇒ Shadow
Returns a new instance of Shadow.
39 40 41 42 43 44 45 46 |
# File 'lib/resources/shadow.rb', line 39 def initialize(path = '/etc/shadow', opts = nil) opts ||= {} @path = path || '/etc/shadow' @content = opts[:content] || inspec.file(@path).content @lines = @content.to_s.split("\n") @filters = opts[:filters] || '' @params = @lines.map { |l| parse_shadow_line(l) } end |