Documentation Index
Fetch the complete documentation index at: https://docs.aspect.build/llms.txt
Use this file to discover all available pages before exploring further.
Documentation for @rules_ruby@v0.23.1 — View source
Rule: rb_binary
Runs a Ruby binary.
Suppose you have the following Ruby gem, where rb_library() is used
in BUILD files to define the packages for the gem.
lib/gem/version.rb:
lib/gem/BUILD:
lib/gem/add.rb:
lib/gem/BUILD:
bin argument with a path to a Bundler binary stub:
BUILD:
Attributes
A unique name for this target.
Ruby script to run. It may also be a binary stub generated by Bundler.
If omitted, it defaults to the Ruby interpreter.Use a built-in
args attribute to pass extra arguments to the script.Environment variables to use during execution.Supports
$(location) expansion for targets from srcs, data and deps.List of environment variable names to be inherited by the test runner.
Override Ruby toolchain to use when running the script.
Additional coverage filters to add to SimpleCov. Only applied during ‘bazel coverage’.
List of Ruby source files used to build the library.
List of runtime dependencies needed by a program that depends on this library.
List of other Ruby libraries the target depends on.
Rule: rb_bundle_install
Installs Bundler dependencies from cached gems.
You normally don’t need to call this rule directly as it’s an internal one
used by rb_bundle_fetch().
Attributes
A unique name for this target.
Gemfile to install dependencies from.
Gemfile.lock to install dependencies from.
List of gems in vendor/cache that are used to install dependencies from.
JAR dependencies for JRuby gems.
Path to the directory containing JAR dependencies (set as JARS_HOME).
List of Ruby source files used to build the library.
Environment variables to use during installation.
Override Ruby toolchain to use when installing the gem.
Rule: rb_gem
Exposes a Ruby gem file.
You normally don’t need to call this rule directly as it’s an internal one
used by rb_bundle_fetch().
Attributes
A unique name for this target.
Gem file.
Rule: rb_gem_build
Builds a Ruby gem.
Suppose you have the following Ruby gem, where rb_library() is used
in BUILD files to define the packages for the gem.
gem.gemspec:
.gem file by defining a target:
BUILD:
Attributes
A unique name for this target.
List of Ruby source files used to build the library.
List of other Ruby libraries the target depends on.
List of runtime dependencies needed by a program that depends on this library.
List of bundle environment variables to set when building the library.
Override Ruby toolchain to use when running the script.
Gemspec file to use for gem building.
Rule: rb_gem_install
Installs a built Ruby gem.
Suppose you have the following Ruby gem, where rb_library() is used
in BUILD files to define the packages for the gem and rb_gem_build() is used
to build a Ruby gem package from the sources.
.gem file by defining a target:
BUILD:
Attributes
A unique name for this target.
Gem file to install.
Override Ruby toolchain to use when installing the gem.
Rule: rb_gem_push
Pushes a built Ruby gem.
Suppose you have the following Ruby gem, where rb_library() is used
in BUILD files to define the packages for the gem and rb_gem_build() is used
to build a Ruby gem package from the sources.
.gem file to RubyGems by defining a target:
BUILD:
Attributes
A unique name for this target.
List of Ruby source files used to build the library.
List of other Ruby libraries the target depends on.
List of runtime dependencies needed by a program that depends on this library.
List of bundle environment variables to set when building the library.
Gem file to push to RubyGems. You would usually use an output of
rb_gem_build() target here.Environment variables to use during execution.Supports
$(location) expansion for targets from srcs, data and deps.List of environment variable names to be inherited by the test runner.
Override Ruby toolchain to use when running the script.
Rule: rb_library
Defines a Ruby library.
Suppose you have the following Ruby gem:
BUILD:
lib/BUILD:
lib/gem/BUILD:
rb_gem_build() to build a Ruby gem. See examples of
using other rules.
Attributes
A unique name for this target.
List of Ruby source files used to build the library.
List of other Ruby libraries the target depends on.
List of runtime dependencies needed by a program that depends on this library.
List of bundle environment variables to set when building the library.
Rule: rb_test
Runs a Ruby test.
Suppose you have the following Ruby gem, where rb_library() is used
in BUILD files to define the packages for the gem.
spec/ by defining individual targets:
spec/BUILD:
rb_test() is a wrapper around rb_binary(), you can also use it to run
a Ruby binary script available in Gemfile dependencies, by passing main
argument with a path to a Bundler binary stub.
BUILD:
Code Coverage
To enable code coverage, run tests with thecoverage command:
[!NOTE] Code coverage is currently not supported on Windows.See the README for more details. Note that you can also
run every test target passing extra arguments to
the Ruby script. For example, you can re-use :rubocop target to perform autocorrect:
Attributes
A unique name for this target.
Ruby script to run. It may also be a binary stub generated by Bundler.
If omitted, it defaults to the Ruby interpreter.Use a built-in
args attribute to pass extra arguments to the script.Environment variables to use during execution.Supports
$(location) expansion for targets from srcs, data and deps.List of environment variable names to be inherited by the test runner.
Override Ruby toolchain to use when running the script.
Additional coverage filters to add to SimpleCov. Only applied during ‘bazel coverage’.
List of Ruby source files used to build the library.
List of runtime dependencies needed by a program that depends on this library.
List of other Ruby libraries the target depends on.

