[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Jesse Wolfe jes5199 at gmail.com
Tue May 10 07:59:14 UTC 2011


The following commit has been merged in the experimental branch:
commit d43f7996b93c394df0bd0994ae7298fb35ad2c5e
Merge: ce9a6f97ab1784d8bd60eae8b60272c9875b1f84 99c1019e1d3402ec8e476dc859d5aaef82ec4f69
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Mon Oct 4 11:44:41 2010 -0700

    Partial merge to 2.6.2rc1 : Merge commit '99c1019' into next
    
    This conflict was a little too complicated for diff to figure out, but
    the resolution is actually fairly mechanical.
    Some unit tests changed because they were mocking unnecessarily.
    
    Manually Resolved Conflicts:
    	lib/puppet/util/rdoc/parser.rb
    	spec/unit/util/rdoc/parser_spec.rb

diff --combined lib/puppet/util/rdoc/parser.rb
index 30da607,8414843..aca6616
--- a/lib/puppet/util/rdoc/parser.rb
+++ b/lib/puppet/util/rdoc/parser.rb
@@@ -17,7 -17,7 +17,7 @@@ class Parse
  
    SITE = "__site__"
  
 -  attr_accessor :ast, :input_file_name, :top_level
 +  attr_accessor :input_file_name, :top_level
  
    # parser registration into RDoc
    parse_files_matching(/\.(rb|pp)$/)
@@@ -33,17 -33,16 +33,19 @@@
  
    # main entry point
    def scan
-     Puppet.info "rdoc: scanning #{@input_file_name}"
-     if @input_file_name =~ /\.pp$/
-       @parser = Puppet::Parser::Parser.new(Puppet[:environment])
-       environment = @parser.environment
-       @parser.file = @input_file_name
-       @known_resource_types = environment.known_resource_types
-       @parser.parse.instantiate('').each do |type|
-         @known_resource_types.add type
 -    env = Puppet::Node::Environment.new
 -    unless env.known_resource_types.watching_file?(@input_file_name)
++    environment = Puppet::Node::Environment.new
++    unless environment.known_resource_types.watching_file?(@input_file_name)
+       Puppet.info "rdoc: scanning #{@input_file_name}"
+       if @input_file_name =~ /\.pp$/
 -        @parser = Puppet::Parser::Parser.new(env)
++        @parser = Puppet::Parser::Parser.new(environment)
+         @parser.file = @input_file_name
 -        @ast = @parser.parse
++        @known_resource_types = environment.known_resource_types
++        @parser.parse.instantiate('').each do |type|
++          @known_resource_types.add type
++        end
++        scan_top_level(@top_level)
        end
 -      scan_top_level(@top_level)
      end
-     scan_top_level(@top_level)
      @top_level
    end
  
@@@ -338,7 -337,7 +340,7 @@@
    # that contains the documentation
    def parse_elements(container)
      Puppet.debug "rdoc: scanning manifest"
 -    @ast.hostclasses.values.sort { |a,b| a.name <=> b.name }.each do |klass|
 +    @known_resource_types.hostclasses.values.sort { |a,b| a.name <=> b.name }.each do |klass|
        name = klass.name
        if klass.file == @input_file_name
          unless name.empty?
@@@ -351,13 -350,13 +353,13 @@@
        end
      end
  
 -    @ast.definitions.each do |name, define|
 +    @known_resource_types.definitions.each do |name, define|
        if define.file == @input_file_name
          document_define(name,define,container)
        end
      end
  
 -    @ast.nodes.each do |name, node|
 +    @known_resource_types.nodes.each do |name, node|
        if node.file == @input_file_name
          document_node(name.to_s,node,container)
        end
diff --combined spec/unit/util/rdoc/parser_spec.rb
index 5dc083c,3614c0a..7809c75
--- a/spec/unit/util/rdoc/parser_spec.rb
+++ b/spec/unit/util/rdoc/parser_spec.rb
@@@ -16,17 -16,12 +16,12 @@@ describe RDoc::Parser d
    end
  
    describe "when scanning files" do
-     before do
-       @environment = Puppet::Node::Environment.new("foo")
-     end
- 
      it "should parse puppet files with the puppet parser" do
        @parser.stubs(:scan_top_level)
        parser = stub 'parser'
        Puppet::Parser::Parser.stubs(:new).returns(parser)
 -      parser.expects(:parse)
 +      parser.expects(:parse).returns(Puppet::Parser::AST::Hostclass.new(''))
        parser.expects(:file=).with("module/manifests/init.pp")
-       parser.expects(:environment).returns(@environment)
  
        @parser.scan
      end
@@@ -34,8 -29,6 +29,7 @@@
      it "should scan the ast for Puppet files" do
        parser = stub_everything 'parser'
        Puppet::Parser::Parser.stubs(:new).returns(parser)
-       parser.expects(:environment).returns(@environment)
 +      parser.expects(:parse).returns(Puppet::Parser::AST::Hostclass.new(''))
  
        @parser.expects(:scan_top_level)
  
@@@ -45,8 -38,6 +39,7 @@@
      it "should return a PuppetTopLevel to RDoc" do
        parser = stub_everything 'parser'
        Puppet::Parser::Parser.stubs(:new).returns(parser)
-       parser.expects(:environment).returns(@environment)
 +      parser.expects(:parse).returns(Puppet::Parser::AST::Hostclass.new(''))
  
        @parser.expects(:scan_top_level)
  
@@@ -56,8 -47,8 +49,8 @@@
  
    describe "when scanning top level entities" do
      before :each do
 -      @resource_type_collection = stub_everything 'resource_type_collection'
 -      @parser.ast = @resource_type_collection
 +      @resource_type_collection = resource_type_collection = stub_everything('resource_type_collection')
 +      @parser.instance_eval { @known_resource_types = resource_type_collection }
        @parser.stubs(:split_module).returns("module")
  
        @topcontainer = stub_everything 'topcontainer'
@@@ -150,8 -141,8 +143,8 @@@
        @definition = stub_everything 'definition', :file => "module/manifests/init.pp", :type => :definition, :name => "mydef"
        @node = stub_everything 'node', :file => "module/manifests/init.pp", :type => :node, :name => "mynode"
  
 -      @resource_type_collection = Puppet::Resource::TypeCollection.new("env")
 -      @parser.ast = @resource_type_collection
 +      @resource_type_collection = resource_type_collection = Puppet::Resource::TypeCollection.new("env")
 +      @parser.instance_eval { @known_resource_types = resource_type_collection }
  
        @container = stub_everything 'container'
      end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list