instance method
execute_command
Ruby on Rails 5.0.7.2
Since v5.0.7.2Signature
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 280
def execute_command(executor, command, options={})
log executor, command
env = options[:env] || ENV["RAILS_ENV"] || 'development'
sudo = options[:sudo] && RbConfig::CONFIG['host_os'] !~ /mswin|mingw/ ? 'sudo ' : ''
in_root { run("#{sudo}#{extify(executor)} #{command} RAILS_ENV=#{env}", verbose: false) }
end
Defined in railties/lib/rails/generators/actions.rb line 280
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Actions