Interact with the database from a simple ruby script

Hi,

I have a simple rails application with a model. The data that needs to
be entered in the database comes from an external application which I
can parse using a standard ruby script. What would be the proper way
to handle model/database interactions from an external ruby script?
Should I use rake tasks instead?

Thanks!

JF

puts everything togheter, something like:

require 'rubygems'
require_gem 'activerecord'

ActiveRecord::Base.establish_connection({
     :adapter => 'mysql',
     :database => 'mydb',
     :username => 'user',
     :password => 'password'
})

class MyTable < ActiveRecord::Base
end

...your ruby script that parse here...

Also check out

http://benlog.org/2007/6/18/stepping-off-the-rails-with-rack