ruby parse init file
Hello,
I'm writing some custom facts for a puppet server. I need a ruby function for reading a ini file: eg: users_prop.cfg Code:
[user1] Before someone recommend me : rubygem inifile, puppetmaster + clinets , none of them have internet access, + I've been prohibited to install any 3rd party applications/module from internet w/o special permission, so, I just have to reinvent the wheel... Any help is appreciated... |
So where are you stuck and what have you written so far?
|
Quote:
Code:
require 'fileutils' but I should get a hash like[ "user1"=> command1 => cmdA ,command2 => cmdB, command3 => cmdC, "user2" =>....] kind of hash of hashes. I'm not such a pro in ruby. |
Quote:
Code:
require 'fileutils' |
I am guessing you have lots of left over cruft you haven't trimmed out of this code and perhaps some other code that may need
some of your extra variables or libraries, but this can be trimmed a littler more to be: Code:
data = {} |
All times are GMT -5. The time now is 02:38 AM. |