Hi all,
I''m new to rails (and ruby) so bear with me.
I''ve analysed script/server (and subsequent scripts) and as far as I
can tell, the actions performed in a newly created rails app (on my
GNU/Linux box running lighttpd) when
$ script/server lighttpd
is called, can be summarised thus (ignoring the ''requires''):
RAILS_ROOT =
''/home/<your_home>/rails/<your_app>''
Rails::Initializer.run(:set_load_path)
FileUtils.mkdir_p(%w( tmp/sessions tmp/cache tmp/sockets ))
server = ''lighttpd''
configuration = Rails::Initializer.run(:initialize_logger).configuration
detach = false
config_file = "#{RAILS_ROOT}/config/lighttpd.conf''
config = IO.read(config_file)
default_port, default_ip = 3000, ''0.0.0.0''
port = config.scan(/^\s*server.port\s*=\s*(\d+)/).first rescue default_port
ip = config.scan(/^\s*server.bind\s*=\s*"([^"]+)"/).first
rescue default_ip
puts "=> Rails application started on http://#{ip ||
default_ip}:#{port || default_port}"
Having saved some ''state'' in these local variables, it then
''rakes''
the tmp/sockets directory and fires up lighttpd.
My question is why save this state in the local variables? How is
this information useful, and to what processes?
Any help much appreciated.
Sebastian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Sebastian, I''m fairly new here too, but my impression is that questions like these (design/architecture questions) are better directed to the rails-core list. I think this list is more for usage questions. Gordon On 3/10/07, Seb <sebyte-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi all, > > I''m new to rails (and ruby) so bear with me. > > I''ve analysed script/server (and subsequent scripts) and as far as I > can tell, the actions performed in a newly created rails app (on my > GNU/Linux box running lighttpd) when > > $ script/server lighttpd > > is called, can be summarised thus (ignoring the ''requires''): > > RAILS_ROOT = ''/home/<your_home>/rails/<your_app>'' > > Rails::Initializer.run(:set_load_path) > > FileUtils.mkdir_p(%w( tmp/sessions tmp/cache tmp/sockets )) > > server = ''lighttpd'' > configuration = Rails::Initializer.run(:initialize_logger).configuration > detach = false > config_file = "#{RAILS_ROOT}/config/lighttpd.conf'' > config = IO.read(config_file) > default_port, default_ip = 3000, ''0.0.0.0'' > port = config.scan(/^\s*server.port\s*=\s*(\d+)/).first rescue default_port > ip = config.scan(/^\s*server.bind\s*=\s*"([^"]+)"/).first rescue default_ip > > puts "=> Rails application started on http://#{ip || default_ip}:#{port || default_port}" > > Having saved some ''state'' in these local variables, it then ''rakes'' > the tmp/sockets directory and fires up lighttpd. > > My question is why save this state in the local variables? How is > this information useful, and to what processes? > > Any help much appreciated. > > Sebastian > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I agree with Gordon... mostly because this is a user list, and I don''''t think many of the rails core members read the list on a regular basis, so your point, as valid as it could be, would go unnoticed by the core members Seb. Cheers. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---