execute_command(executor, command, options={})
protected
Runs the supplied command using either “rake …” or “rails
…” based on the executor parameter provided.
# 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