Class: Pfu
- Inherits:
-
Object
- Object
- Pfu
- Defined in:
- lib/pfu.rb,
lib/pfu/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
'0.0.5'
Instance Method Summary collapse
-
#initialize(options) ⇒ Pfu
constructor
A new instance of Pfu.
- #refactor! ⇒ Object
Constructor Details
#initialize(options) ⇒ Pfu
Returns a new instance of Pfu.
6 7 8 9 10 |
# File 'lib/pfu.rb', line 6 def initialize() @filenames = [:filenames] @namespace = [:namespace] @clean = [:clean] end |
Instance Method Details
#refactor! ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pfu.rb', line 12 def refactor! @filenames.each do |path| next unless data = Pfu::Parser.parse(path) data[:namespace] = @namespace if Pfu::Generator.write(data) FileUtils.rm(path) if @clean end end $logger.info "Functions generated. Please inspect for suitability and then" $logger.info "update any Puppet code with the new function names." $logger.info "See https://puppet.com/docs/puppet/latest/custom_functions_ruby.html" $logger.info "for more information about Puppet's modern Ruby function API." end |