Skip to content

Commit

Permalink
ruby: Workaround ruby-lsp issue with bundler
Browse files Browse the repository at this point in the history
ruby-lsp calls bundle with an undocumented version number argument
supported by RubyGems binstubs. Portage binstubs don't support this. Use
a wrapper to throw away the version number argument.

See: Shopify/ruby-lsp#3022
  • Loading branch information
jameslikeslinux committed Jan 8, 2025
1 parent f432d6e commit dc6ce2d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/build/gentoo/stage1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ nest::classes:
- 'nest::base::portage'
- 'nest::base::puppet'
- 'nest::base::qemu'
- 'nest::base::ruby'
- 'nest::base::scripts'
- 'nest::base::ssh'
- 'nest::base::sudo'
Expand Down
18 changes: 18 additions & 0 deletions manifests/base/ruby.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class nest::base::ruby {
# Workaround ruby-lsp issue calling bundle with version argument
# See: https://github.com/Shopify/ruby-lsp/issues/3022
exec { '/bin/mv /usr/bin/bundle /usr/bin/bundle.real':
onlyif => '/bin/grep -E "Generated by ruby-fakegem.eclass" /usr/bin/bundle',
}
->
file { '/usr/bin/bundle':
mode => '0755',
owner => 'root',
group => 'root',
content => @(WRAPPER),
#!/bin/bash
[[ $1 == _*_ ]] && shift
exec /usr/bin/bundle.real "$@"
| WRAPPER
}
}
1 change: 1 addition & 0 deletions spec/classes/nest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
'nest::base::portage',
'nest::base::puppet',
'nest::base::qemu',
'nest::base::ruby',
'nest::base::scripts',
'nest::base::ssh',
'nest::base::sudo',
Expand Down

0 comments on commit dc6ce2d

Please sign in to comment.