-
Notifications
You must be signed in to change notification settings - Fork 112
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
Remove Config.generate_command and update tests #259
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.
Can we make it the default value of the option instead of removing the option?
@Morriar There's some difficulty with that. Mainly because there is no default value for generating RBIs. Depending on what we generate different commands are used (i.e. Gems created with Also, feels kind of like a weird/non-standard flag to me. As you're basically telling the program to lie about what it's accomplished. I'm open to being convinced otherwise as to where it's useful. |
Can't we reach the same result with something like: class_option :generate_command,
aliases: ["--cmd", "-c"],
banner: "command",
desc: "The command to run to regenerate RBI files",
default: "tapioca" then: say("RBI files are out-of-date, please run `#{config.command} dsl` to update.") ? |
That's more or less what we're trying to get rid of. Yes, you could specify the command that you want in the header, but that seems an obtuse way of accomplishing this task IMO. In this case, we'd have to specify a |
My understanding of the road map was to create a config file to store such option so we don't have to pass them each time but still have the option available. Stating |
According to the Slack thread, Rafael suggested we always use I think these static headers are a good work around for now, but I think long term I'd like to see that bundled up into a single command, |
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.
We would also like to remove the default for generate_command
in config_builder.rb
and the default_command
method in the same file.
We run the same risk with people doing One thing we can do, however, is to make Tapioca create the binstub in |
The binstub creation code should be something like: installer = Bundler::Installer.new(Bundler.root, Bundler.definition)
spec = Bundler.definition.specs.find {|s| s.name == "tapioca" }
installer.generate_bundler_executable_stubs(spec, { force: true }) |
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.
Like @Morriar pointed out, we need to s|tapioca |bin/tapioca |g
or something in file headers and commands that we show.
Also, we need the config_builder.rb
changes.
3b113ce
to
2697e78
Compare
Closes: #254
Motivation
Dynamic headers cause false positives and unnecessary changes when regenerating RBIs. Hard coded the commands for generation and
removeddeprecated thegenerate_command
fromTapioca::Config
as it is no longer necessary.Implementation
Updated tests and implementations to use hardcoded
tapioca <command> <constant>
. Also, added binstub fortapioca
.Tests
Added assertion for the presence of
bin/tapioca
.