instance method
execute_command
Ruby on Rails 5.1.7
Since v5.0.7.2 Private — implementation detail, not part of the public APISignature
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 279
def execute_command(executor, command, options = {}) # :doc:
log executor, command
env = options[:env] || ENV["RAILS_ENV"] || "development"
sudo = options[:sudo] && !Gem.win_platform? ? "sudo " : ""
in_root { run("#{sudo}#{extify(executor)} #{command} RAILS_ENV=#{env}", verbose: false) }
end
Defined in railties/lib/rails/generators/actions.rb line 279
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Actions