lib/origen/sub_blocks.rb in origen-0.51.1 vs lib/origen/sub_blocks.rb in origen-0.51.2

- old
+ new

@@ -297,10 +297,12 @@ if sub_blocks[name] && !sub_blocks[name].is_a?(Placeholder) fail "You have already defined a sub-block named #{name} within class #{self.class}" end if respond_to?(name) callers = caller[0].split(':') + # reunite the drive and path if on windows os + callers[0] = callers[0] + ':' + callers.delete_at(1) if Origen.os.windows? Origen.log.warning "The sub_block defined at #{Pathname.new(callers[0]).relative_path_from(Pathname.pwd)}:#{callers[1]} is overriding an existing method called #{name}" end define_singleton_method name do get_sub_block(name) end @@ -351,9 +353,11 @@ @current_group = [] # open group yield # any sub_block calls within this block will have their ID added to @current_group my_group = @current_group.dup if respond_to?(id) callers = caller[0].split(':') + # reunite the drive and path if on windows os + callers[0] = callers[0] + ':' + callers.delete_at(1) if Origen.os.windows? Origen.log.warning "The sub_block_group defined at #{Pathname.new(callers[0]).relative_path_from(Pathname.pwd)}:#{callers[1]} is overriding an existing method called #{id}" end define_singleton_method "#{id}" do if options[:class_name] b = Object.const_get(options[:class_name]).new