Redirect to proper messages tab after bulk update
[gitorious.git] / script / rake-wrapper
blob6436173951892465fe5b46962698ec8497bd0906
1 #!/usr/bin/env ruby
3 # This file can be Exec'ed without spawning a new shell
4 # It lets you run rake with a full Gitorious environment
6 require "pathname"
8 class RailsEnv
9 def initialize(env); @env = env; end
10 def production?; @env == "production"; end
11 def development?; @env == "development"; end
12 def test?; @env == "test"; end
13 def to_s; @env; end
14 end
16 class Rails
17 def self.root
18 (Pathname(__FILE__) + "../../").realpath
19 end
21 def self.env
22 @env ||= RailsEnv.new("production")
23 end
24 end
26 ENV["BUNDLE_GEMFILE"] = Rails.root + "Gemfile"
28 require "rubygems"
29 require "bundler/setup"
31 load Gem.bin_path("rake", "rake")