Module: Bundlebun

Defined in:
lib/bundlebun.rb,
lib/bundlebun/runner.rb,
lib/bundlebun/version.rb,
lib/bundlebun/integrations.rb,
lib/bundlebun/integrations/execjs.rb,
lib/bundlebun/integrations/vite_ruby.rb,
lib/bundlebun/integrations/jsbundling.rb,
lib/bundlebun/integrations/cssbundling.rb

Overview

bundlebun bundles Bun, a fast JavaScript runtime, package manager and builder, with your Ruby and Rails applications. No Docker, devcontainers, curl | sh, or brew needed.

bundlebun includes binary distributions of Bun for each of the supported platforms (macOS, Linux, Windows) and architectures.

Defined Under Namespace

Modules: Integrations Classes: Runner

Constant Summary collapse

VERSION =

:nodoc:

'0.1.0'

Class Method Summary collapse

Class Method Details

.bunObject Also known as: bun?, bun!

:nodoc:



43
# File 'lib/bundlebun.rb', line 43

def bun = 'Bun' # :nodoc:

.callObject

Runs the Bun runtime with parameters (can be String or Array of strings).

A shortcut for Bundlebun::Runner.call.

Example:

Bundlebun.call('--version')
Bundlebun.call(['add', 'postcss'])

Returns error status 127 if the executable does not exist.



23
24
25
# File 'lib/bundlebun.rb', line 23

def call(...)
  Runner.call(...)
end

.load_tasksObject

:nodoc:



39
40
41
# File 'lib/bundlebun.rb', line 39

def load_tasks # :nodoc:
  Dir[File.expand_path('tasks/*.rake', __dir__)].each { |task| load task }
end

.loaderObject

:nodoc:



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/bundlebun.rb', line 27

def loader # :nodoc:
  @loader ||= Zeitwerk::Loader.for_gem.tap do |loader|
    loader.ignore("#{__dir__}/tasks")
    loader.ignore("#{__dir__}/bundlebun/vendor")
    loader.ignore("#{__dir__}/templates")

    loader.inflector.inflect('execjs' => 'ExecJS')

    loader.setup
  end
end