mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 00:47:46 -06:00
Add some Ruby 2.1 specific Gems, get people to upgrade bundler
This commit is contained in:
parent
78bfa29b85
commit
057d8b2b42
35
Gemfile
35
Gemfile
@ -20,6 +20,39 @@ if rails_master?
|
||||
Bundler::SharedHelpers.default_lockfile = Pathname.new("#{Bundler::SharedHelpers.default_gemfile}_master.lock")
|
||||
end
|
||||
|
||||
# Monkey patch bundler to support mri_21
|
||||
unless Bundler::Dependency::PLATFORM_MAP.include? :mri_21
|
||||
STDERR.puts
|
||||
STDERR.puts "WARNING: --------------------------------------------------------------------------"
|
||||
STDERR.puts "You are running an old version of bundler, please update by running: gem install bundler"
|
||||
STDERR.puts
|
||||
map = Bundler::Dependency::PLATFORM_MAP.dup
|
||||
map[:mri_21] = Gem::Platform::RUBY
|
||||
map.freeze
|
||||
Bundler::Dependency.send(:remove_const, "PLATFORM_MAP")
|
||||
Bundler::Dependency.const_set("PLATFORM_MAP", map)
|
||||
|
||||
Bundler::Dsl.send(:remove_const, "VALID_PLATFORMS")
|
||||
Bundler::Dsl.const_set("VALID_PLATFORMS", map.keys.freeze)
|
||||
class ::Bundler::CurrentRuby
|
||||
def on_21?
|
||||
RUBY_VERSION =~ /^2\.1/
|
||||
end
|
||||
def mri_21?
|
||||
mri? && on_21?
|
||||
end
|
||||
end
|
||||
class ::Bundler::Dependency
|
||||
private
|
||||
def on_21?
|
||||
RUBY_VERSION =~ /^2\.1/
|
||||
end
|
||||
def mri_21?
|
||||
mri? && on_21?
|
||||
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
|
||||
@ -180,6 +213,8 @@ gem 'rbtrace', require: false, platform: :mri
|
||||
# required for feed importing and embedding
|
||||
gem 'ruby-readability', require: false
|
||||
gem 'simple-rss', require: false
|
||||
gem 'gctools', require: false, platform: :mri_21
|
||||
gem 'stackprof', require: false, platform: :mri_21
|
||||
|
||||
# perftools only works on 1.9 atm
|
||||
group :profile do
|
||||
|
@ -115,6 +115,7 @@ GEM
|
||||
ruby-hmac
|
||||
formatador (0.2.4)
|
||||
fspath (2.0.5)
|
||||
gctools (0.2.3)
|
||||
given_core (3.1.1)
|
||||
sorcerer (>= 0.3.7)
|
||||
guess_html_encoding (0.0.9)
|
||||
@ -349,6 +350,7 @@ GEM
|
||||
actionpack (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
sprockets (~> 2.8)
|
||||
stackprof (0.2.5)
|
||||
temple (0.6.7)
|
||||
therubyracer (0.12.1)
|
||||
libv8 (~> 3.16.14.0)
|
||||
@ -404,6 +406,7 @@ DEPENDENCIES
|
||||
fastimage
|
||||
flamegraph
|
||||
fog (= 1.18.0)
|
||||
gctools
|
||||
handlebars-source (~> 1.1.2)
|
||||
highline
|
||||
hiredis
|
||||
@ -462,6 +465,7 @@ DEPENDENCIES
|
||||
sinatra
|
||||
slim
|
||||
spork-rails
|
||||
stackprof
|
||||
therubyracer
|
||||
thin
|
||||
timecop
|
||||
|
Loading…
Reference in New Issue
Block a user