bin/rdbg

changeset 990
a4f19f325dea
parent 946
20c0492da189
child 992
4e3e37ce84bc
equal deleted inserted replaced
989:b5df8971e99b 990:a4f19f325dea
1 #!/usr/bin/env ruby 1 #!/bin/sh
2 # frozen_string_literal: true 2 set -eu
3 . ~/.lib/sh/stubexec.sh
3 4
4 require 'bundler/inline' 5 install_it() {
6 [ -w "$(gem env gemdir)" ] ||
7 opt="--user-install"
5 8
6 gemfile do 9 gem install -q ${opt:-} "debug:>=1.0.0"
7 source 'https://rubygems.org' 10 asdf reshim ruby || :
8 gem 'debug', '>= 1.0.0' 11 }
9 end
10 12
11 def run 13 stubexec "$@"
12 if File.exist?(Bundler.unbundled_env.fetch('BUNDLE_GEMFILE', 'Gemfile'))
13 Bundler.with_unbundled_env do
14 Bundler.reset!
15 yield
16 exit
17 end
18 end
19 yield
20 end
21
22 run do
23 load Gem.bin_path('debug', 'rdbg')
24 end

mercurial