Permalink
Browse files

Switch to Bundler based deployment

  • Loading branch information...
1 parent a474bf7 commit 529d6ae5f7e7f278680ba328a3a550d047970995 @jweiss jweiss committed May 12, 2011
Showing with 58 additions and 3 deletions.
  1. +3 −0 .bundle/config
  2. +1 −0 .gitignore
  3. +0 −3 .gitmodules
  4. +2 −0 CHANGELOG.txt
  5. +15 −0 Gemfile
  6. +14 −0 config/boot.rb
  7. +2 −0 config/initializers/capistrano_namespace_rake_fix.rb
  8. +20 −0 config/preinitializer.rb
  9. +1 −0 vendor/bundler/.gitignore
View
@@ -0,0 +1,3 @@
+---
+BUNDLE_DISABLE_SHARED_GEMS: "1"
+BUNDLE_PATH: vendor/bundler
View
@@ -5,3 +5,4 @@ log/*
*~
.DS_Store
*.tmproj
+Gemfile.lock
View
@@ -1,3 +0,0 @@
-[submodule "vendor/plugins/exception_notification"]
- path = vendor/plugins/exception_notification
- url = git://github.com/smartinez87/exception_notification.git
View
@@ -1,6 +1,8 @@
edge
+* Switch to Bundler based deployment
+
* Add some missing indices
* Allow to prefill the deployment descirption, see https://github.com/peritor/webistrano/issues/12 [tomfotherby]
View
15 Gemfile
@@ -0,0 +1,15 @@
+source "http://rubygems.org"
+
+gem 'bundler', "1.0.10"
+gem "rails", "2.3.11"
+gem "mysql"
+gem "erubis"
+gem "rake"
+gem "syntax", "1.0.0"
+gem "capistrano", "2.6.0"
+gem "open4", "0.9.3"
+gem "exception_notification", "2.3.3.0"
+
+group :test do
+ gem "mocha", "0.9.8"
+end
View
@@ -105,5 +105,19 @@ def read_environment_rb
end
end
+class Rails::Boot
+ def run
+ load_initializer
+
+ Rails::Initializer.class_eval do
+ def load_gems
+ @bundler_loaded ||= Bundler.require :default, Rails.env
+ end
+ end
+
+ Rails::Initializer.run(:set_load_path)
+ end
+end
+
# All that for this:
Rails.boot!
@@ -0,0 +1,2 @@
+# see http://groups.google.com/group/capistrano/browse_thread/thread/b5e11c0ebf37a8be
+Capistrano::Configuration::Namespaces::Namespace.class_eval { undef :symlink }
View
@@ -0,0 +1,20 @@
+begin
+ require "rubygems"
+ require "bundler"
+rescue LoadError
+ raise "Could not load the bundler gem. Install it with `gem install bundler`."
+end
+
+if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
+ raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
+ "Run `gem install bundler` to upgrade."
+end
+
+begin
+ # Set up load paths for all bundled gems
+ ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
+ Bundler.setup
+rescue Bundler::GemNotFound
+ raise RuntimeError, "Bundler couldn't find some gems." +
+ "Did you run `bundle install`?"
+end
@@ -0,0 +1 @@
+*

0 comments on commit 529d6ae

Please sign in to comment.