lib/appengine-tools/gem_bundler.rb in appengine-tools-0.0.6 vs lib/appengine-tools/gem_bundler.rb in appengine-tools-0.0.7
- old
+ new
@@ -20,10 +20,17 @@
require 'zip/zip'
require 'zip/zipfilesystem'
require 'rubygems/command_manager'
require 'appengine-tools/bundler'
+# Support Ruby 1.6, without active_support/extensions/facets
+class Symbol
+ def to_proc
+ Proc.new { |*args| args.shift.__send__(self, *args) }
+ end unless :to_proc.respond_to?(:to_proc)
+end
+
module AppEngine
module Admin
class GemBundler
@@ -63,19 +70,9 @@
end
rescue Gem::SystemExitException => e
exit e.exit_code unless e.exit_code == 0
end
bundler_dir = "#{app.gems_dir}/bundler_gems"
- # TODO: this temporary hack should be fixed properly
- gem_patch = <<MOD
-# Injected by appengine-tools to patch bundler for Sinatra and Rails 3
-module Gem
- def self.default_dir; ENV['GEM_HOME']; end
- def self.dir; ENV['GEM_HOME']; end
- def self.path; ENV['GEM_PATH']; end
-end
-MOD
- File.open("#{bundler_dir}/environment.rb",'a') {|f| f << gem_patch }
FileUtils.rm app.gems_jar, :force => true # blow away the old jar
puts "=> Packaging gems"
gem_files = Dir["#{bundler_dir}/gems/**/**"] +
Dir["#{bundler_dir}/dirs/**/**"] +
Dir["#{bundler_dir}/environment.rb"]