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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73c99a4efdb1a7f595896b7b1c2300f2893bdc6f
4
- data.tar.gz: 32d2f94bca108ff539d1c16d846731a072f60f55
3
+ metadata.gz: b668d7712bef8be358291fe9bec47914b1738b43
4
+ data.tar.gz: f24c2df62d2f22ec88a6e9d417205129e5923ce4
5
5
  SHA512:
6
- metadata.gz: 561c1b67a67028c015cbcbc9b1fd5da10291f7995f55da5e4bcefeb768bbc5935068aceb140e7aca51ca096e817c024151aca36e615e324748659cbc3a3665eb
7
- data.tar.gz: 2d78a652c904d98670ab82d1396b9f139fe91d611963bad5eaa15088533773fdb637ea223180a23e84cb68fc136e04aa2893e27d44a900b7628efcdbb0da83a7
6
+ metadata.gz: e0eafb6914409f6a5ebdf07c03e769caf9457858570050d89ff4af0e4cd0672d5153802d31d448eb00c18b89dce97ef66908ef34972fec196f32c5f94dd4ba6a
7
+ data.tar.gz: e4616d302bd38753d3abd11feabc11a5e21cdc8bfe32f42415ec859eb094df3c93a5ff7412f42acdd11010e80f179bda5edec7fc145fa587fd1c52e5f3fc0c50
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 28
4
- BUGFIX = 1
4
+ BUGFIX = 2
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -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!
@@ -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
- # Not sure why the final gsub is needed but seems to fail to parse correctly otherwise.
201
- @current_buffer = "@_#{file.basename('.*').basename('.*').to_s.gsub('-', '_')}"
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.1
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-01 00:00:00.000000000 Z
11
+ date: 2017-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport