summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/format.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-03-23 13:43:38 -0500
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitb41d53596cdcb6d7220b93926f6eedf171c09c46 (patch)
treef7616b6197520fdb5f96fe37aa955518d7b26978 /lib/puppet/network/format.rb
parent7504f1ede94900ab42cd6e9c4ff9c8a5cb9e65ee (diff)
downloadpuppet-b41d53596cdcb6d7220b93926f6eedf171c09c46.tar.gz
puppet-b41d53596cdcb6d7220b93926f6eedf171c09c46.tar.xz
puppet-b41d53596cdcb6d7220b93926f6eedf171c09c46.zip
Adding filename extension support to formats.
This is toward fixing #1943 - we need the ability to easily convert between file extensions and file formats. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/network/format.rb')
-rw-r--r--lib/puppet/network/format.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/puppet/network/format.rb b/lib/puppet/network/format.rb
index d78124221..7c3cc7bd8 100644
--- a/lib/puppet/network/format.rb
+++ b/lib/puppet/network/format.rb
@@ -7,7 +7,7 @@ class Puppet::Network::Format
include Puppet::Provider::Confiner
attr_reader :name, :mime
- attr_accessor :intern_method, :render_method, :intern_multiple_method, :render_multiple_method, :weight, :required_methods
+ attr_accessor :intern_method, :render_method, :intern_multiple_method, :render_multiple_method, :weight, :required_methods, :extension
def init_attribute(name, default)
if value = @options[name]
@@ -36,6 +36,7 @@ class Puppet::Network::Format
init_attribute(:mime, "text/%s" % name)
init_attribute(:weight, 5)
init_attribute(:required_methods, method_list.keys)
+ init_attribute(:extension, name.to_s)
method_list.each do |method, value|
init_attribute(method, value)