Class: BuildTool::Cfg::ArchiveDeclarationNodeVisitor

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

Instance Attribute Summary

Attributes inherited from MJ::VisitorBase

#configuration

Instance Method Summary collapse

Methods inherited from ListVisitor

#visit, #visit_nodes

Methods inherited from MJ::VisitorBase

#visit_Object

Constructor Details

#initialize(configuration, vcs) ⇒ ArchiveDeclarationNodeVisitor

Returns a new instance of ArchiveDeclarationNodeVisitor.



192
193
194
195
# File 'lib/build-tool/cfg/visitor.rb', line 192

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

Instance Method Details

#visit_ArchiveDeclarationNode(node) ⇒ Object



197
198
199
200
# File 'lib/build-tool/cfg/visitor.rb', line 197

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

#visit_RemotePathNode(node) ⇒ Object



215
216
217
# File 'lib/build-tool/cfg/visitor.rb', line 215

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

#visit_RepositoryDeclarationNode(node) ⇒ Object



202
203
204
205
# File 'lib/build-tool/cfg/visitor.rb', line 202

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

#visit_UseRepositoryNode(node) ⇒ Object



207
208
209
210
211
212
213
# File 'lib/build-tool/cfg/visitor.rb', line 207

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