mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
move patching to better spot
This commit is contained in:
33
Gemfile
33
Gemfile
@@ -1,5 +1,12 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
module ::Kernel
|
||||
def rails_master?
|
||||
ENV["RAILS_MASTER"]
|
||||
end
|
||||
end
|
||||
|
||||
if rails_master?
|
||||
# monkey patching to support dual booting
|
||||
module Bundler::SharedHelpers
|
||||
def default_lockfile=(path)
|
||||
@@ -10,14 +17,19 @@ module Bundler::SharedHelpers
|
||||
end
|
||||
end
|
||||
|
||||
module ::Kernel
|
||||
def rails_master?
|
||||
ENV["RAILS_MASTER"]
|
||||
Bundler::SharedHelpers.default_lockfile = Pathname.new("#{Bundler::SharedHelpers.default_gemfile}_master.lock")
|
||||
|
||||
# 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
|
||||
|
||||
if rails_master?
|
||||
Bundler::SharedHelpers.default_lockfile = Pathname.new("#{Bundler::SharedHelpers.default_gemfile}_master.lock")
|
||||
end
|
||||
|
||||
# Monkey patch bundler to support mri_21
|
||||
@@ -53,17 +65,6 @@ unless Bundler::Dependency::PLATFORM_MAP.include? :mri_21
|
||||
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
|
||||
# taking forever to get changes upstream in seed-fu
|
||||
gem 'seed-fu-discourse', require: 'seed-fu'
|
||||
|
||||
Reference in New Issue
Block a user