This whole block can be replaced with

    def in_puppet?
        defined?(Puppet)
    end