I always like looking back at the work RI did in the facts-dot-d facter fact for something like this --> https://github.com/ripienaar/facter-facts/blob/master/facts-dot-d/facter_dot_d.rb#L39-51
On Mon, Oct 1, 2012 at 9:46 AM, Darin Perusich <[email protected]> wrote: > Hello, > > What is the best way to evaluate the variables set in a config file in > a provider? The variables in the file are setup like MY_VAR="foo bar > baz". > > I currently have this little piece of code working but it's certainly > not very elegant so I'm looking for some guidance. > > IO.read(/some/file.cfg).grep(/^MY_VAR=/).grep(/\bbar\b/).empty? > > -- > Later, > Darin > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/puppet-dev?hl=en. > -- Gary Larizza Professional Services Engineer Puppet Labs Join us for PuppetConf 2012 at the Mission Bay Convention Center in San Francisco, California on September 27th and 28th --> http://bit.ly/pcsig12 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
