I'm trying to add some basic rake tasks to the orientdb gem that will allow me to create the database, create database migrations, and migrate the database - similar to rails migrations.
When I had the rake tasks locally, I got the db:settings, db:create, and db:create_migration to work, but after I put them in the gem I can't figure out how to access them from the Sinatra application when using "rake".
I have a feeling I am either a) not organizing the files in the gem properly and/or b) not calling things properly from the Sinatra app.
The current state of my forked repository is at https://github.com/ricaurte/orientdb-jruby
I put the file for the tasks in lib/orientdb/tasks/database.rake => https://github.com/ricaurte/orientdb-jruby/blob/master/lib/orientdb/tasks/database.rake
Sinatra App Rakefile
APPLICATION_ROOT = File.expand_path('..', __FILE__)
require 'rake'
require 'orientdb'
#import "orientdb/tasks/database.rake"
task :environment do
require File.expand_path(File.join(*%w[ config environment ]), File.dirname(__FILE__))
end
config/environment
require "rubygems"
require "bundler"
Bundler.setup
require 'sinatra'
require "orientdb"
ruby: jruby 1.6.0 (ruby 1.9.2 patchlevel 136) (2011-03-24 5f5278c) (OpenJDK 64-Bit Server VM 1.6.0_20) [linux-amd64-java]