Now, I've used Rails enough to know what the rails command does, but how it does it interests me.
The bin/rails file (from github) is as follows:
#!/usr/bin/env ruby
begin
require "rails/cli"
rescue LoadError
railties_path = File.expand_path('../../railties/lib', __FILE__)
$:.unshift(railties_path)
require "rails/cli"
end
As far as I know (and please correct me if I'm wrong), require doesn't run code, just loads classes etc.
I could also not find the rails directory in the root of them gem, so I'm a little confused where that's hiding as well.
Thanks.