-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FI-2266: inferno new generator #408
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #408 +/- ##
==========================================
+ Coverage 77.02% 77.06% +0.03%
==========================================
Files 218 219 +1
Lines 10914 10931 +17
Branches 1026 1026
==========================================
+ Hits 8407 8424 +17
Misses 1928 1928
Partials 579 579
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the inclusion of the put_ig_package_dot_tgz_here
file just to make things even more obvious.
I feel like we should probably include Gemfile.lock, although that seems like it could be tricky. Any ideas on a good way to do that?
lib/inferno/apps/cli/templates/spec/%lib_name%/patient_group_spec.rb.tt
Outdated
Show resolved
Hide resolved
Co-authored-by: Stephen MacVicar <[email protected]>
@Jammjammjamm ready for re-review. For Gemfile.lock, I put in an Gemfile.lock.tt template that works in the current PR, but this solution feels flimsy. If inferno_core adds new dependencies Edit: Also bundler.io recommends rebuilding Gemfile.lock with CI. |
I think that makes sense. The user will have to run it anyway, so we may as well cut out that step. |
I replaced Gemfile.lock.tt template with running I also added a publish_template.sh script that puts up a new branch at inferno-template with the latest Ready for review @Jammjammjamm, @arscan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you just remove the publish script? This is so close to being done I don't think we should be adding anything new.
When I run bin/inferno new inferno_template
I get:
inferno/lib/inferno/apps/cli/templates/%library_name%.gemspec.tt:11:in `template': uninitialized constant Inferno::VERSION (NameError)
Removed publish_template.sh and fixed bugs. Ready for review @Jammjammjamm |
After |
Added |
Co-authored-by: Stephen MacVicar <[email protected]>
Summary
Implemented working
inferno new
command with the following:Usage was updated in comments below
Some key things to note in the implementation:
Thor::Actions
Testing Guidance
Both
rake spec
andrubocop
should pass. The main testing file isspec/inferno/apps/cli/new_spec.rb
which only focuses on testing naming and IG loading. Features fromThor::Actions
like--pretend
orsay
aren't tested via RSpec.For manual testing I did:
mkdir tmp
cd tmp
bundle init
bundle install --binstubs
bin/inferno new --help
and other new commands