origen 0.7.24 → 0.7.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/version.rb +1 -1
- data/lib/origen.rb +21 -1
- data/lib/origen/application.rb +4 -4
- data/lib/origen/generator.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f00de9cfd35bf3b781f46b122cdba834cc4e463e
|
4
|
+
data.tar.gz: b7bd2adf089d4ed70c76ed834fbcbf1a2afba6bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9714b2e319c3aaef19d537801f97969d2852e7b843a91f88fe7a9cd19786e58a28b79a7a0036defacfe2bb292f522ef13053c90ab14c189dcc8d16ccd36cf6c8
|
7
|
+
data.tar.gz: ad47dec90e2fa07fe5c9c19840681d715716c8913b1871bca2e30685471240902bff5761ec789a29adcdf06067e5da68b041d1e6a6db3f9edb890939742e8259
|
data/config/version.rb
CHANGED
data/lib/origen.rb
CHANGED
@@ -105,9 +105,10 @@ unless defined? RGen::ORIGENTRANSITION
|
|
105
105
|
Origen.app.plugins
|
106
106
|
end
|
107
107
|
|
108
|
-
def
|
108
|
+
def application_loaded?
|
109
109
|
@application_loaded
|
110
110
|
end
|
111
|
+
alias_method :app_loaded?, :application_loaded?
|
111
112
|
|
112
113
|
def plugins_loaded?
|
113
114
|
@plugins_loaded
|
@@ -452,10 +453,29 @@ unless defined? RGen::ORIGENTRANSITION
|
|
452
453
|
validate_origen_dev_configuration!
|
453
454
|
([@application] + Origen.app.plugins).each(&:on_loaded)
|
454
455
|
@application_loaded = true
|
456
|
+
Array(@after_app_loaded_blocks).each { |b| b.call(@application) }
|
455
457
|
@application
|
456
458
|
end
|
457
459
|
end
|
458
460
|
|
461
|
+
# Sometimes it is necessary to refer to the app instance before it is fully loaded, which can lead to runtime
|
462
|
+
# errors.
|
463
|
+
#
|
464
|
+
# Such code can be wrapped in this method to ensure that it will run safely by differing it until the app
|
465
|
+
# is fully loaded.
|
466
|
+
#
|
467
|
+
# Origen.after_app_loaded do
|
468
|
+
# Origen.app.do_something
|
469
|
+
# end
|
470
|
+
def after_app_loaded(&block)
|
471
|
+
if application_loaded?
|
472
|
+
yield app
|
473
|
+
else
|
474
|
+
@after_app_loaded_blocks ||= []
|
475
|
+
@after_app_loaded_blocks << block
|
476
|
+
end
|
477
|
+
end
|
478
|
+
|
459
479
|
# @api private
|
460
480
|
def loading_top_level?
|
461
481
|
@loading_top_level
|
data/lib/origen/application.rb
CHANGED
@@ -36,7 +36,7 @@ module Origen
|
|
36
36
|
app = base.instance
|
37
37
|
app.root = root.to_s
|
38
38
|
if Origen.plugins_loaded? && !Origen.loading_top_level?
|
39
|
-
Origen.log.warning "The #{app.name} plugin is using a non-standard loading mechanism, upgrade to a newer version to get rid of this
|
39
|
+
Origen.log.warning "The #{app.name} plugin is using a non-standard loading mechanism, upgrade to a newer version of it to get rid of this warning (please report a bug to its owner if this warning persists)"
|
40
40
|
Origen.app.plugins << app
|
41
41
|
else
|
42
42
|
Origen.register_application(app)
|
@@ -260,10 +260,10 @@ module Origen
|
|
260
260
|
def current?
|
261
261
|
# If this is called before the plugins are loaded (i.e. by a plugin's application file), then
|
262
262
|
# it is definitely not the top-level app
|
263
|
-
if Origen.
|
263
|
+
if Origen.application_loaded?
|
264
264
|
Origen.app == self
|
265
265
|
else
|
266
|
-
|
266
|
+
Origen.root == root
|
267
267
|
end
|
268
268
|
end
|
269
269
|
alias_method :standalone?, :current?
|
@@ -272,7 +272,7 @@ module Origen
|
|
272
272
|
# Returns true if the given application instance is
|
273
273
|
# the current plugin
|
274
274
|
def current_plugin?
|
275
|
-
if Origen.
|
275
|
+
if Origen.application_loaded?
|
276
276
|
Origen.app.plugins.current == self
|
277
277
|
else
|
278
278
|
puts <<-END
|
data/lib/origen/generator.rb
CHANGED