Method: Kanrisuru::Core::System::Parser::Sysctl.parse
- Defined in:
- lib/kanrisuru/core/system/parsers/sysctl.rb
.parse(command) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/kanrisuru/core/system/parsers/sysctl.rb', line 10 def parse(command) result = {} lines = command.to_a lines.each do |line| next if line.include?("permission denied on key") keys, value = parse_line(line) next if Kanrisuru::Util.blank?(value) hash = build_nested_hash(keys, value) result = merge_recursively(result, hash) end build_struct(result) end |