move patching to better spot

This commit is contained in:
Sam
2014-02-18 15:58:56 +11:00
parent f617086e91
commit c4f2e49b85

33
Gemfile
View File

@@ -1,5 +1,12 @@
source 'https://rubygems.org' source 'https://rubygems.org'
module ::Kernel
def rails_master?
ENV["RAILS_MASTER"]
end
end
if rails_master?
# monkey patching to support dual booting # monkey patching to support dual booting
module Bundler::SharedHelpers module Bundler::SharedHelpers
def default_lockfile=(path) def default_lockfile=(path)
@@ -10,14 +17,19 @@ module Bundler::SharedHelpers
end end
end end
module ::Kernel Bundler::SharedHelpers.default_lockfile = Pathname.new("#{Bundler::SharedHelpers.default_gemfile}_master.lock")
def rails_master?
ENV["RAILS_MASTER"] # Bundler::Dsl.evaluate already called with an incorrect lockfile ... fix it
class Bundler::Dsl
# A bit messy, this can be called multiple times by bundler, avoid blowing the stack
unless self.method_defined? :to_definition_unpatched
alias_method :to_definition_unpatched, :to_definition
end
def to_definition(bad_lockfile, unlock)
to_definition_unpatched(Bundler::SharedHelpers.default_lockfile, unlock)
end end
end end
if rails_master?
Bundler::SharedHelpers.default_lockfile = Pathname.new("#{Bundler::SharedHelpers.default_gemfile}_master.lock")
end end
# Monkey patch bundler to support mri_21 # Monkey patch bundler to support mri_21
@@ -53,17 +65,6 @@ unless Bundler::Dependency::PLATFORM_MAP.include? :mri_21
end end
end end
# Bundler::Dsl.evaluate already called with an incorrect lockfile ... fix it
class Bundler::Dsl
# A bit messy, this can be called multiple times by bundler, avoid blowing the stack
unless self.method_defined? :to_definition_unpatched
alias_method :to_definition_unpatched, :to_definition
end
def to_definition(bad_lockfile, unlock)
to_definition_unpatched(Bundler::SharedHelpers.default_lockfile, unlock)
end
end
# see: https://github.com/mbleigh/seed-fu/pull/54 # see: https://github.com/mbleigh/seed-fu/pull/54
# taking forever to get changes upstream in seed-fu # taking forever to get changes upstream in seed-fu
gem 'seed-fu-discourse', require: 'seed-fu' gem 'seed-fu-discourse', require: 'seed-fu'