diff options
author | danielsdeleo <dan@opscode.com> | 2013-10-14 15:13:31 -0700 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-10-16 13:53:37 -0700 |
commit | 3b877d8956531eb18ca5b398e2b2c8b4e33b71ce (patch) | |
tree | cf8ec0e44bc0f399f5c4a77d151e40c1b66a09ad /lib | |
parent | 6bd425c97be8c323b8c721ab7bb945a0524e903d (diff) | |
download | chef-3b877d8956531eb18ca5b398e2b2c8b4e33b71ce.tar.gz |
Support evaluation of a string as config
This allows remote config files to be fetched to memory and evauated
without requiring an intermediate tempfile.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/config.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chef/config.rb b/lib/chef/config.rb index f2610f01e2..82dfb85101 100644 --- a/lib/chef/config.rb +++ b/lib/chef/config.rb @@ -29,6 +29,13 @@ class Chef extend Mixlib::Config + # Evaluates the given string as config. + # + # +filename+ is used for context in stacktraces, but doesn't need to be the name of an actual file. + def self.from_string(string, filename) + self.instance_eval(string, filename, 1) + end + # Manages the chef secret session key # === Returns # <newkey>:: A new or retrieved session key |