origen 0.28.1 → 0.28.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/version.rb +1 -1
- data/lib/origen/application.rb +7 -0
- data/lib/origen/callbacks.rb +5 -0
- data/lib/origen/generator/compiler.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b668d7712bef8be358291fe9bec47914b1738b43
|
4
|
+
data.tar.gz: f24c2df62d2f22ec88a6e9d417205129e5923ce4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0eafb6914409f6a5ebdf07c03e769caf9457858570050d89ff4af0e4cd0672d5153802d31d448eb00c18b89dce97ef66908ef34972fec196f32c5f94dd4ba6a
|
7
|
+
data.tar.gz: e4616d302bd38753d3abd11feabc11a5e21cdc8bfe32f42415ec859eb094df3c93a5ff7412f42acdd11010e80f179bda5edec7fc145fa587fd1c52e5f3fc0c50
|
data/config/version.rb
CHANGED
data/lib/origen/application.rb
CHANGED
@@ -755,6 +755,7 @@ END
|
|
755
755
|
options = {
|
756
756
|
force_debug: false
|
757
757
|
}.merge(options)
|
758
|
+
@on_create_called = false
|
758
759
|
if options[:reload]
|
759
760
|
@target_load_count = 0
|
760
761
|
else
|
@@ -785,6 +786,7 @@ END
|
|
785
786
|
@target_instantiated = true
|
786
787
|
Origen.mode = :debug if options[:force_debug]
|
787
788
|
listeners_for(:on_create).each(&:on_create)
|
789
|
+
@on_create_called = true
|
788
790
|
# Keep this within the load_event to ensure any objects that are further instantiated objects
|
789
791
|
# will be associated with (and cleared out upon reload of) the current target
|
790
792
|
listeners_for(:on_load_target).each(&:on_load_target)
|
@@ -794,6 +796,11 @@ END
|
|
794
796
|
# @target_instantiated = true
|
795
797
|
end
|
796
798
|
|
799
|
+
# Returns true if the on_create callback has already been called during a target load
|
800
|
+
def on_create_called?
|
801
|
+
!!@on_create_called
|
802
|
+
end
|
803
|
+
|
797
804
|
# Not a clean unload, but allows objects to be re-instantiated for testing
|
798
805
|
# @api private
|
799
806
|
def unload_target!
|
data/lib/origen/callbacks.rb
CHANGED
@@ -9,6 +9,11 @@ module Origen
|
|
9
9
|
|
10
10
|
def register_callback_listener # :nodoc:
|
11
11
|
Origen.app.add_callback_listener(self)
|
12
|
+
# If this object has been instantiated after on_create has already been called,
|
13
|
+
# then invoke it now
|
14
|
+
if Origen.app.on_create_called?
|
15
|
+
on_create if respond_to?(:on_create)
|
16
|
+
end
|
12
17
|
end
|
13
18
|
end
|
14
19
|
|
@@ -197,8 +197,10 @@ module Origen
|
|
197
197
|
|
198
198
|
# Returns the ERB buffer name for the given file, something like "@my_file_name"
|
199
199
|
def buffer_name_for(file)
|
200
|
-
|
201
|
-
|
200
|
+
expected_filename = file.basename.to_s.chomp('.erb')
|
201
|
+
expected_filename.gsub!('-', '_') if expected_filename.match(/-/)
|
202
|
+
expected_filename.gsub!('.', '_') if expected_filename.match(/./)
|
203
|
+
@current_buffer = '@_' + expected_filename
|
202
204
|
end
|
203
205
|
|
204
206
|
def merge_file(file, _options = {})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.28.
|
4
|
+
version: 0.28.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|