lib/origen/sub_blocks.rb in origen-0.60.0 vs lib/origen/sub_blocks.rb in origen-0.60.1

- old
+ new

@@ -334,10 +334,14 @@ # After requiring the files, constants become sane again: # e.g. NamespaceA::B::C # => NameSpaceA::B::C if constantizable && (options[:class_name] != options[:class_name].constantize.to_s) block_dir = options[:block_file] || _find_block_dir(options) + # files that aren't initializing a new namespace and have special loading shouldn't be required + # the code they contain may try to call methods that dont exist yet + skip_require_files = options[:skip_require_files] || %w(attributes parameters pins registers sub_blocks timesets) Dir.glob("#{block_dir}/*.rb").each do |file| + next if skip_require_files.include?(Pathname.new(file).basename('.rb').to_s) require file end end end else