From a2181a2fd91580fef9eec9629b1ea507c1b04fd0 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Wed, 3 Feb 2016 09:57:30 -0800 Subject: [PATCH] Allow findup to be false --- CHANGELOG.md | 6 ++++++ middleman-core/lib/middleman-core/load_paths.rb | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f562aa0f..89a3371f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ 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 * 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. diff --git a/middleman-core/lib/middleman-core/load_paths.rb b/middleman-core/lib/middleman-core/load_paths.rb index c0bda7b2..af281886 100644 --- a/middleman-core/lib/middleman-core/load_paths.rb +++ b/middleman-core/lib/middleman-core/load_paths.rb @@ -22,7 +22,9 @@ module Middleman # Set BUNDLE_GEMFILE and run Bundler setup. Raises an exception if there is no Gemfile 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']) ENV['BUNDLE_GEMFILE'] = File.expand_path('../../../../Gemfile', __FILE__)