lib/origen/application.rb in origen-0.51.1 vs lib/origen/application.rb in origen-0.51.2
- old
+ new
@@ -48,10 +48,12 @@
# Origen.app.plugins << app
else
Origen.register_application(app)
end
app.add_lib_to_load_path!
+ # Also blow this cache as a new app has just been added
+ @apps_by_namespace = nil
end
end
end
def instance
@@ -133,15 +135,10 @@
# @api private
#
# Returns a lookup table for all block definitions (app/blocks) that the app contains
def blocks_files
- # There seems to be some issue with this cache being corrupted when running the test suite
- # in Travis, but don't believe that this is really an issue in practice and cannot replicate
- # it locally. Therefore maintaining the cache of this potentially expensive operation except
- # from when running in CI.
- @blocks_files = nil if ENV['CONTINUOUS_INTEGRATION']
@blocks_files ||= begin
files = {}
block_dir = Pathname.new(File.join(root, 'app', 'blocks'))
if block_dir.exist?
block_dir.children.each do |item|
@@ -165,10 +162,10 @@
Dir.glob(current_dir.join('*.rb')).each do |file|
file = Pathname.new(file)
type = file.basename('.rb').to_s.to_sym
unless type == :model || type == :controller
files[path][type] ||= []
- files[path][type] << file
+ files[path][type] << file.to_s
end
end
derivatives = current_dir.join('derivatives')
if derivatives.exist?
derivatives.children.each do |item|