aboutsummaryrefslogtreecommitdiffstats
path: root/script/load-sample-data
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-02-03 13:38:59 +0000
committerRobin Houston <robin.houston@gmail.com>2012-02-03 13:38:59 +0000
commit44bb96d40758f3b8bb9da20e3037ff2f04e81327 (patch)
tree2f43c9c02205fec1fb68cdcb66735d5b1ee3172f /script/load-sample-data
parent7ed887f0989425d9e412890800df05637b08c025 (diff)
parent14b5be69dc2dc3c4dd817feb0b5a8402fc343db4 (diff)
Merge branch 'release/0.5'
Diffstat (limited to 'script/load-sample-data')
-rwxr-xr-xscript/load-sample-data13
1 files changed, 10 insertions, 3 deletions
diff --git a/script/load-sample-data b/script/load-sample-data
index 0521ef849..e5f1be4cd 100755
--- a/script/load-sample-data
+++ b/script/load-sample-data
@@ -4,9 +4,16 @@
# the fact that the fixtures aren't aware of the fact that RawEmails
# have a filesystem representation of their contents
-LOC=`dirname $0`
+LOC=`dirname "$0"`
+
rake --silent spec:db:fixtures:load
-"$LOC/runner" 'puts File.expand_path(File.dirname(__FILE__) + "/spec/spec_helper"); require File.expand_path(File.dirname(__FILE__) + "/spec/spec_helper"); RawEmail.all().each {|email| email.data = load_file_fixture("useless_raw_email.email")}'
+"$LOC/runner" /dev/stdin <<END
+env = ENV["RAILS_ENV"]
+require "spec/spec_helper.rb" # this sets RAILS_ENV to 'test'
+ENV["RAILS_ENV"] = env # so restore to what it was before
+
+load_raw_emails_data
+END
-echo "Loaded fixtures." \ No newline at end of file
+echo "Loaded fixtures. You may now wish to run $LOC/update-xapian-index"