Class: BuildTool::Cfg::GitDeclarationNodeVisitor

Inherits:
GitRemoteDeclarationNodeVisitor show all
Includes:
GitOptionDeclarationMethods
Defined in:
lib/build-tool/cfg/visitor.rb

Direct Known Subclasses

GitSvnDeclarationNodeVisitor

Instance Attribute Summary

Attributes inherited from MJ::VisitorBase

#configuration

Instance Method Summary collapse

Methods included from GitOptionDeclarationMethods

included

Methods inherited from GitRemoteDeclarationNodeVisitor

#visit_GitRemotePushNode, #visit_GitRemoteUrlNode

Methods inherited from ListVisitor

#visit, #visit_nodes

Methods inherited from MJ::VisitorBase

#visit_Object

Constructor Details

#initialize(configuration, vcs) ⇒ GitDeclarationNodeVisitor

Returns a new instance of GitDeclarationNodeVisitor.



414
415
416
417
418
419
# File 'lib/build-tool/cfg/visitor.rb', line 414

def initialize( configuration, vcs )
    super( configuration )
    @remote = BuildTool::VCS::GitRemote.new( "origin" )
    @vcs = vcs
    @vcs.remote[@remote.name] = @remote
end

Instance Method Details

#visit_GitDeclarationNode(node) ⇒ Object



421
422
423
424
425
426
427
# File 'lib/build-tool/cfg/visitor.rb', line 421

def visit_GitDeclarationNode( node )
    visit_nodes( node.values )
    if @remote.server.nil? and @remote.path.nil?
        @vcs.remote.delete( "origin" )
    end
    return @vcs
end

#visit_GitRemoteDeclarationNode(node) ⇒ Object



429
430
431
432
433
# File 'lib/build-tool/cfg/visitor.rb', line 429

def visit_GitRemoteDeclarationNode( node )
    visitor = GitRemoteDeclarationNodeVisitor.new( configuration )
    remote = node.accept(visitor)
    @vcs.remote[remote.name] = remote
end

#visit_GitTrackNode(node) ⇒ Object



435
436
437
# File 'lib/build-tool/cfg/visitor.rb', line 435

def visit_GitTrackNode( node )
    @vcs.track = node.values
end