inferno_core 0.5.4 → 0.6.0

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
  SHA256:
3
- metadata.gz: e11d6b274778016418f7189d8ec9e724cf20861c6e03385dc9c302299f198d18
4
- data.tar.gz: '09c65484d51b2f7be0a3985b374d51593d59c432ba11c21bd10d54c798ccafa4'
3
+ metadata.gz: ee348703cfa562d9316b03c470d62aebd0d4ac232d8dc6029bbac392cb5a64d1
4
+ data.tar.gz: 666f20e627f22eea29c764f9d10c6a2e421142edd0525631566a678f73ed3a45
5
5
  SHA512:
6
- metadata.gz: 0daf93ce97d8a5a8e9b409200d7c001e4ac49107887db05073399a74795a94b449d3c1eb1d139214c1402e1ea10a954ee1271b80c642909c379cd7bb0ba7a1f0
7
- data.tar.gz: 3a70bb18128af1494e0fcd1a023d8e18e8043dd535ae9c00f8471c8eb85e23678fa7c8bcb19591852c3593c6588ba92af206a90644cf6288659179fef98c1a41
6
+ metadata.gz: 85323238cd047bd7408aa5e50dcbf8bd7ff4bca02bbc985928627bf5431189bb6cee9f0d660218d7bd0684fb38e0f6bfd49aea164cdd08352c463cadaa30ed58
7
+ data.tar.gz: 8cd139293bf774f09749cbe3e723df226b2b74b79a3141ae144e09e573afcc8712495d9fa80eb62b901e05f5f0e2c7cc2810ea4b2e47ee70b53571964ad04683
@@ -51,8 +51,8 @@ module Inferno
51
51
 
52
52
  # private
53
53
 
54
- def verbose_print(options, *args)
55
- print(color.dim(*args)) if options[:verbose]
54
+ def verbose_print(options, *)
55
+ print(color.dim(*)) if options[:verbose]
56
56
  end
57
57
 
58
58
  def color
@@ -71,6 +71,7 @@ module Inferno
71
71
  inside(root_name) do
72
72
  bundle_install
73
73
  inferno_migrate
74
+ initialize_git_repo
74
75
  load_igs
75
76
  end
76
77
 
@@ -85,7 +86,7 @@ module Inferno
85
86
  private
86
87
 
87
88
  def authors
88
- options['author'].presence || [default_author]
89
+ (options['author'].presence || [default_author]).to_json.gsub('"', "'")
89
90
  end
90
91
 
91
92
  def default_author
@@ -106,6 +107,10 @@ module Inferno
106
107
  run 'bundle exec inferno migrate', verbose: !options['quiet'], capture: options['quiet']
107
108
  end
108
109
 
110
+ def initialize_git_repo
111
+ run 'git init -q && git add . && git commit -aqm "initial commit"'
112
+ end
113
+
109
114
  def load_igs
110
115
  config = { verbose: !options['quiet'] }
111
116
  options['implementation_guide']&.each_with_index do |ig, idx|
@@ -119,8 +124,8 @@ module Inferno
119
124
  end
120
125
  end
121
126
 
122
- def say_unless_quiet(*args)
123
- say(*args) unless options['quiet']
127
+ def say_unless_quiet(*)
128
+ say(*) unless options['quiet']
124
129
  end
125
130
  end
126
131
  end
@@ -6,8 +6,6 @@ module Inferno
6
6
  def run
7
7
  ENV['NO_DB'] = 'true'
8
8
 
9
- require_relative '../../../inferno'
10
-
11
9
  Inferno::Application.start(:suites)
12
10
 
13
11
  suites = Inferno::Repositories::TestSuites.new.all
@@ -5,29 +5,18 @@ Gem::Specification.new do |spec|
5
5
  spec.version = <%= module_name %>::VERSION
6
6
  spec.authors = <%= authors %>
7
7
  # spec.email = ['TODO']
8
- spec.date = Time.now.utc.strftime('%Y-%m-%d')
9
8
  spec.summary = '<%= title_name %>'
10
9
  # spec.description = <<~DESCRIPTION
11
10
  # This is a big markdown description of the test kit.
12
11
  # DESCRIPTION
13
12
  # spec.homepage = 'TODO'
14
13
  spec.license = 'Apache-2.0'
15
- spec.add_runtime_dependency 'inferno_core', '~> <%= Inferno::VERSION %>'
16
- spec.add_development_dependency 'database_cleaner-sequel', '~> 1.8'
17
- spec.add_development_dependency 'factory_bot', '~> 6.1'
18
- spec.add_development_dependency 'rspec', '~> 3.10'
19
- spec.add_development_dependency 'webmock', '~> 3.11'
20
- spec.required_ruby_version = Gem::Requirement.new('>= 3.1.2')
14
+ spec.add_dependency 'inferno_core', '~> <%= Inferno::VERSION %>'
15
+ spec.required_ruby_version = Gem::Requirement.new('>= 3.3.6')
21
16
  spec.metadata['inferno_test_kit'] = 'true'
22
17
  # spec.metadata['homepage_uri'] = spec.homepage
23
18
  # spec.metadata['source_code_uri'] = 'TODO'
24
- spec.files = [
25
- Dir['lib/**/*.rb'],
26
- Dir['lib/**/*.json'],
27
- Dir['config/presets/*.json'],
28
- Dir['config/presets/*.json.erb'],
29
- 'LICENSE'
30
- ].flatten
19
+ spec.files = `[ -d .git ] && git ls-files -z lib config/presets LICENSE`.split("\x0")
31
20
 
32
21
  spec.require_paths = ['lib']
33
22
  end
@@ -0,0 +1,77 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ AllCops:
5
+ NewCops: enable
6
+ SuggestExtensions: false
7
+ TargetRubyVersion: 3.3
8
+ Exclude:
9
+ - 'Gemfile'
10
+ - 'vendor/**/*'
11
+
12
+ Layout/LineLength:
13
+ Max: 120
14
+
15
+ Layout/MultilineMethodCallIndentation:
16
+ EnforcedStyle: 'indented'
17
+
18
+ Style/Documentation:
19
+ Enabled: false
20
+
21
+ Style/FrozenStringLiteralComment:
22
+ Enabled: false
23
+
24
+ Style/NumericLiterals:
25
+ Enabled: false
26
+
27
+ Style/OpenStructUse:
28
+ Exclude:
29
+ - 'spec/**/*'
30
+
31
+ Style/SymbolArray:
32
+ Enabled: false
33
+
34
+ Style/WordArray:
35
+ Enabled: false
36
+
37
+ Metrics/AbcSize:
38
+ Enabled: false
39
+
40
+ Metrics/BlockLength:
41
+ Enabled: false
42
+
43
+ Metrics/ClassLength:
44
+ Enabled: false
45
+
46
+ Metrics/MethodLength:
47
+ Enabled: false
48
+
49
+ Metrics/ModuleLength:
50
+ Enabled: false
51
+
52
+ Metrics/PerceivedComplexity:
53
+ Enabled: false
54
+
55
+ Metrics/ParameterLists:
56
+ Enabled: false
57
+
58
+ RSpec/AnyInstance:
59
+ Enabled: false
60
+
61
+ RSpec/ExampleLength:
62
+ Enabled: false
63
+
64
+ RSpec/MultipleExpectations:
65
+ Enabled: false
66
+
67
+ RSpec/MultipleMemoizedHelpers:
68
+ Enabled: false
69
+
70
+ RSpec/NestedGroups:
71
+ Enabled: false
72
+
73
+ RSpec/NotToNot:
74
+ EnforcedStyle: to_not
75
+
76
+ Gemspec/RequireMFA:
77
+ Enabled: false
@@ -1 +1 @@
1
- 3.1.2
1
+ 3.3.6
@@ -1 +1 @@
1
- ruby 3.1.2
1
+ ruby 3.3.6
@@ -1,4 +1,4 @@
1
- FROM ruby:3.1.2
1
+ FROM ruby:3.3.6
2
2
 
3
3
  ENV INSTALL_PATH=/opt/inferno/
4
4
  ENV APP_ENV=production
@@ -6,8 +6,15 @@ gemspec
6
6
 
7
7
  group :development, :test do
8
8
  gem 'debug'
9
+ gem 'rubocop', '~> 1.9'
10
+ gem 'rubocop-rspec', require: false
9
11
  end
10
12
 
11
13
  group :test do
14
+ gem 'database_cleaner-sequel', '~> 1.8'
15
+ gem 'factory_bot', '~> 6.1'
12
16
  gem 'rack-test'
17
+ gem 'rspec', '~> 3.10'
18
+ gem 'simplecov', '0.21.2', require: false
19
+ gem 'webmock', '~> 3.11'
13
20
  end
@@ -56,4 +56,4 @@ module <%= module_name %>
56
56
  # using their id
57
57
  group from: :patient_group
58
58
  end
59
- end
59
+ end
@@ -6,6 +6,7 @@ Inferno::Application.register_provider(:suites) do
6
6
  require 'inferno/entities/test_group'
7
7
  require 'inferno/entities/test_suite'
8
8
  require 'inferno/entities/test_kit'
9
+ require 'inferno/route_storage'
9
10
 
10
11
  files_to_load = Dir.glob(File.join(Dir.pwd, 'lib', '*.rb'))
11
12
 
@@ -380,10 +380,10 @@ module Inferno
380
380
  # using multiple validators
381
381
  # @param required_suite_options [Hash] suite options that must be
382
382
  # selected in order to use this validator
383
- def fhir_resource_validator(name = :default, required_suite_options: nil, &block)
383
+ def fhir_resource_validator(name = :default, required_suite_options: nil, &)
384
384
  current_validators = fhir_validators[name] || []
385
385
 
386
- new_validator = Inferno::DSL::FHIRResourceValidation::Validator.new(name, id, required_suite_options, &block)
386
+ new_validator = Inferno::DSL::FHIRResourceValidation::Validator.new(name, id, required_suite_options, &)
387
387
 
388
388
  current_validators.reject! { |validator| validator.requirements == required_suite_options }
389
389
  current_validators << new_validator
@@ -254,10 +254,10 @@ module Inferno
254
254
  # using multiple validators
255
255
  # @param required_suite_options [Hash] suite options that must be
256
256
  # selected in order to use this validator
257
- def validator(name = :default, required_suite_options: nil, &block)
257
+ def validator(name = :default, required_suite_options: nil, &)
258
258
  current_validators = fhir_validators[name] || []
259
259
 
260
- new_validator = Inferno::DSL::FHIRValidation::Validator.new(required_suite_options, &block)
260
+ new_validator = Inferno::DSL::FHIRValidation::Validator.new(required_suite_options, &)
261
261
 
262
262
  current_validators.reject! { |validator| validator.requirements == required_suite_options }
263
263
  current_validators << new_validator
@@ -12,7 +12,7 @@ module Inferno
12
12
  # class AuthorizedEndpoint < Inferno::DSL::SuiteEndpoint
13
13
  # # Identify the incoming request based on a bearer token
14
14
  # def test_run_identifier
15
- # request.header['authorization']&.delete_prefix('Bearer ')
15
+ # request.headers['authorization']&.delete_prefix('Bearer ')
16
16
  # end
17
17
  #
18
18
  # # Return a json FHIR Patient resource