Class: BuildTool::Cfg::FeatureNodeVisitor
Instance Attribute Summary
#configuration
Instance Method Summary
collapse
#visit_LogDirectoryNode
#visit_BuildSystemDeclarationNode, #visit_ConfigurationFileList, #visit_DisableFeatureNode, #visit_DisableModuleNode, #visit_EnableFeatureNode, #visit_EnableModuleNode, #visit_EnvironmentDeclarationNode, #visit_GitOptionsDeclarationNode, #visit_IncludeNode, #visit_ModuleDeclarationNode, #visit_RepositoryDeclarationNode, #visit_ServerDeclarationNode, #visit_SshKeyDeclarationNode
Methods inherited from ListVisitor
#visit, #visit_nodes
#visit_Object
Constructor Details
Returns a new instance of FeatureNodeVisitor.
284
285
286
287
|
# File 'lib/build-tool/cfg/visitor.rb', line 284
def initialize( configuration )
super( configuration )
@feature = nil
end
|
Instance Method Details
#visit_FeatureNode(node) ⇒ Object
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
|
# File 'lib/build-tool/cfg/visitor.rb', line 289
def visit_FeatureNode( node )
raise ArgumentsError if node.values.length != 2
childs = node.values
name = childs.shift
if configuration.active_feature
@feature = configuration.feature( "#{configuration.active_feature.path}/#{name}" )
else
@feature = configuration.feature( name )
end
if @feature.nil?
@feature = configuration.create_feature( name, configuration.active_feature )
end
old_feat = configuration.active_feature
configuration.active_feature= @feature
visit_nodes( childs.shift )
configuration.active_feature = old_feat
end
|
#visit_LongDescriptionNode(node) ⇒ Object
312
313
314
315
316
317
|
# File 'lib/build-tool/cfg/visitor.rb', line 312
def visit_LongDescriptionNode( node )
if @feature.long_description
logger.warn "Overwriting long description for feature #{@feature.name}"
end
@feature.long_description = node.values
end
|
#visit_ShortDescriptionNode(node) ⇒ Object
319
320
321
322
323
324
|
# File 'lib/build-tool/cfg/visitor.rb', line 319
def visit_ShortDescriptionNode( node )
if !@feature.description.nil?
logger.warn "Overwriting short description for feature #{@feature.name}"
end
@feature.description = node.values
end
|