specifiesRails neden bir nesneyi değil, bir nesneyi çalıştıran bir config.ru oluşturur?
bir Raf uygulama aramaya cevap Ruby nesnesi (bir sınıf) Raf. Ben merak ediyorum Yani
# This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run RailsApp::Application
: Raf olmasını belirtir değil
run RailsApp::Application.new
neden Raylar iseclass MyApp def call(env) [200, {"Content-Type" => "text/plain"}, ["Hello from Rack!\n"]] end end run MyApp.new
bu üretir
:
Sonuç olarak, basit bir config.ru
şöyle Bir nesne, bir sınıf değil? Eksik olduğum Rails::Application
hakkında özel bir şey var mı?