origen 0.61.3 → 0.62.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd07a38be9bb273d3921d65bd7f5a44183b6f21ff89293a1e9a111b4bee95ce7
4
- data.tar.gz: ac025a4ce036eeb26f685a8570198872edebba0cf6a83ddc7f34f80d6ff7b1c7
3
+ metadata.gz: 8d7e8a11bc3eda2d32437fe4e757947beba29c6d1feafc5ad113f0bd6cdbb4b9
4
+ data.tar.gz: 5adc79314c76e4cba8c5fc6fa5ce7cf9b5b987285426e395f24e5de67c302b8f
5
5
  SHA512:
6
- metadata.gz: f70fb4a46e1e082af9a9bd108da2f441158bdfad148b6eefd1251bc3384231345ae633b2157491512ec1fe9e90ae4a913188e0daa768b5b22924423b6d06a6a9
7
- data.tar.gz: 3be1ee7bd6407d0af48553baf0eab1bcb1b98e15e567164f3aa1413a8275a956a6d367281ad427c4cef52a04266ef478c8cbfc2ec0ba7cf23a20d6321ab6e55c
6
+ metadata.gz: 6254128c52c57e6b979f0d3b98d64837fb43f29ff1c3a9e42fff53bbba9ac352ff7239f4ccba309a87875cc38095c08686d602952fa79b3c8bac12e36e9eae9f
7
+ data.tar.gz: 56683e322e8919b0230f0d712bd44a56a35e49256bf9ad7c3e2d628c416300856fe12cb9ab9831a9f554da88bd9fc5c2380882c800ece976fa2b56c27464f633
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
- MINOR = 61
4
- BUGFIX = 3
3
+ MINOR = 62
4
+ BUGFIX = 0
5
5
  DEV = nil
6
6
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
7
7
  end
@@ -10,9 +10,17 @@ module Origen
10
10
  @name = name
11
11
  @affected_versions = [options[:affected_version] || options[:affected_versions]].flatten.compact
12
12
  @fixed_on_version = options[:fixed_on_version]
13
+ @unfixable = options[:unfixable]
14
+ end
15
+
16
+ # An unfixable bug applies regardless of the IP version.
17
+ def unfixable?
18
+ !!@unfixable
13
19
  end
14
20
 
15
21
  def present_on_version?(version, _options = {})
22
+ return true if unfixable?
23
+
16
24
  if affected_versions.empty?
17
25
  if fixed_on_version
18
26
  version < fixed_on_version
data/lib/origen/bugs.rb CHANGED
@@ -20,20 +20,22 @@ module Origen
20
20
  end
21
21
  end
22
22
 
23
- # Returns true if the version of the IP represented by the object has the bug of the
24
- # given name
23
+ # Returns true if the IP represented by the object has the bug of the given name.
24
+ # Bugs explicitly declared with unfixable: true can be queried without a version
25
+ # attribute.
25
26
  def has_bug?(name, _options = {})
27
+ name = name.to_s.downcase.to_sym
28
+ bug = bugs[name]
29
+
30
+ return true if bug && bug.unfixable?
31
+
26
32
  unless respond_to?(:version) && version
27
- puts 'To test for the presence of a bug the object must implement an attribute'
33
+ puts 'To test for the presence of a versioned bug the object must implement an attribute'
28
34
  puts "called 'version' which returns the IP version represented by the the object."
29
35
  fail 'Version undefined!'
30
36
  end
31
- name = name.to_s.downcase.to_sym
32
- if bugs[name]
33
- bugs[name].present_on_version?(version)
34
- else
35
- false
36
- end
37
+
38
+ bug ? bug.present_on_version?(version) : false
37
39
  end
38
40
 
39
41
  # Returns a hash containing all known bugs associated with
data/lib/origen.rb CHANGED
@@ -2,10 +2,12 @@
2
2
  # our original internal version (RGen)
3
3
  unless defined? RGen::ORIGENTRANSITION
4
4
  # ActiveSupport 4.2 wraps to_json via alias_method_chain, which causes infinite
5
- # recursion on Ruby 4 with json gem 2.x (to_json_without_active_support_encoder
6
- # ends up calling back into to_json_with_active_support_encoder). Intercept the
7
- # alias for the :to_json target before ActiveSupport's json core_ext loads.
8
- if RUBY_VERSION >= '4'
5
+ # recursion on Ruby 3.x and 4.x (to_json_without_active_support_encoder ends up
6
+ # calling back into to_json_with_active_support_encoder). The trigger is a Ruby 3.0+
7
+ # method-resolution change, NOT the json gem version (json 2.x ships on 2.6 too, yet
8
+ # 2.6 does not recurse). So the shim must apply to all of Ruby 3 and 4, not just 4.
9
+ # Intercept the alias for the :to_json target before ActiveSupport's json core_ext loads.
10
+ if RUBY_VERSION >= '3'
9
11
  require 'json'
10
12
  require 'active_support/core_ext/module/aliasing'
11
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.61.3
4
+ version: 0.62.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty