Browse Source

Replace the `platform :ruby18` hack with `install_if`

This is a new feature in Bundler 1.10.
Akinori MUSHA 9 years ago
parent
commit
06827f99a0
1 changed files with 6 additions and 14 deletions
  1. 6 14
      Gemfile

+ 6 - 14
Gemfile

@@ -131,22 +131,14 @@ gem 'tzinfo', '>= 1.2.0'	# required by rails; 1.2.0 has support for *BSD and Sol
 # Windows does not have zoneinfo files, so bundle the tzinfo-data gem.
 gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
 
-# Introduces a scope for Heroku specific gems.
-def on_heroku
-  if ENV['ON_HEROKU'] ||
-     ENV['HEROKU_POSTGRESQL_ROSE_URL'] ||
-     ENV['HEROKU_POSTGRESQL_GOLD_URL'] ||
-     File.read(File.join(File.dirname(__FILE__), 'Procfile')) =~ /intended for Heroku/
-    yield
-  else
-    # When not on Heroku, we still want our Gemfile.lock to include
-    # Heroku specific gems, so we scope them to an unsupported
-    # platform.
-    platform :ruby_18, &proc
-  end
+def heroku?
+  ENV['ON_HEROKU'] ||
+    ENV['HEROKU_POSTGRESQL_ROSE_URL'] ||
+    ENV['HEROKU_POSTGRESQL_GOLD_URL'] ||
+    File.read(File.join(File.dirname(__FILE__), 'Procfile')) =~ /intended for Heroku/
 end
 
-on_heroku do
+install_if -> { heroku? } do
   gem 'pg'
   gem 'unicorn'
   gem 'rails_12factor', group: :production