summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2010-07-20 11:25:37 +0200
committerChristoph Helma <helma@in-silico.ch>2010-07-20 11:25:37 +0200
commitd5378ac285f200a9a75b52030856c77f4697325f (patch)
treec365a9596588e78bd88bb0bbdd7236b16d73f583 /Rakefile
parent59a4c9fba3ca77d9901dad2457fe1c5618a099ca (diff)
@@config -> CONFIG
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile20
1 files changed, 10 insertions, 10 deletions
diff --git a/Rakefile b/Rakefile
index 3c39279..c344157 100644
--- a/Rakefile
+++ b/Rakefile
@@ -40,8 +40,8 @@ task :load_config do
config_dir = File.join(basedir, "config")
config_file = File.join(config_dir, "#{ENV['RACK_ENV']}.yaml")
if File.exist?(config_file)
- @@config = YAML.load_file(config_file)
- raise "could not load config, config file: "+config_file.to_s unless @@config
+ CONFIG = YAML.load_file(config_file)
+ raise "could not load config, config file: "+config_file.to_s unless CONFIG
end
puts "config loaded"
end
@@ -49,14 +49,14 @@ end
# USER VERSION 0 instead
#desc "Clear database"
#task :clear_db => :load_config do
-# if @@config[:database][:adapter]=="mysql"
+# if CONFIG[:database][:adapter]=="mysql"
# clear = nil
# IO.popen("locate clear_mysql.sh"){ |f| clear=f.gets.chomp("\n") }
# raise "clear_mysql.sh not found" unless clear
-# cmd = clear+" "+@@config[:database][:username]+" "+@@config[:database][:password]+" "+@@config[:database][:database]
+# cmd = clear+" "+CONFIG[:database][:username]+" "+CONFIG[:database][:password]+" "+CONFIG[:database][:database]
# IO.popen(cmd){ |f| puts f.gets }
# else
-# raise "clear not implemented for database-type: "+@@config[:database][:adapter]
+# raise "clear not implemented for database-type: "+CONFIG[:database][:adapter]
# end
#end
@@ -64,11 +64,11 @@ desc "Migrate the database through scripts in db/migrate. Target specific versio
task :migrate => :load_config do
require 'active_record'
ActiveRecord::Base.establish_connection(
- :adapter => @@config[:database][:adapter],
- :host => @@config[:database][:host],
- :database => @@config[:database][:database],
- :username => @@config[:database][:username],
- :password => @@config[:database][:password]
+ :adapter => CONFIG[:database][:adapter],
+ :host => CONFIG[:database][:host],
+ :database => CONFIG[:database][:database],
+ :username => CONFIG[:database][:username],
+ :password => CONFIG[:database][:password]
)
ActiveRecord::Base.logger = Logger.new($stdout)
ActiveRecord::Migrator.migrate('db/migrate', ENV["VERSION"] ? ENV["VERSION"].to_i : 2 )