Author: assaf
Date: Tue Nov 18 15:32:48 2008
New Revision: 718778
URL: http://svn.apache.org/viewvc?rev=718778&view=rev
Log:
Merged populate.rake and database.rake.
Described plugin tasks.
Removed:
ode/sandbox/singleshot/lib/tasks/populate.rake
Modified:
ode/sandbox/singleshot/lib/tasks/database.rake
ode/sandbox/singleshot/lib/tasks/setup.rake
Modified: ode/sandbox/singleshot/lib/tasks/database.rake
URL:
http://svn.apache.org/viewvc/ode/sandbox/singleshot/lib/tasks/database.rake?rev=718778&r1=718777&r2=718778&view=diff
==============================================================================
--- ode/sandbox/singleshot/lib/tasks/database.rake (original)
+++ ode/sandbox/singleshot/lib/tasks/database.rake Tue Nov 18 15:32:48 2008
@@ -1,7 +1,18 @@
-begin
- require 'annotate_models/tasks'
-
- desc task('annotate_models').comment
- task 'db:annotate'=>'annotate_models'
-rescue LoadError
-end
+namespace 'db' do
+
+ desc 'Populate the database with mock values'
+ task 'populate'=>['environment', 'create', 'migrate'] do
+ require File.join(Rails.root, 'db/populate')
+ PopulateDatabase.new.populate
+ end
+
+ begin
+ # Conditional, otherwise rake setup fails not finding annotate_models.
+ require 'annotate_models/tasks'
+
+ desc task('annotate_models').comment
+ task 'annotate'=>'annotate_models'
+ rescue LoadError
+ end
+
+end
\ No newline at end of file
Modified: ode/sandbox/singleshot/lib/tasks/setup.rake
URL:
http://svn.apache.org/viewvc/ode/sandbox/singleshot/lib/tasks/setup.rake?rev=718778&r1=718777&r2=718778&view=diff
==============================================================================
--- ode/sandbox/singleshot/lib/tasks/setup.rake (original)
+++ ode/sandbox/singleshot/lib/tasks/setup.rake Tue Nov 18 15:32:48 2008
@@ -8,10 +8,14 @@
puts "Generated new secret in #{task.name}"
end
-desc 'Run this task first to setup your test/development environment'
+
+desc "Run this task first to setup your test/development environment"
task 'setup'=>['gems:install', 'plugins:install', 'secret.key', 'db:create',
'db:test:clone', 'db:populate']
+
namespace 'plugins' do
+
+ desc "Install all the plugins this app depends on"
task 'install' do
rb_bin = File.join(Config::CONFIG['bindir'],
Config::CONFIG['ruby_install_name'])
puts "Installing rspec plugin from Github"
@@ -19,6 +23,7 @@
system 'rb_bin', 'script/plugin',
'git://github.com/dchelimsky/rspec-rails.git'
end
+ desc "List installed plugins"
task 'list' do
plugins = Dir["#{Rails.root}/vendor/plugins/*"].map { |path|
Rails::Plugin.new(path) }
plugins.each do |plugin|
@@ -30,4 +35,5 @@
puts
end
end
+
end