aboutsummaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rwxr-xr-xscript/generate_pot.sh4
-rwxr-xr-xscript/handle-mail-replies2
-rwxr-xr-xscript/load-sample-data3
-rwxr-xr-xscript/rails-post-deploy6
-rwxr-xr-xscript/rebuild-xapian-index2
-rwxr-xr-xscript/spec1
-rwxr-xr-xscript/spec-all-pairs2
-rwxr-xr-xscript/spec_server4
-rwxr-xr-xscript/test-run2
-rwxr-xr-xscript/update-xapian-index6
10 files changed, 16 insertions, 16 deletions
diff --git a/script/generate_pot.sh b/script/generate_pot.sh
index f6c82dda7..c0540c3d9 100755
--- a/script/generate_pot.sh
+++ b/script/generate_pot.sh
@@ -10,8 +10,8 @@ git status | grep app.po | awk '{print $3}' | xargs git add
git commit -m "Backup latest po files from Transifex"
# now regenerate POT and PO files from Alaveteli source
-rake gettext:store_model_attributes
-rake gettext:findpot
+bundle exec rake gettext:store_model_attributes
+bundle exec rake gettext:findpot
# upload the result to Transifex
tx push -t
diff --git a/script/handle-mail-replies b/script/handle-mail-replies
index d6717bc58..cc7595bed 100755
--- a/script/handle-mail-replies
+++ b/script/handle-mail-replies
@@ -145,7 +145,7 @@ end
def load_rails
require File.join('config', 'boot')
- require RAILS_ROOT + '/config/environment'
+ require Rails.root + '/config/environment'
end
def record_bounce(email_address, bounce_message)
diff --git a/script/load-sample-data b/script/load-sample-data
index e5f1be4cd..fc5cbeed1 100755
--- a/script/load-sample-data
+++ b/script/load-sample-data
@@ -5,8 +5,7 @@
# have a filesystem representation of their contents
LOC=`dirname "$0"`
-
-rake --silent spec:db:fixtures:load
+bundle exec rake --silent spec:db:fixtures:load
"$LOC/runner" /dev/stdin <<END
env = ENV["RAILS_ENV"]
diff --git a/script/rails-post-deploy b/script/rails-post-deploy
index 6e2c88d28..5b9bd8014 100755
--- a/script/rails-post-deploy
+++ b/script/rails-post-deploy
@@ -76,9 +76,9 @@ fi
if [ "$OPTION_STAGING_SITE" = "0" ]
then
- bundle install --without development:test --deployment
+ bundle exec bundle install --without development:test --deployment --binstubs
else
- bundle install
+ bundle exec bundle install --binstubs
fi
if [ -n "$OPTION_THEME_URL" ]
@@ -87,6 +87,6 @@ then
fi
# upgrade database
-rake db:migrate #--trace
+bundle exec rake db:migrate #--trace
diff --git a/script/rebuild-xapian-index b/script/rebuild-xapian-index
index 5986f5259..3012511de 100755
--- a/script/rebuild-xapian-index
+++ b/script/rebuild-xapian-index
@@ -1,4 +1,4 @@
#!/bin/bash
cd `dirname $0`
-rake --silent "$@" xapian:rebuild_index models="PublicBody User InfoRequestEvent"
+bundle exec rake --silent "$@" xapian:rebuild_index models="PublicBody User InfoRequestEvent"
diff --git a/script/spec b/script/spec
index 46fdbe6e4..c967e2a83 100755
--- a/script/spec
+++ b/script/spec
@@ -6,5 +6,6 @@ else
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(RAILS_ROOT)
end
+Rails.preinitialize # load bundler
require 'spec/autorun'
exit ::Spec::Runner::CommandLine.run
diff --git a/script/spec-all-pairs b/script/spec-all-pairs
index 5b6439a4e..6d7bb17c4 100755
--- a/script/spec-all-pairs
+++ b/script/spec-all-pairs
@@ -6,7 +6,7 @@
log_file=/dev/null
test_pair () {
- rake db:test:prepare > /dev/null 2>&1
+ bundle exec rake db:test:prepare > /dev/null 2>&1
output=$(script/spec "$1" "$2" 2>&1)
if [ $? -eq 0 ]
then
diff --git a/script/spec_server b/script/spec_server
index 1e839355f..dfdf8ff6c 100755
--- a/script/spec_server
+++ b/script/spec_server
@@ -41,7 +41,7 @@ module Spec
load File.dirname(__FILE__) + '/../spec/spec_helper.rb'
if in_memory_database?
- load "#{RAILS_ROOT}/db/schema.rb" # use db agnostic schema by default
+ load "#{Rails.root}/db/schema.rb" # use db agnostic schema by default
ActiveRecord::Migrator.up('db/migrate') # use migrations
end
@@ -80,7 +80,7 @@ def daemonize(pid_file = nil)
return yield if $DEBUG
pid = Process.fork{
Process.setsid
- Dir.chdir(RAILS_ROOT)
+ Dir.chdir(Rails.root)
trap("SIGINT"){ exit! 0 }
trap("SIGTERM"){ exit! 0 }
trap("SIGHUP"){ restart_test_server }
diff --git a/script/test-run b/script/test-run
index 4c7a0e3ec..7810b57d5 100755
--- a/script/test-run
+++ b/script/test-run
@@ -1,5 +1,5 @@
#!/bin/bash
cd ../
-rake spec
+bundle exec rake spec
diff --git a/script/update-xapian-index b/script/update-xapian-index
index 6ece02de0..d470176a9 100755
--- a/script/update-xapian-index
+++ b/script/update-xapian-index
@@ -1,5 +1,5 @@
#!/bin/bash
-
-cd `dirname $0`
-rake --silent xapian:update_index "$@"
+export BUNDLE_GEMFILE=$(dirname "$0")/../Gemfile
+cd "$(dirname "$0")"
+bundle exec rake --silent xapian:update_index "$@"