Class: BuildTool::Cfg::SvnDeclarationNodeVisitor

Inherits:
ListVisitor show all
Defined in:
lib/build-tool/cfg/visitor.rb

Instance Attribute Summary

Attributes inherited from VisitorBase

#configuration

Instance Method Summary collapse

Methods inherited from ListVisitor

#visit, #visit_nodes

Methods inherited from VisitorBase

#visit_Object

Constructor Details

#initialize(configuration, vcs) ⇒ SvnDeclarationNodeVisitor

Returns a new instance of SvnDeclarationNodeVisitor.



734
735
736
737
# File 'lib/build-tool/cfg/visitor.rb', line 734

def initialize( configuration, vcs )
    super( configuration )
    @vcs = vcs
end

Instance Method Details

#visit_RemotePathNode(node) ⇒ Object



761
762
763
# File 'lib/build-tool/cfg/visitor.rb', line 761

def visit_RemotePathNode( node )
    @vcs.remote_path = node.value
end

#visit_RepositoryDeclarationNode(node) ⇒ Object



748
749
750
751
# File 'lib/build-tool/cfg/visitor.rb', line 748

def visit_RepositoryDeclarationNode( node )
    visitor = RepositoryDeclarationNodeVisitor.new( configuration )
    @vcs.repository = node.accept( visitor )
end

#visit_SvnCheckoutOnlyNode(node) ⇒ Object



744
745
746
# File 'lib/build-tool/cfg/visitor.rb', line 744

def visit_SvnCheckoutOnlyNode( node )
    @vcs.only = node.value.split( / +/ )
end

#visit_SvnDeclarationNode(node) ⇒ Object



739
740
741
742
# File 'lib/build-tool/cfg/visitor.rb', line 739

def visit_SvnDeclarationNode( node )
    visit_nodes( node.values )
    return @vcs
end

#visit_UseRepositoryNode(node) ⇒ Object



753
754
755
756
757
758
759
# File 'lib/build-tool/cfg/visitor.rb', line 753

def visit_UseRepositoryNode( node )
    repo = configuration.repository( node.value )
    if repo.nil?
        raise ConfigurationError, "Unknown repository #{node.value}!"
    end
    @vcs.repository = repo
end