On 12/20/2014 04:45 AM, Francois Lafont wrote:
> Hi,
>
> In a personal module of my puppetmaster (in the production environment),
> I have a custom function which I would like to run on irb (to make
> quick test, it would be so convenient). Is it possible?
Hmm, I honestly don't know, but the idea sounds sort of horrible to me :-)
Can you not solve this the other way around? Put the code you need in a
Ruby class that is globally available on your system.
require 'my/data_validator'
My::DataValidator.validate(@some_value)
The class is defined in /some/ruby/lib/dir/my/data_validator.rb
You can then refactor your parser function to use a variation of just
that pseudo code above.
HTH,
Felix