instance method
execute_command
Ruby on Rails 5.2.8.1
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 293
def execute_command(executor, command, options = {}) # :doc:
log executor, command
env = options[:env] || ENV["RAILS_ENV"] || "development"
sudo = options[:sudo] && !Gem.win_platform? ? "sudo " : ""
config = { verbose: false }
config.merge!(capture: options[:capture]) if options[:capture]
in_root { run("#{sudo}#{extify(executor)} #{command} RAILS_ENV=#{env}", config) }
end
Defined in railties/lib/rails/generators/actions.rb line 293
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Actions