Warning: I'm a rails and radiant neophyte.

I've installed radiant-0.8.2 as a gem and created a new radiant
project (`radiant rad2`), but I've noticed that unlike a "normal"
Rails environment, this one does not have a 'lib' directory. I created
one and dropped a file into it, thinking it would get loaded
automagically when the class or module is used, but it doesn't.

After digging around a lot, it seems that when the Radiant initializer
runs, it only sets up autoload directories under RADIANT_ROOT which,
in this case, is the common library path of the Radiant gem itself.
The normal rails directories (e.g. RAILS_ROOT/lib, etc.) are not
honored. Here's what I've done:

    dkr...@maclappy:~/rad2> diff -du config/environment.rb~ config/
environment.rb
    --- config/environment.rb~  2010-05-17 09:55:37.000000000 -0700
    +++ config/environment.rb   2010-05-17 10:00:49.000000000 -0700
    @@ -8,6 +8,7 @@
     require File.join(File.dirname(__FILE__), 'boot')

     require 'radius'
    +require 'foo'

     Radiant::Initializer.run do |config|

    dkr...@maclappy:~/rad2> cat lib/foo.rb
    module Foo
      STDERR.puts "### foo.rb loaded ###"
    end

When I spin up script/server, I never see the "### foo.rb loaded ###"
message on the console. I even tried augmenting 'config.load_paths' in
my environment.rb.

In another radiant project, I have radiant installed under lib/:

    dkr...@maclappy:~/rad> ls lib/radiant.rb
    lib/radiant.rb

When I run 'script/server' in this project directory, I see the
"loaded" message I'm expecting:

    dkr...@maclappy:~/rad> ./script/server
    => Booting Mongrel (use 'script/server webrick' to force WEBrick)
    => Rails application starting on http://0.0.0.0:3000
    => Call with -d to detach
    => Ctrl-C to shutdown server
    ** Starting Mongrel listening at 0.0.0.0:3000
    ** Starting Rails with development environment...
    ### foo.rb loaded ###

I _really_ don't want to have to install Radiant under lib/. What am I
missing here?

-dan

Reply via email to