Module: Bundlebun
- Defined in:
- lib/bundlebun.rb,
lib/bundlebun/runner.rb,
lib/bundlebun/version.rb,
lib/bundlebun/env_path.rb,
lib/bundlebun/platform.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,
sig/bundlebun.rbs,
sig/bundlebun/runner.rbs,
sig/bundlebun/version.rbs,
sig/bundlebun/env_path.rbs,
sig/bundlebun/platform.rbs,
sig/bundlebun/integrations.rbs,
sig/bundlebun/integrations/execjs.rbs,
sig/bundlebun/integrations/vite_ruby.rbs,
sig/bundlebun/integrations/jsbundling.rbs,
sig/bundlebun/integrations/cssbundling.rbs
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.
bundlebun provides two ways to run Bun:
-
Bundlebun.call (also available as Bundlebun.exec): Replaces the current Ruby process with Bun. The default.
-
Bundlebun.system: Runs Bun as a subprocess and returns control to Ruby. Use this when you need to continue executing Ruby code after Bun finishes.
Defined Under Namespace
Modules: Integrations Classes: EnvPath, Platform, Runner
Constant Summary collapse
- VERSION =
bundlebun uses the
#{bundlebun.version}.#{bun.version}versioning scheme. gem bundlebun version0.1.0.1.1.38is a distribution that includes a gem with its own code version0.1.0and a Bun runtime with version1.1.38.This constant always points to the "own" version of the gem.
'0.5.1'
Class Method Summary collapse
- .bun ⇒ Object (also: bun?, bun!)
-
.call ⇒ bot
Replaces the current Ruby process with Bun.
-
.exec ⇒ bot
Replaces the current Ruby process with Bun.
-
.load_integrations ⇒ Array[Module]
Detect and load all integrations (monkey-patches).
-
.load_tasks ⇒ void
Load included Rake tasks (like
bun:install). -
.prepend_to_path ⇒ String?
Prepend the path to the bundled Bun executable to
PATH. -
.system ⇒ Boolean?
Runs Bun as a subprocess and returns control to Ruby.
Class Method Details
.bun ⇒ Object Also known as: bun?, bun!
117 |
# File 'lib/bundlebun.rb', line 117 def bun = 'Bun' |
.call ⇒ bot
Replaces the current Ruby process with Bun. This is the default way to run Bun. Never returns.
60 61 62 |
# File 'lib/bundlebun.rb', line 60 def call(...) Runner.call(...) end |
.exec ⇒ bot
Replaces the current Ruby process with Bun. Same as .call.
71 72 73 |
# File 'lib/bundlebun.rb', line 71 def exec(...) Runner.exec(...) end |
.load_integrations ⇒ Array[Module]
Detect and load all integrations (monkey-patches).
113 114 115 |
# File 'lib/bundlebun.rb', line 113 def load_integrations Integrations.bun! end |
.load_tasks ⇒ void
This method returns an undefined value.
Load included Rake tasks (like bun:install).
106 107 108 |
# File 'lib/bundlebun.rb', line 106 def load_tasks Dir[File.('tasks/*.rake', __dir__)].each { |task| Rake.load_rakefile(task) } end |
.prepend_to_path ⇒ String?
Prepend the path to the bundled Bun executable to PATH.
101 102 103 |
# File 'lib/bundlebun.rb', line 101 def prepend_to_path EnvPath.prepend(Runner.full_directory) end |