Add sick "run anywhere ignoring bundler" hacks

Wed, 22 Sep 2021 16:34:57 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 22 Sep 2021 16:34:57 -0400
changeset 946
20c0492da189
parent 945
29657d7ea734
child 947
dbec28d7a4f1

Add sick "run anywhere ignoring bundler" hacks

bin/pry file | annotate | diff | comparison | revisions
bin/rdbg file | annotate | diff | comparison | revisions
new file mode 100755
--- /dev/null
+++ b/bin/pry
@@ -0,0 +1,26 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+require 'bundler/inline'
+
+gemfile do
+  source 'https://rubygems.org'
+  gem 'pry', '~> 0.13.1'
+  gem 'pry-byebug'
+  gem 'pry-inline'
+end
+
+def run
+  if File.exist?(Bundler.unbundled_env.fetch('BUNDLE_GEMFILE', 'Gemfile'))
+    Bundler.with_unbundled_env do
+      Bundler.reset!
+      yield
+      exit
+    end
+  end
+  yield
+end
+
+run do
+  load Gem.bin_path('pry', 'pry')
+end
new file mode 100755
--- /dev/null
+++ b/bin/rdbg
@@ -0,0 +1,24 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+require 'bundler/inline'
+
+gemfile do
+  source 'https://rubygems.org'
+  gem 'debug', '>= 1.0.0'
+end
+
+def run
+  if File.exist?(Bundler.unbundled_env.fetch('BUNDLE_GEMFILE', 'Gemfile'))
+    Bundler.with_unbundled_env do
+      Bundler.reset!
+      yield
+      exit
+    end
+  end
+  yield
+end
+
+run do
+  load Gem.bin_path('debug', 'rdbg')
+end

mercurial