On Dec 5, 10:08 am, Jeremy Evans <[EMAIL PROTECTED]> wrote:
> On Dec 4, 4:26 pm, Jeremy Evans <[EMAIL PROTECTED]> wrote:
>
> > I'm trying to get a Merb very_flat app to work in the root of a Rails
> > app.  It's been a pain and required overriding an internal method, but
> > I've finally got it somewhat working.  I think the problem is that
> > Merb is overriding the configuration given to Merb::Config inside
> > Merb.start.

Problem fixed:  
http://github.com/jeremyevans/merb/commit/4cfc946ece4fe1f66ed46006f663be4bdd8c29ae

This works with the following code:

ENV['FORK'] = '0'
require 'rubygems'
$:.unshift('/data/code/merb/merb-core/lib')
require 'merb-core'

use_template_engine :erb

Merb::Config.use { |c|
  c[:session_store]       = 'cookie'
  c[:exception_details]   = true
  c[:log_level]           = :debug
  c[:log_stream]          = $stdout
  c[:reload_classes]   = false
  c[:reload_templates] = false
  c[:use_mutex] = false
  c[:fork_for_class_load] = false
  #c[:verbose] = true
  c[:framework] = {:application=>["", nil], :view=>[nil,
nil], :public=>["p", nil], :model=>["m", nil], :helper=>["h",
nil], :controller=>["c", nil], :mailer=>[nil, nil], :part=>[nil,
nil], :config=>["", nil], :router=>["", nil], :lib=>["l",
nil], :merb_session=>[nil, nil], :log=>[nil, nil], :stylesheet=>[nil,
nil], :javascript=>[nil, nil], :image=>[nil, nil]}
}

Merb::Router.prepare do
  match('/').to(:controller => 'merb_setup', :action =>'index')
end

class MerbSetup < Merb::Controller
  def index
    "Hi, I am 'very flat' Merb application. I have everything in one
single file and well suited for dynamic stub pages."
  end
end

Merb.disable(:initfile)
Merb.start(%w'-a mongrel')

Here's the output:

$ ruby merb_setup.rb
merb : worker (port 4000) ~ Starting Mongrel at port 4000
merb : worker (port 4000) ~ Successfully bound to port 4000

I've sent a pull request, so hopefully this can get applied.

Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to