fastlane/lib/fastlane/fast_file.rb in fastlane-2.132.0.beta.20190929200020 vs fastlane/lib/fastlane/fast_file.rb in fastlane-2.132.0.beta.20190930200026

- old
+ new

@@ -24,13 +24,18 @@ 'To avoid issues in the future, you should not use ' \ 'TextEdit for editing it. If you are not using TextEdit, ' \ 'you should turn off smart quotes in your editor of choice.') end - content.scan(/^\s*require (.*)/).each do |current| + content.scan(/^\s*require ["'](.*?)["']/).each do |current| gem_name = current.last next if gem_name.include?(".") # these are local gems - UI.important("You have required a gem, if this is a third party gem, please use `fastlane_require #{gem_name}` to ensure the gem is installed locally.") + + begin + require(gem_name) + rescue LoadError + UI.important("You have required a gem, if this is a third party gem, please use `fastlane_require '#{gem_name}'` to ensure the gem is installed locally.") + end end parse(content, @path) end