# File lib/puppet/module_tool/applications/generator.rb, line 77 def self.inherited(klass) types << klass end
# File lib/puppet/module_tool/applications/generator.rb, line 86 def initialize(source, generator) @generator = generator @source = source end
# File lib/puppet/module_tool/applications/generator.rb, line 80 def self.on(path, generator) klass = types.detect { |t| t.matches?(path) } if klass klass.new(path, generator) end end
# File lib/puppet/module_tool/applications/generator.rb, line 74 def self.types @types ||= [] end
# File lib/puppet/module_tool/applications/generator.rb, line 100 def install! raise NotImplementedError, "Abstract" end
# File lib/puppet/module_tool/applications/generator.rb, line 90 def read @source.read end
# File lib/puppet/module_tool/applications/generator.rb, line 93 def target target = @generator.destination + @source.relative_path_from(@generator.skeleton.path) components = target.to_s.split(File::SEPARATOR).map do |part| part == 'NAME' ? @generator.metadata.name : part end Pathname.new(components.join(File::SEPARATOR)) end