-
Notifications
You must be signed in to change notification settings - Fork 38
Adds BundleReport CLI class to an entry point from executable file #154
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
Conversation
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 please add a test? Is it complicated?
lib/next_rails/bundle_report/cli.rb
Outdated
@@ -1,8 +1,12 @@ | |||
# frozen_string_literal: true | |||
|
|||
require 'optparse' | |||
require 'next_rails' | |||
require 'next_rails/bundle_report' |
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.
require 'next_rails/bundle_report' | |
require 'next_rails/bundle_report' | |
# Print a report on our Gemfile | ||
# Why not just use `bundle outdated`? It doesn't give us the information we care about (and it fails). | ||
# | ||
at_exit do |
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.
Was there an specific reason for using this at_exit
block?
I removed it from def run
in the CLI because it was making tests execution fail for it
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.
Looks good, thanks for the contribution @hmdros
Description
Following issue: #153
Motivation and Context
Exposing a single entry point for the
bundle_report
command to make it easier to invoke programmatically.Remove the logic from
exe/bundle_report
, and move it out tolib/next_rails/bundle_report/cli.rb
so we can call:NextRails::BundleReport::CLI.new(ARGV).generate
from another service, and we would still have the same output as calling thebundle_report
from exe.How Has This Been Tested?
Moving the code from
exe/bundle_report
tolib/next_rails/bundle_report/cli.rb
should keep the same behavior.I will abide by the code of conduct