On Mon, Jan 22, 2007 at 03:42:55PM -0700, James Earl wrote:
> No prob, I am adding the extra parameters.  I test it by just
> deleting/recreating the .campingrc file and reloading my app.  When
> .campingrc isn't there, Camping will create the .camping.db and give
> me an error since it doesn't contain any of my tables.  All the while
> I have this as my postamble:
> 
> if __FILE__ == $0
>   MyApp::Models::Base.establish_connection :adapter => 'mysql',
> :database => 'mydb', :username => 'myuser', :password => 'mypw', :host
> => 'myhost'
> end

To use MySQL, the .campingrc would be:

  database:
    adapter: mysql
    database: mydb
    username: myuser
    password: mypw
    host: myhost

Use a postamble[1] if you want your application to work without reading
.campingrc.  Rather than `camping myapp.rb`, use `ruby myapp.rb`.
So then __FILE__ == $0.

_why

[1] http://code.whytheluckystiff.net/camping/wiki/PostAmbles
_______________________________________________
Camping-list mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/camping-list

Reply via email to