Re: [Puppet Users] Re: Creating scope object in Puppet v3.x

2014-05-02 Thread KomodoDave
You're right that my function isn't inside Puppet, Henrik. But the whole point of it is to be able to run Puppet functions without needing to run Puppet itself so they can be live debugged very quickly. It worked fine with Puppet 2.6, but I guess the upgrades that have been to Puppet made since

Re: [Puppet Users] Re: Creating scope object in Puppet v3.x

2014-05-02 Thread Henrik Lindberg
On 2014-01-05 11:18, KomodoDave wrote: Thanks for the response, Henrik. I’ve tried what you suggested already: |node=Puppet::Node.new('localhost') compiler=Puppet::Parser::Compiler.new(node) scope=Puppet::Parser::Scope.new(compiler) | ..but the result is: | /usr/lib/ruby/vendor_ruby/puppet/co

[Puppet Users] Re: Creating scope object in Puppet v3.x

2014-05-01 Thread KomodoDave
Thanks for the response, Henrik. I’ve tried what you suggested already: node=Puppet::Node.new('localhost') compiler=Puppet::Parser::Compiler.new(node) scope=Puppet::Parser::Scope.new(compiler) ..but the result is: /usr/lib/ruby/vendor_ruby/puppet/context.rb:43:in `lookup': no 'environments'

Re: [Puppet Users] Re: Creating scope object in Puppet v3.x

2014-04-30 Thread Henrik Lindberg
On 2014-30-04 15:19, KomodoDave wrote: So I guess no-one knows how to achieve this? Suggest that you write rspec tests for your custom functions. Just mimic what is done for the built in functions. As an example of a simple function - look at spec/unit/parser/functions/sprintf_spec.rb - he

[Puppet Users] Re: Creating scope object in Puppet v3.x

2014-04-30 Thread KomodoDave
So I guess no-one knows how to achieve this? On Tuesday, 29 April 2014 13:26:20 UTC+1, KomodoDave wrote: > > Hi all, > > I wrote a neat little script for Puppet 2.x to test custom functions > without needing to do a Puppet run. This involved creating a Scope object > using `Puppet::Parser::Scop