diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-07-20 11:25:37 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-07-20 11:25:37 +0200 |
commit | d5378ac285f200a9a75b52030856c77f4697325f (patch) | |
tree | c365a9596588e78bd88bb0bbdd7236b16d73f583 /Rakefile | |
parent | 59a4c9fba3ca77d9901dad2457fe1c5618a099ca (diff) |
@@config -> CONFIG
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -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 ) |