any way to debug a Puppet custom function?

249 views
Skip to first unread message

Thomas Cheng

unread,
Sep 19, 2016, 9:53:06 PM9/19/16
to Puppet Users
Hi howdies,

 Recently I'm picking up some legacy puppet codes in my new company. the puppet code base has custom functions written in ruby before.

One major issue is: how to debug the custom functions to figure out the logic inside? Can I copy/paste into an external general ruby script and debug it with 'ruby -rdebug <script>', Or there is a better puppet-style debugging method that we can learn? Thanks a lot.


Best,
Thomas


Martin Alfke

unread,
Sep 20, 2016, 2:07:35 AM9/20/16
to puppet...@googlegroups.com
Hi Thomas,
I use RUBYLIB env setting and the pry gem for debugging.
http://pryrepl.org/

Best,
Martin

Trevor Vaughan

unread,
Sep 20, 2016, 10:09:32 AM9/20/16
to puppet...@googlegroups.com
Hi Thomas,

This might help as a reference if you want to use rspec to test your functions. https://github.com/simp/pupmod-simp-simplib/tree/master/spec/functions

Thanks,

Trevor

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/222c1936-f12a-43d3-8a3f-1a62f3f1ee78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Trevor Vaughan
Vice President, Onyx Point, Inc

-- This account not approved for unencrypted proprietary information --
Reply all
Reply to author
Forward
0 new messages