lib/jets/commands/rake_tasks.rb
# Handles load errors gracefuly per Booter.required_bundle_gems comments.
Handles load errors gracefuly per Booter.required_bundle_gems comments.
Handles load errors gracefuly per Booter . required_bundle_gems comments .
def load_webpacker_tasks
      begin
        require "webpacker"
      rescue LoadError
        return
      end
      Webpacker::RakeTasks.load!
      Rake::Task['webpacker:install'].enhance do
        args ||= []
        args += ["--force"] if ENV['FORCE']
        Jets::Commands::WebpackerTemplate.start(args)
      end
    end
def load_webpacker_tasks begin require "webpacker" rescue LoadError return end Webpacker :: RakeTasks . load! Rake :: Task [ 'webpacker:install' ] . enhance do args ||= [ ] args += [ "--force" ] if ENV [ 'FORCE' ] Jets :: Commands :: WebpackerTemplate . start ( args ) end end
Handles load errors gracefuly per Booter.required_bundle_gems comments.
Handles load errors gracefuly per Booter . required_bundle_gems comments .
# puts "WARN: unable to load gem. #{$!}. Running with 'bundle exec' might fix this warning." # Happens whne user calls jets help outside the jets project folder. # Thanks: https://coderwall.com/p/qhdhgw/adding-a-post-execution-hook-to-the-rails-db-migrate-task # Enchancing in case the user runs webpacker:install afterwards # instead of jets new. # FORCE from rake webpacker:install FORCE=1 # using ENV because rake webpacker:install is a rake task