Skip to content

Commit

Permalink
boulder/macros: Add Ruby macros
Browse files Browse the repository at this point in the history
Signed-off-by: Reilly Brogan <[email protected]>
  • Loading branch information
ReillyBrogan committed Feb 12, 2025
1 parent b307599 commit 9df8bc5
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions boulder/data/macros/actions/ruby.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
actions:
- gem_build:
description: Build a ruby gem
example: |
%gem_build
command: |
function gem_build() {
if [ -z "$1" ]; then
gem build *.gemspec || exit 1
else
gem build $* || exit 1
fi
}
gem_build
dependencies:
- binary(gem)

- gem_install:
description: Build a ruby gem
example: |
%gem_install
command: |
function gem_install() {
export geminstalldir=$(ruby -e'puts Gem.default_dir')
export GEM_HOME=$geminstalldir
export GEM_PATH=$geminstalldir
if [ -a *.gem ]; then
gem install --ignore-dependencies --no-user-install --no-document -i "%(installroot)/$geminstalldir" -n "%(installroot)/usr/bin" *.gem || exit 1
else
gem install --ignore-dependencies --no-user-install --no-document -i "%(installroot)/$geminstalldir" -n "%(installroot)/usr/bin" $sources/*.gem || exit 1
fi
if [[ -e "%(installroot)/$geminstalldir/cache" ]]; then
rm -rfv %(installroot)/$geminstalldir/cache
fi
}
gem_install
dependencies:
- binary(gem)
- binary(ruby)

0 comments on commit 9df8bc5

Please sign in to comment.