module BaseChip::Base::InstanceMethods
Public Instance Methods
configure()
click to toggle source
Calls superclass method
# File lib/base_chip/base.rb, line 60 def configure return if @configured super # if self.class.children_types.keys.include?(:tool) && self.tools # self.tools.each_value do |t| # t.configure # t.selected_version.configure # t.selected_version.actions.each do |n,a| # self.actions ||= {} # if self.actions[n] # self.actions[n].blks = a.blks + self.actions[n].blks # self.actions[n].foster ||= a.parent # else # self.actions[n] = a.clone # self.actions[n].blks = self.actions[n].blks.dup # self.actions[n].foster = a.parent # self.actions[n].parent = self # end # end # end # end end
discover_configurations()
click to toggle source
# File lib/base_chip/base.rb, line 83 def discover_configurations Dir.glob("#{BaseChip.root}/*/base_chip/configuration.rb").each do |f| if f =~ /(\w+)\/base_chip\/configuration\.rb$/ self.block($1.to_sym) {|b| b.file f} end end end
file_glob(glob, regex = nil, type = nil)
click to toggle source
# File lib/base_chip/base.rb, line 90 def file_glob(glob, regex = nil, type = nil) Dir.glob(glob).each do |f| if regex if f =~ regex self.send(type, $1.to_sym) { |t| t.file(f) } else fault "fileglob '#{glob}' did not match regex /#{regex}/ in #{self.name}" end else self.file(f) end end end
foster=(parent)
click to toggle source
# File lib/base_chip/base.rb, line 45 def foster=(parent); @foster = parent; update_chaining; end
parent=(parent)
click to toggle source
# File lib/base_chip/base.rb, line 44 def parent=(parent); @parent = parent; update_chaining; end
update_chaining()
click to toggle source
# File lib/base_chip/base.rb, line 46 def update_chaining # chain blocks, projects, and actions together @project ||= (self.is_a? BaseChip::Project ) ? self : ((parent.project if parent) || (foster.project if foster)) @block ||= (self.is_a? BaseChip::Block ) ? self : ((parent.block if parent) || (foster.block if foster)) @configuration ||= (self.is_a? BaseChip::Configuration ) ? self : ((parent.configuration if parent) || (foster.configuration if foster)) @action ||= (self.is_a? BaseChip::Action ) ? self : ((parent.action if parent) || (foster.action if foster)) @test_list ||= (self.is_a? BaseChip::TestList ) ? self : ((parent.test_list if parent) || (foster.test_list if foster)) @test ||= (self.is_a? BaseChip::Test ) ? self : ((parent.test if parent) || (foster.test if foster)) @tool ||= (self.is_a? BaseChip::Tool ) ? self : ((parent.tool if parent) || (foster.tool if foster)) @tool_version ||= (self.is_a? BaseChip::ToolVersion ) ? self : ((parent.tool_version if parent) || (foster.tool_version if foster)) @source_type ||= (self.is_a? BaseChip::SourceType ) ? self : ((parent.source_type if parent) || (foster.source_type if foster)) @source_language ||= (self.is_a? BaseChip::SourceLanguage) ? self : ((parent.source_language if parent) || (foster.source_language if foster)) end