inferno_core 0.1.3 → 0.2.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inferno/apps/cli/main.rb +10 -0
  3. data/lib/inferno/apps/cli/suite.rb +19 -0
  4. data/lib/inferno/apps/cli/suite_input_template.rb +30 -0
  5. data/lib/inferno/apps/cli/suites.rb +23 -0
  6. data/lib/inferno/apps/web/controllers/test_sessions/create.rb +5 -2
  7. data/lib/inferno/apps/web/controllers/test_sessions/session_data/apply_preset.rb +43 -0
  8. data/lib/inferno/apps/web/controllers/test_suites/check_configuration.rb +17 -0
  9. data/lib/inferno/apps/web/index.html.erb +5 -5
  10. data/lib/inferno/apps/web/router.rb +38 -25
  11. data/lib/inferno/apps/web/serializers/preset.rb +17 -0
  12. data/lib/inferno/apps/web/serializers/test.rb +2 -0
  13. data/lib/inferno/apps/web/serializers/test_group.rb +1 -0
  14. data/lib/inferno/apps/web/serializers/test_suite.rb +3 -0
  15. data/lib/inferno/config/application.rb +10 -1
  16. data/lib/inferno/config/boot/db.rb +16 -1
  17. data/lib/inferno/config/boot/presets.rb +15 -0
  18. data/lib/inferno/db/schema.rb +22 -22
  19. data/lib/inferno/dsl/resume_test_route.rb +1 -1
  20. data/lib/inferno/dsl/runnable.rb +18 -0
  21. data/lib/inferno/entities/preset.rb +24 -0
  22. data/lib/inferno/entities/test.rb +8 -0
  23. data/lib/inferno/entities/test_group.rb +8 -0
  24. data/lib/inferno/entities/test_suite.rb +31 -0
  25. data/lib/inferno/public/bundle.js +38 -38
  26. data/lib/inferno/repositories/in_memory_repository.rb +3 -2
  27. data/lib/inferno/repositories/presets.rb +22 -0
  28. data/lib/inferno/repositories/test_sessions.rb +12 -1
  29. data/lib/inferno/utils/preset_template_generator.rb +38 -0
  30. data/lib/inferno/utils/static_assets.rb +33 -0
  31. data/lib/inferno/version.rb +1 -1
  32. data/lib/inferno.rb +7 -6
  33. metadata +22 -11
@@ -54,6 +54,12 @@ module Inferno
54
54
  }
55
55
  end
56
56
 
57
+ def version(version = nil)
58
+ return @version if version.nil?
59
+
60
+ @version = version
61
+ end
62
+
57
63
  def find_validator(validator_name)
58
64
  validator = fhir_validators[validator_name]
59
65
 
@@ -64,6 +70,31 @@ module Inferno
64
70
  fhir_validators[:default] =
65
71
  Inferno::DSL::FHIRValidation::Validator.new { |v| v.url default_validator_url }
66
72
  end
73
+
74
+ def configuration_messages(new_messages = nil, force_recheck: false)
75
+ return @configuration_messages = new_messages unless new_messages.nil?
76
+
77
+ @configuration_messages =
78
+ if force_recheck
79
+ @check_configuration_block ? @check_configuration_block.call : []
80
+ else
81
+ @configuration_messages || (@check_configuration_block ? @check_configuration_block.call : [])
82
+ end
83
+ end
84
+
85
+ # Provide a block which will verify any configuration needed for this
86
+ # test suite to operate properly.
87
+ #
88
+ # @yieldreturn [Array<Hash>] An array of message hashes containing the
89
+ # keys `:type` and `:message`. Type options are `info`, `warning`, and
90
+ # `error`.
91
+ def check_configuration(&block)
92
+ @check_configuration_block = block
93
+ end
94
+
95
+ def presets
96
+ @presets ||= Repositories::Presets.new.presets_for_suite(id)
97
+ end
67
98
  end
68
99
  end
69
100
  end