inferno_core 1.0.4 → 1.0.6

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.
@@ -1,4 +1,5 @@
1
- require_relative 'result_collection'
1
+ require_relative 'dsl/result_collection'
2
+
2
3
  module Inferno
3
4
  # @private
4
5
  # This class takes an array of results and determines the overall result. This
@@ -1,4 +1,4 @@
1
1
  module Inferno
2
2
  # Standard patterns for gem versions: https://guides.rubygems.org/patterns/
3
- VERSION = '1.0.4'.freeze
3
+ VERSION = '1.0.6'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inferno_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-07-23 00:00:00.000000000 Z
13
+ date: 2025-07-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -438,14 +438,14 @@ dependencies:
438
438
  requirements:
439
439
  - - "~>"
440
440
  - !ruby/object:Gem::Version
441
- version: 1.2.1
441
+ version: '1.4'
442
442
  type: :runtime
443
443
  prerelease: false
444
444
  version_requirements: !ruby/object:Gem::Requirement
445
445
  requirements:
446
446
  - - "~>"
447
447
  - !ruby/object:Gem::Version
448
- version: 1.2.1
448
+ version: '1.4'
449
449
  - !ruby/object:Gem::Dependency
450
450
  name: tty-markdown
451
451
  requirement: !ruby/object:Gem::Requirement
@@ -494,6 +494,7 @@ files:
494
494
  - lib/inferno/apps/cli/suite_input_template.rb
495
495
  - lib/inferno/apps/cli/suites.rb
496
496
  - lib/inferno/apps/cli/templates/%library_name%.gemspec.tt
497
+ - lib/inferno/apps/cli/templates/.DS_Store
497
498
  - lib/inferno/apps/cli/templates/.dockerignore
498
499
  - lib/inferno/apps/cli/templates/.env
499
500
  - lib/inferno/apps/cli/templates/.env.development
@@ -525,14 +526,18 @@ files:
525
526
  - lib/inferno/apps/cli/templates/docs/_Footer.md
526
527
  - lib/inferno/apps/cli/templates/docs/_Sidebar.md
527
528
  - lib/inferno/apps/cli/templates/lib/%library_name%.rb.tt
529
+ - lib/inferno/apps/cli/templates/lib/%library_name%/.DS_Store
528
530
  - lib/inferno/apps/cli/templates/lib/%library_name%/example_suite.rb.tt
529
531
  - lib/inferno/apps/cli/templates/lib/%library_name%/example_suite/patient_group.rb.tt
530
532
  - lib/inferno/apps/cli/templates/lib/%library_name%/igs/.keep
531
533
  - lib/inferno/apps/cli/templates/lib/%library_name%/igs/README.md
532
534
  - lib/inferno/apps/cli/templates/lib/%library_name%/igs/put_ig_package_dot_tgz_here
533
535
  - lib/inferno/apps/cli/templates/lib/%library_name%/metadata.rb.tt
536
+ - lib/inferno/apps/cli/templates/lib/%library_name%/requirements/Inferno Requirements
537
+ Template.xlsx
534
538
  - lib/inferno/apps/cli/templates/lib/%library_name%/suite.rb.tt
535
539
  - lib/inferno/apps/cli/templates/lib/%library_name%/version.rb.tt
540
+ - lib/inferno/apps/cli/templates/lib/.DS_Store
536
541
  - lib/inferno/apps/cli/templates/run.sh
537
542
  - lib/inferno/apps/cli/templates/setup.sh
538
543
  - lib/inferno/apps/cli/templates/spec/%library_name%/patient_group_spec.rb.tt
@@ -645,6 +650,7 @@ files:
645
650
  - lib/inferno/dsl/primitive_type.rb
646
651
  - lib/inferno/dsl/request_storage.rb
647
652
  - lib/inferno/dsl/requirement_set.rb
653
+ - lib/inferno/dsl/result_collection.rb
648
654
  - lib/inferno/dsl/results.rb
649
655
  - lib/inferno/dsl/resume_test_route.rb
650
656
  - lib/inferno/dsl/runnable.rb
@@ -717,7 +723,6 @@ files:
717
723
  - lib/inferno/repositories/tests.rb
718
724
  - lib/inferno/repositories/validate_runnable_reference.rb
719
725
  - lib/inferno/repositories/validator_sessions.rb
720
- - lib/inferno/result_collection.rb
721
726
  - lib/inferno/result_summarizer.rb
722
727
  - lib/inferno/route_storage.rb
723
728
  - lib/inferno/spec_support.rb
@@ -1,72 +0,0 @@
1
- module Inferno
2
- # The ResultCollection class is used to manage a collection of Inferno::Entities::Result objects.
3
- # It provides methods to filter required and optional results, access results
4
- # by index or by their runnable IDs, and iterate over the collection.
5
- #
6
- # @example
7
- #
8
- # results = [
9
- # Result.new(test_group_id: 'group_id1', result: 'pass'),
10
- # Result.new(test_group_id: 'group_id2', result: 'fail'),
11
- # Result.new(test_group_id: 'group_id3', result: 'pass')
12
- # ]
13
- #
14
- # result_collection = Inferno::ResultCollection.new(results)
15
- #
16
- # # Access by index
17
- # result = result_collection[0]
18
- #
19
- # # Access by runnable ID (partial)
20
- # result = result_collection['group_id2']
21
- #
22
- # # Iterate over results
23
- # result_collection.each do |result|
24
- # puts result.result
25
- # end
26
- #
27
- # # Get required results
28
- # required_results = result_collection.required_results
29
- #
30
- # # Get optional results
31
- # optional_results = result_collection.optional_results
32
- # @private
33
- class ResultCollection
34
- include Enumerable
35
-
36
- attr_reader :results
37
-
38
- def initialize(results = [])
39
- @results = results
40
- end
41
-
42
- def [](key)
43
- key.is_a?(Integer) ? results[key] : lookup_by_runnable_id(key)
44
- end
45
-
46
- def <<(result)
47
- (results << result).flatten!
48
- self
49
- end
50
-
51
- def each(&)
52
- return to_enum(:each) unless block_given?
53
-
54
- results.each(&)
55
- self
56
- end
57
-
58
- def required_results
59
- results.select(&:required?)
60
- end
61
-
62
- def optional_results
63
- results.select(&:optional?)
64
- end
65
-
66
- private
67
-
68
- def lookup_by_runnable_id(key)
69
- results.find { |result| result.runnable&.id == key.to_s || result.runnable&.id&.end_with?("-#{key}") }
70
- end
71
- end
72
- end