mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
add init resource
This commit is contained in:
parent
0657525f4d
commit
60e2a3512f
2 changed files with 24 additions and 0 deletions
|
@ -74,3 +74,4 @@ require 'resources/yum'
|
||||||
require 'resources/json'
|
require 'resources/json'
|
||||||
require 'resources/yaml'
|
require 'resources/yaml'
|
||||||
require 'resources/csv'
|
require 'resources/csv'
|
||||||
|
require 'resources/ini'
|
||||||
|
|
23
lib/resources/ini.rb
Normal file
23
lib/resources/ini.rb
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# encoding: utf-8
|
||||||
|
# author: Christoph Hartmann
|
||||||
|
# author: Dominik Richter
|
||||||
|
|
||||||
|
require 'utils/simpleconfig'
|
||||||
|
|
||||||
|
# Parses a ini file
|
||||||
|
# Usage:
|
||||||
|
# descibe ini do
|
||||||
|
# its("auth_protocol") { should eq "https" }
|
||||||
|
# end
|
||||||
|
class IniConfig < JsonConfig
|
||||||
|
name 'ini'
|
||||||
|
|
||||||
|
# override file load and parse hash with simple config
|
||||||
|
def parse(content)
|
||||||
|
SimpleConfig.new(content).params
|
||||||
|
end
|
||||||
|
|
||||||
|
def to_s
|
||||||
|
"INI #{@path}"
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue