Class: BuildTool::Cfg::SshKeyDeclarationNodeVisitor

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) ⇒ SshKeyDeclarationNodeVisitor

Returns a new instance of SshKeyDeclarationNodeVisitor.



874
875
876
877
# File 'lib/build-tool/cfg/visitor.rb', line 874

def initialize( configuration )
    super
    @sshkey = nil
end

Instance Method Details

#visit_SshKeyDeclarationNode(node) ⇒ Object



879
880
881
882
883
884
885
886
# File 'lib/build-tool/cfg/visitor.rb', line 879

def visit_SshKeyDeclarationNode( node )
    name = node.values[0]
    stmts = node.values[1]
    @sshkey = BuildTool::SshKey.new( name )
    configuration.add_sshkey( @sshkey )
    visit_nodes( stmts )
    return @sshkey
end

#visit_SshKeyFileNode(node) ⇒ Object



888
889
890
# File 'lib/build-tool/cfg/visitor.rb', line 888

def visit_SshKeyFileNode( node )
    @sshkey.file = File.expand_path( node.value )
end