Allow findup to be false

This commit is contained in:
Thomas Reynolds 2016-02-03 09:57:30 -08:00
parent 6de25dfd0e
commit a2181a2fd9
2 changed files with 9 additions and 1 deletions

View file

@ -1,6 +1,12 @@
master master
=== ===
* Allow looking for `Gemfile` when setting up a project to fail gracefully.
# 4.1.1
* Fix bad code that made `/__middleman/` break.
# 4.1.0 # 4.1.0
* Add rewrite_ignore option to asset_hash, asset_host, cache_buster & relative_assets. This proc let's you opt-out of the extension behavior on a per-path basis. * Add rewrite_ignore option to asset_hash, asset_host, cache_buster & relative_assets. This proc let's you opt-out of the extension behavior on a per-path basis.

View file

@ -22,7 +22,9 @@ module Middleman
# Set BUNDLE_GEMFILE and run Bundler setup. Raises an exception if there is no Gemfile # Set BUNDLE_GEMFILE and run Bundler setup. Raises an exception if there is no Gemfile
def setup_bundler def setup_bundler
ENV['BUNDLE_GEMFILE'] ||= File.join(findup('Gemfile', ENV['MM_ROOT']), 'Gemfile') if found_gemfile_root = findup('Gemfile', ENV['MM_ROOT'])
ENV['BUNDLE_GEMFILE'] ||= File.join(found_gemfile_root, 'Gemfile')
end
unless File.exist?(ENV['BUNDLE_GEMFILE']) unless File.exist?(ENV['BUNDLE_GEMFILE'])
ENV['BUNDLE_GEMFILE'] = File.expand_path('../../../../Gemfile', __FILE__) ENV['BUNDLE_GEMFILE'] = File.expand_path('../../../../Gemfile', __FILE__)