Add ability to customize the rspec command.#8
Conversation
This is needed because people might want to run rspec using foreman or docker like `foreman run bundle exec rspec --color`
|
I just found out that we can overwrite any settings per project using the |
| } | ||
|
|
||
| function getRSpecCommand(): string { | ||
| return vscode.workspace.getConfiguration().get(SETTINGS_RSPEC_COMMAND_KEY); |
There was a problem hiding this comment.
@lucasprag if configuration is empty or not exists? we should be return default value "bundle exec rspec --color" right?
There was a problem hiding this comment.
oh yeah, I did that in my first version, but eventually I saw that there is an option to set the default in the configuration file so I did it here.
Docs: https://code.visualstudio.com/api/references/contribution-points#contributes.configuration
| } | ||
|
|
||
| function getRSpecCommand(): string { | ||
| return vscode.workspace.getConfiguration().get(SETTINGS_RSPEC_COMMAND_KEY); |
There was a problem hiding this comment.
| return vscode.workspace.getConfiguration().get(SETTINGS_RSPEC_COMMAND_KEY); | |
| let configCommand = vscode.workspace | |
| .getConfiguration() | |
| .get(SETTINGS_RSPEC_COMMAND_KEY); | |
| return configCommand || "bundle exec rspec --color"; |
There was a problem hiding this comment.
So we don't need this based on my comment above, thanks =)
|
This is exactly what I was looking for, thanks both for all your efforts! Can't wait to give this a go as we run our projects from inside Docker and so need to configure the command too <3 |
This is needed because people might want to run rspec using
foreman or docker like
foreman run bundle exec rspec --colorHi 👋
Thanks for building this great extension. I was using it and I felt the need to customize the rspec command to prepend
foreman. I've seen in plugins for other editors that they just let the user be able to customize the entire command so I did exactly that.As the updated readme says the user can customize the rspec command using the vscode settings like:
{ "vscode-run-rspec-file.custom-command": "foreman run bundle exec rspec --color", }and the default is
bundle exec rspec --colorMaybe in the future we can update the rspec command based on projects somehow.
Thanks for reviewing @thadeu =)