Skip to content

Commit

Permalink
fixed the rake task for loading surveys to make defining fixture load…
Browse files Browse the repository at this point in the history
… location optional with a default instead of manditory
  • Loading branch information
Brian Chamberlain committed Jun 22, 2010
1 parent e64e089 commit 4231950
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tasks/surveyor_tasks.rake
Expand Up @@ -5,7 +5,7 @@ namespace :surveyor do

task :default => [:generate_fixtures, :load_fixtures]

desc "generate survey fixtures from survey file"
desc "generate survey fixtures from survey file (specify FIXTURES=surveys/your_survey.rb"
task :generate_fixtures => :environment do
require File.join(File.dirname(__FILE__), "../../script/surveyor/parser")
raise "USAGE: file name required e.g. 'FILE=surveys/kitchen_sink_survey.rb'" if ENV["FILE"].blank?
Expand All @@ -14,11 +14,11 @@ namespace :surveyor do
SurveyParser::Parser.parse(File.join(RAILS_ROOT, ENV["FILE"]))
end

desc "load survey fixtures"
desc "load survey fixtures (optional FIXTURES=surveys/foo/fixtures)"
task :load_fixtures => :environment do
require 'active_record/fixtures'
require 'fixtures_extensions' unless ENV["APPEND"].blank?
raise "USAGE: fixtures directory required e.g. 'FIXTURES=surveys/fixtures'" if ENV["FIXTURES"].blank?
ENV["FIXTURES"] ||= "surveys/fixtures"
ActiveRecord::Base.establish_connection(Rails.env)

fixture_dir = File.join(RAILS_ROOT, ENV["FIXTURES"])
Expand Down

0 comments on commit 4231950

Please sign in to comment.