src/model.rb in gimdb-0.0.1 vs src/model.rb in gimdb-0.0.2

- old
+ new

@@ -1,17 +1,17 @@ require 'rubygems' require 'active_record' require 'etc' -$GIMDB_PATH = "#{Etc.getpwuid.dir}/.gimdb" -Dir.mkdir($GIMDB_PATH) unless File.exist?($GIMDB_PATH) -Dir.mkdir("#{$GIMDB_PATH}/posters") unless File.exist?("#{$GIMDB_PATH}/posters") +$GIMDB_LOCAL_PATH = "#{Etc.getpwuid.dir}/.gimdb" +Dir.mkdir($GIMDB_LOCAL_PATH) unless File.exist?($GIMDB_LOCAL_PATH) +Dir.mkdir("#{$GIMDB_LOCAL_PATH}/posters") unless File.exist?("#{$GIMDB_LOCAL_PATH}/posters") ActiveRecord::Base.establish_connection( :adapter => "sqlite3", - :database => "#{$GIMDB_PATH}/db.sqlite3" + :database => "#{$GIMDB_LOCAL_PATH}/db.sqlite3" ) if(!ActiveRecord::Base.connection.tables.include?('movies') || !ActiveRecord::Base.connection.tables.include?('users') ||