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.



870
871
872
873
# File 'lib/build-tool/cfg/visitor.rb', line 870

def initialize( configuration )
    super
    @sshkey = nil
end

Instance Method Details

#visit_SshKeyDeclarationNode(node) ⇒ Object



875
876
877
878
879
880
881
882
# File 'lib/build-tool/cfg/visitor.rb', line 875

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



884
885
886
# File 'lib/build-tool/cfg/visitor.rb', line 884

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