test_ids 1.1.1 → 1.1.2

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: 306a202dcc8ef6fc823e3f3429e9466674c4a26442a4cb3a10f4ac15b8c8eb9d
4
- data.tar.gz: c20808121f1887cca29eae01ea100f1026a8782dfee389fc5c4600bf23a7e606
3
+ metadata.gz: 2715a10e5e999b8e7cb1d8240803232fadf178139e64a2f44186d69b65602a15
4
+ data.tar.gz: 2b550ced04afc190362992970a7cfaeb76e7ba78d519894ebdeb04391cd3b721
5
5
  SHA512:
6
- metadata.gz: f86d3e0ace61cf2f6f7a0f66b779b6606b7dc474456ced944c6e1a527a9045a364ebb53048a4b29b57da89f15f0d2619c843a61d6339231842131f83d34ee91e
7
- data.tar.gz: 5806f010b4dfa01e6084298ea57994881689a6df815f1235ccd5116b4cf9771dc453fd1fe518d9fa4930a949fcc34da54965286278d3a862908e0281be660c2d
6
+ metadata.gz: 4d62fc377c3bcbd5e840ed16c17e3749d7611f95e89eee17fe4bfa5ae7b572e6db8f12bf6016393f103e3dc2c59363205b5c90ad8ad999d43d87ba52017fd349
7
+ data.tar.gz: dfe969df5389777ea3545f506b78046b0d5596d49fc37890b7eab748329337ee955050ed6756c0977d22420408b6329c1dcaab1f400e0d8ef744c386bd197f13
@@ -1,7 +1,7 @@
1
1
  module TestIds
2
2
  MAJOR = 1
3
3
  MINOR = 1
4
- BUGFIX = 1
4
+ BUGFIX = 2
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -33,24 +33,15 @@ module TestIds
33
33
  end
34
34
 
35
35
  def range_item(range, options)
36
- orig_options = options.dup
37
- # Now Check if the database (JSON file) exists.
38
- # If file exists, load the database and create the alias for ['pointer']['ranges']
39
- if file && File.exist?(file)
40
- lines = File.readlines(file)
41
- # Remove any header comment lines since these are not valid JSON
42
- lines.shift while lines.first =~ /^\/\// && !lines.empty?
43
- s = JSON.load(lines.join("\n"))
44
- rangehash = s['pointers']['ranges']
45
- if rangehash.nil?
46
- rangehash = store['pointers']['ranges'] ||= {}
47
- else
48
- rangehash = Hash[rangehash.map { |k, v| [k.to_sym, v] }]
49
- end
36
+ # This is the actual fix, it should now not be dependent on the json file being read in, instead the store pointers
37
+ # will be utilized to get the correct number assigned from the range.
38
+ if store['pointers']['ranges'].nil?
39
+ rangehash = {}
50
40
  else
51
- # Create an alias for the databse that stores the pointers per range
52
- rangehash = store['pointers']['ranges'] ||= {}
41
+ rangehash = store['pointers']['ranges']
42
+ rangehash = Hash[rangehash.map { |k, v| [k.to_sym, v] }]
53
43
  end
44
+ orig_options = options.dup
54
45
  # Check the database to see if the passed in range has already been included in the database hash
55
46
  if rangehash.key?(:"#{range}")
56
47
  # Read out the database hash to see what the last_softbin given out was for that range.
@@ -82,6 +73,9 @@ module TestIds
82
73
  Origen.log.error 'Assigned value not in range'
83
74
  fail
84
75
  end
76
+ # Since the assigned value for this test has now changed, update store to contain the newly assigned value
77
+ # so that when the json file is written, it contains the latest assigned value name.
78
+ store['pointers']['ranges'] = rangehash
85
79
  assigned_value
86
80
  end
87
81
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_ids
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.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: 2019-02-13 00:00:00.000000000 Z
11
+ date: 2020-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen
@@ -100,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  - !ruby/object:Gem::Version
101
101
  version: 1.8.11
102
102
  requirements: []
103
- rubyforge_project:
104
- rubygems_version: 2.7.7
103
+ rubygems_version: 3.0.3
105
104
  signing_key:
106
105
  specification_version: 4
107
106
  summary: Origen plugin to assign and track test program bins and test numbers