[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.5rc1-120-g2247c80

James Turnbull james at lovedthanlost.net
Mon Feb 7 06:40:47 UTC 2011


The following commit has been merged in the upstream branch:
commit 66b442b723f1e74b934381227955cc30d64f3636
Author: James Turnbull <james at lovedthanlost.net>
Date:   Mon Jan 17 11:45:55 2011 +1100

    Fixes #5916 - Cleanup of unused doc methods and documentation

diff --git a/lib/puppet/application/doc.rb b/lib/puppet/application/doc.rb
index 1f6c632..aaefd6e 100644
--- a/lib/puppet/application/doc.rb
+++ b/lib/puppet/application/doc.rb
@@ -8,7 +8,7 @@ class Puppet::Application::Doc < Puppet::Application
   attr_accessor :unknown_args, :manifest
 
   def preinit
-    {:references => [], :mode => :text, :format => :to_rest }.each do |name,value|
+    {:references => [], :mode => :text, :format => :to_markdown }.each do |name,value|
       options[name] = value
     end
     @unknown_args = []
@@ -113,9 +113,6 @@ class Puppet::Application::Doc < Puppet::Application
 
     text += Puppet::Util::Reference.footer unless with_contents # We've only got one reference
 
-    # Replace the trac links, since they're invalid everywhere else
-    text.gsub!(/`\w+\s+([^`]+)`:trac:/) { |m| $1 }
-
     if options[:mode] == :pdf
       Puppet::Util::Reference.pdf(text)
     else
diff --git a/lib/puppet/util/command_line/puppetdoc b/lib/puppet/util/command_line/puppetdoc
index 8f24ea5..45a9c65 100755
--- a/lib/puppet/util/command_line/puppetdoc
+++ b/lib/puppet/util/command_line/puppetdoc
@@ -37,7 +37,7 @@
 #   Specifies the directory where to output the rdoc documentation in 'rdoc' mode.
 #
 # mode::
-#   Determine the output mode.  Valid modes are 'text', 'trac', 'pdf' and 'rdoc'. The 'pdf' mode creates PDF formatted files in the /tmp directory. The default mode is 'text'.  In 'rdoc' mode you must provide 'manifests-path'
+#   Determine the output mode.  Valid modes are 'text', 'pdf' and 'rdoc'. The 'pdf' mode creates PDF formatted files in the /tmp directory. The default mode is 'text'.  In 'rdoc' mode you must provide 'manifests-path'
 #
 # reference::
 #   Build a particular reference.  Get a list of references by running +puppet doc --list+.
@@ -47,7 +47,7 @@
 #
 # = Example
 #
-#   $ puppet doc -r type > /tmp/type_reference.rst
+#   $ puppet doc -r type > /tmp/type_reference.markdown
 # or
 #   $ puppet doc --outputdir /tmp/rdoc --mode rdoc /path/to/manifests
 # or
diff --git a/lib/puppet/util/reference.rb b/lib/puppet/util/reference.rb
index 95efeb1..a4921ed 100644
--- a/lib/puppet/util/reference.rb
+++ b/lib/puppet/util/reference.rb
@@ -120,16 +120,11 @@ class Puppet::Util::Reference
     str += "\n\n"
   end
 
-  # Remove all trac links.
-  def strip_trac(text)
-    text.gsub(/`\w+\s+([^`]+)`:trac:/) { |m| $1 }
-  end
-
   def text
     puts output
   end
 
-  def to_rest(withcontents = true)
+  def to_markdown(withcontents = true)
     # First the header
     text = h(@title, 1)
     text += "\n\n**This page is autogenerated; any changes will get overwritten** *(last generated on #{Time.now.to_s})*\n\n"
@@ -142,8 +137,4 @@ class Puppet::Util::Reference
 
     text
   end
-
-  def to_text(withcontents = true)
-    strip_trac(to_rest(withcontents))
-  end
 end
diff --git a/spec/integration/reference/providers_spec.rb b/spec/integration/reference/providers_spec.rb
index 8b95ca1..c2b1e17 100755
--- a/spec/integration/reference/providers_spec.rb
+++ b/spec/integration/reference/providers_spec.rb
@@ -11,7 +11,7 @@ describe reference do
     reference.should_not be_nil
   end
 
-  it "should be able to be rendered as text" do
-    lambda { reference.to_text }.should_not raise_error
+  it "should be able to be rendered as markdown" do
+    lambda { reference.to_markdown }.should_not raise_error
   end
 end
diff --git a/spec/unit/application/doc_spec.rb b/spec/unit/application/doc_spec.rb
index 55da5e3..ed72363 100755
--- a/spec/unit/application/doc_spec.rb
+++ b/spec/unit/application/doc_spec.rb
@@ -48,10 +48,10 @@ describe Puppet::Application::Doc do
       @doc.options[:mode].should == :text
     end
 
-    it "should init format to to_rest" do
+    it "should init format to to_markdown" do
       @doc.preinit
 
-      @doc.options[:format].should == :to_rest
+      @doc.options[:format].should == :to_markdown
     end
   end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list