instance method
execute_command
Ruby on Rails 8.1.2
Since v5.2.8.1 PrivateSignature
execute_command(executor, command, options = {})
Runs the supplied command using either rake or rails based on the executor parameter provided.
Parameters
-
executorreq -
commandreq -
optionsopt = {}
Source
# File railties/lib/rails/generators/actions.rb, line 460
def execute_command(executor, command, options = {}) # :doc:
log executor, command
sudo = options[:sudo] && !Gem.win_platform? ? "sudo " : ""
config = {
env: { "RAILS_ENV" => (options[:env] || ENV["RAILS_ENV"] || "development") },
verbose: false,
capture: options[:capture],
abort_on_failure: options[:abort_on_failure],
}
in_root { run("#{sudo}#{Shellwords.escape Gem.ruby} bin/#{executor} #{command}", config) }
end
Defined in railties/lib/rails/generators/actions.rb line 460
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Actions