How can I quickly run a custom function on any node with `puppet apply` ?

Let's say I have this file (test.pp)

```
file { "/root/files/f":
   content => test('test'),
}

```

And this ruby file (test.rb) which only log and return the first agument.

```
require 'logger'
module Puppet::Parser::Functions
  newfunction(:test, :type => :rvalue
  ) do |args|

    log = Logger.new(STDOUT)
    log.level = Logger::INFO
    log.info(args[0])
    args[0]
  end
end

```

How does one call the ruby function `test` with a `puppet apply test.pp`?

My problem is that is take like 5minutes to run my entire `puppet agent -t` and I need to add a function to puppet so I would like to test it quickly instead of waiting 5minutes each time.