Skip to content

Instantly share code, notes, and snippets.

@tobinharris
Created August 17, 2009 20:33
Show Gist options
  • Save tobinharris/169362 to your computer and use it in GitHub Desktop.
Save tobinharris/169362 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'rake'
require 'rexml/document'
require 'ftools'
#We need some libs loaded
require 'Portal.Web/bin/Iesi.Collections'
require 'Portal.Web/bin/NHibernate'
require 'Portal.Web/bin/NHibernate.Search'
require 'Portal.Web/bin/NHibernate.Linq'
require 'Portal.Web/bin/Portal.Core'
#Pull in some namespaces
include NHibernate
include Portal::Core::Domain::Entities
include Portal::Core::Infrastructure::DataAccess
include Portal::Core::Domain::Queries
include Portal::Core::Domain::Services
include Portal::Core::Infrastructure::Tasks
include Portal::Core::Domain::Tasks
include Portal::Core::Infrastructure
ENVIRONMENT = ARGV[1] ? ARGV[1] : "development"
puts "Running in #{ENVIRONMENT}."
#These are the same for everything
SOLUTION_ROOT = Dir.pwd
#Configure constants and folders
if ENVIRONMENT =='production' then
SHARED_DIR = "#{SOLUTION_ROOT}\\..\\_shared"
CONSTR = "Data Source=.\\SQLEXPRESS2008; Database=BlahProduction;Trusted_Connection=True;"
else
SHARED_DIR = "#{SOLUTION_ROOT}\\Portal.Web\\App_Data"
CONSTR = "Data Source=.\\SQLEXPRESS2008;Database=BlahDevelopment;Trusted_Connection=True;"
end
# These settings are used by the Portal.Core components
Settings.UploadsPath = "#{SHARED_DIR}\\Thumbnails"
Settings.WebRoot="#{SOLUTION_ROOT}\\Portal.Web"
Settings.BinariesPath="#{SOLUTION_ROOT}\\Portal.Dependencies\\Tika"
#IronRuby seems happy when it can find all the DLLs in
#the *current* directory. Hmmm...
Dir.chdir('Portal.Web\\bin')
UoW.Configure(CONSTR, UoW::Environment.Other)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment