[Puppet Users] How to share a ruby hash between Puppet and standard ruby script?

2012-11-30 Thread KomodoDave
I have a hash defined containing some static information. This exists within a custom function for Puppet. I wish to share this code with a ruby test harness I'm writing; there will be additional resources that both Puppet and the test harness can make use of. My question is - what's the best

Re: [Puppet Users] How to share a ruby hash between Puppet and standard ruby script?

2012-11-30 Thread Jeff McCune
On Fri, Nov 30, 2012 at 4:30 AM, KomodoDave dave.br...@ocado.com wrote: I have a hash defined containing some static information. This exists within a custom function for Puppet. I wish to share this code with a ruby test harness I'm writing; there will be additional resources that both

Re: [Puppet Users] How to share a ruby hash between Puppet and standard ruby script?

2012-11-30 Thread Dave Brown
Sure thing, here you are: ## Usage:## artifacts()## Returns:## Puppet hash containing artifact info.## @author N David Brownmodule Puppet::Parser::Functions newfunction(:artifacts, :type = :rvalue) do |args| # Info common to all artifacts. _common = { 'pkg' =

Re: [Puppet Users] How to share a ruby hash between Puppet and standard ruby script?

2012-11-30 Thread Jeff McCune
On Fri, Nov 30, 2012 at 8:42 AM, Dave Brown dave.br...@ocado.com wrote: Sure thing, here you are: This conversation might be better suited to the puppet-dev mailing list. I recommend posting follow up messages there. _common and _artifacts are local variables and won't be accessible outside of