lib/jets/booter.rb
# require_bundle_gems called when environment boots up via Jets.boot.  It
# also useful for when to loading Rake tasks in
# Jets::Commands::RakeTasks.load!
#
# For example, some gems like webpacker that load rake tasks are specified
# with a git based source:
#
#   gem "webpacker", git: "https://github.com/tongueroo/webpacker.git"
#
# This results in the user having to specific bundle exec in front of
# jets for those rake tasks to show up in jets help.
#
# Instead, when the user is within the project folder, jets automatically
# requires bundler for the user. So the rake tasks show up when calling
# jets help.
#
# When the user calls jets help from outside the project folder, bundler
# is not used and the load errors get rescued gracefully.  This is done in
# Jets::Commands::RakeTasks.load!  In the case when there are in another
# project with another Gemfile, the load errors will still be rescued.
require_bundle_gems called when environment boots up via Jets.boot.  It
also useful for when to loading Rake tasks in
Jets::Commands::RakeTasks.load!

For example, some gems like webpacker that load rake tasks are specified
with a git based source.



This results in the user having to specific bundle exec in front of
jets for those rake tasks to show up in jets help.

Instead, when the user is within the project folder, jets automatically
requires bundler for the user. So the rake tasks show up when calling
jets help.

When the user calls jets help from outside the project folder, bundler
is not used and the load errors get rescued gracefully.  This is done in
Jets::Commands::RakeTasks.load.  In the case when there are in another
project with another Gemfile, the load errors will still be rescued.
require_bundle_gems called when environment boots up via Jets . boot . It also useful for when to loading Rake tasks in Jets :: Commands :: RakeTasks . load! For example some gems like webpacker that load rake tasks are specified with a git based source . This results in the user having to specific bundle exec in front of jets for those rake tasks to show up in jets help . Instead when the user is within the project folder jets automatically requires bundler for the user . So the rake tasks show up when calling jets help . When the user calls jets help from outside the project folder bundler is not used and the load errors get rescued gracefully . This is done in Jets :: Commands :: RakeTasks . load . In the case when there are in another project with another Gemfile the load errors will still be rescued .
def require_bundle_gems
      if ENV['BUNDLE_GEMFILE'] || File.exist?("Gemfile")
        require "bundler/setup"
        Bundler.require(*bundler_groups)
      end
    end
def require_bundle_gems if ENV [ 'BUNDLE_GEMFILE' ] || File . exist? ( "Gemfile" ) require "bundler/setup" Bundler . require ( * bundler_groups ) end end
require_bundle_gems called when environment boots up via Jets.boot.
require_bundle_gems called when environment boots up via Jets . boot .
# NOTE: Dont think ENV['BUNDLE_GEMFILE'] is quite working right.  We still need # to be in the project directory.  Leaving logic in here for when it gets fix.