-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into fi-2413-optional-grou…
…ps-prioritize-pass
- Loading branch information
Showing
42 changed files
with
1,229 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
require 'thor' | ||
require 'bundler' | ||
require_relative '../../utils/named_thor_actions' | ||
require_relative '../../version' | ||
|
||
module Inferno | ||
module CLI | ||
class New < Thor::Group | ||
include Thor::Actions | ||
include Inferno::Utils::NamedThorActions | ||
|
||
desc <<~HELP | ||
Generate a new Inferno test kit for FHIR software testing | ||
Examples: | ||
`inferno new test_fhir_app` | ||
=> generates an Inferno app | ||
`inferno new test_my_ig -a MyName` | ||
=> generates Inferno app and specifies MyName as gemspec author | ||
https://inferno-framework.github.io/index.html | ||
HELP | ||
|
||
def self.banner | ||
'inferno new TEST_KIT_NAME' | ||
end | ||
|
||
def self.source_root | ||
File.join(__dir__, 'templates') | ||
end | ||
|
||
argument :name, | ||
type: :string, | ||
required: true, | ||
desc: 'name for new Inferno project' | ||
class_option :author, | ||
type: :string, | ||
aliases: '-a', | ||
default: [], | ||
repeatable: true, | ||
desc: "Author names for gemspec file; you may use '-a' multiple times" | ||
class_option :skip_bundle, | ||
type: :boolean, | ||
aliases: '-b', | ||
default: false, | ||
desc: 'Do not run bundle install' | ||
|
||
add_runtime_options! | ||
|
||
def create_app | ||
directory('.', root_name, { mode: :preserve, recursive: true, verbose: !options['quiet'] }) | ||
|
||
bundle_install | ||
inferno_migrate | ||
|
||
say_unless_quiet "Created #{root_name} Inferno test kit!", :green | ||
|
||
return unless options['pretend'] | ||
|
||
say_unless_quiet 'This was a dry run; re-run without `--pretend` to actually create project', | ||
:yellow | ||
end | ||
|
||
private | ||
|
||
def ig_path | ||
File.join('lib', library_name, 'igs') | ||
end | ||
|
||
def authors | ||
options['author'].presence || [default_author] | ||
end | ||
|
||
def default_author | ||
ENV['USER'] || ENV['USERNAME'] || 'PUT_YOUR_NAME_HERE' | ||
end | ||
|
||
def bundle_install | ||
return if options['skip_bundle'] | ||
|
||
inside(root_name) do | ||
Bundler.with_unbundled_env do | ||
run 'bundle install', verbose: !options['quiet'], capture: options['quiet'] | ||
end | ||
end | ||
end | ||
|
||
def inferno_migrate | ||
return if options['skip_bundle'] | ||
|
||
inside(root_name) do | ||
run 'bundle exec inferno migrate', verbose: !options['quiet'], capture: options['quiet'] | ||
end | ||
end | ||
|
||
def say_unless_quiet(*args) | ||
say(*args) unless options['quiet'] | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Gem::Specification.new do |spec| | ||
spec.name = '<%= library_name %>' | ||
spec.version = '0.0.1' | ||
spec.authors = <%= authors %> | ||
# spec.email = ['TODO'] | ||
spec.date = Time.now.utc.strftime('%Y-%m-%d') | ||
spec.summary = '<%= title_name %> Test Kit' | ||
spec.description = '<%= human_name %> Inferno test kit for FHIR' | ||
# spec.homepage = 'TODO' | ||
spec.license = 'Apache-2.0' | ||
spec.add_runtime_dependency 'inferno_core', '~> <%= Inferno::VERSION %>' | ||
spec.add_development_dependency 'database_cleaner-sequel', '~> 1.8' | ||
spec.add_development_dependency 'factory_bot', '~> 6.1' | ||
spec.add_development_dependency 'rspec', '~> 3.10' | ||
spec.add_development_dependency 'webmock', '~> 3.11' | ||
spec.required_ruby_version = Gem::Requirement.new('>= 3.1.2') | ||
# spec.metadata['homepage_uri'] = spec.homepage | ||
# spec.metadata['source_code_uri'] = 'TODO' | ||
spec.files = [ | ||
Dir['lib/**/*.rb'], | ||
Dir['lib/**/*.json'], | ||
'LICENSE' | ||
].flatten | ||
|
||
spec.require_paths = ['lib'] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.env.local | ||
.env.*.local | ||
.env.development | ||
.env.test | ||
Dockerfile | ||
.gitignore | ||
|
||
.byebug_history | ||
**/.DS_Store | ||
.vscode/* | ||
.project | ||
.settings/.jsdtscope | ||
.settings/org.eclipse.wst.jsdt.ui.superType.container | ||
.settings/org.eclipse.wst.jsdt.ui.superType.name | ||
.idea | ||
|
||
/coverage | ||
/data | ||
/.git | ||
/.github | ||
/log | ||
/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
JS_HOST="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
VALIDATOR_URL=http://localhost/validatorapi | ||
REDIS_URL=redis://localhost:6379/0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
REDIS_URL=redis://redis:6379/0 | ||
VALIDATOR_URL=http://validator_service:4567 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
VALIDATOR_URL=https://example.com/validatorapi | ||
ASYNC_JOBS=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/data/*.db | ||
/data/redis/**/*.rdb | ||
/data/redis/**/*.aof | ||
/data/redis/**/*.manifest | ||
/tmp | ||
.env.local | ||
.env.*.local | ||
**/.DS_Store | ||
.vscode/* | ||
.project | ||
.settings/.jsdtscope | ||
.settings/org.eclipse.wst.jsdt.ui.superType.container | ||
.settings/org.eclipse.wst.jsdt.ui.superType.name | ||
.idea | ||
|
||
/coverage | ||
/spec/examples.txt | ||
/docs/yard | ||
.yardoc | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruby 3.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM ruby:3.1.2 | ||
|
||
ENV INSTALL_PATH=/opt/inferno/ | ||
ENV APP_ENV=production | ||
RUN mkdir -p $INSTALL_PATH | ||
|
||
WORKDIR $INSTALL_PATH | ||
|
||
ADD *.gemspec $INSTALL_PATH | ||
ADD Gemfile* $INSTALL_PATH | ||
RUN gem install bundler | ||
# The below RUN line is commented out for development purposes, because any change to the | ||
# required gems will break the dockerfile build process. | ||
# If you want to run in Deploy mode, just run `bundle install` locally to update | ||
# Gemfile.lock, and uncomment the following line. | ||
# RUN bundle config set --local deployment 'true' | ||
RUN bundle install | ||
|
||
ADD . $INSTALL_PATH | ||
|
||
EXPOSE 4567 | ||
CMD ["bundle", "exec", "puma"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
gemspec | ||
|
||
group :development, :test do | ||
gem 'debug' | ||
end |
Oops, something went wrong.