Skip to content

Commit

Permalink
FI-3588: Use git for files in test kit gemspecs (#578)
Browse files Browse the repository at this point in the history
* update gemspec template to use git for files to include

* initialize git repo in new test kits

* silence git output

* check for existence of git directory in specs
  • Loading branch information
Jammjammjamm authored Dec 30, 2024
1 parent 0d17cd0 commit f30f8b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions lib/inferno/apps/cli/new.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def create_test_kit
inside(root_name) do
bundle_install
inferno_migrate
initialize_git_repo
load_igs
end

Expand Down Expand Up @@ -106,6 +107,10 @@ def inferno_migrate
run 'bundle exec inferno migrate', verbose: !options['quiet'], capture: options['quiet']
end

def initialize_git_repo
run 'git init -q && git add . && git commit -aqm "initial commit"'
end

def load_igs
config = { verbose: !options['quiet'] }
options['implementation_guide']&.each_with_index do |ig, idx|
Expand Down
8 changes: 1 addition & 7 deletions lib/inferno/apps/cli/templates/%library_name%.gemspec.tt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ Gem::Specification.new do |spec|
spec.metadata['inferno_test_kit'] = 'true'
# spec.metadata['homepage_uri'] = spec.homepage
# spec.metadata['source_code_uri'] = 'TODO'
spec.files = [
Dir['lib/**/*.rb'],
Dir['lib/**/*.json'],
Dir['config/presets/*.json'],
Dir['config/presets/*.json.erb'],
'LICENSE'
].flatten
spec.files = `[ -d .git ] && git ls-files -z lib config/presets LICENSE`.split("\x0")

spec.require_paths = ['lib']
end
1 change: 1 addition & 0 deletions spec/inferno/cli/new_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
expect { described_class.start(cli_args) }.to_not raise_error

expect(Dir).to exist('test-fhir-app')
expect(Dir).to exist('test-fhir-app/.git')
expect(File).to exist('test-fhir-app/Gemfile')
expect(File).to exist('test-fhir-app/test_fhir_app.gemspec')
expect(File).to exist('test-fhir-app/lib/test_fhir_app.rb')
Expand Down

0 comments on commit f30f8b3

Please sign in to comment.