From d2c331b9f036951eef062dd5141c75182375ba12 Mon Sep 17 00:00:00 2001 From: Simon Parri Date: Tue, 22 Jul 2025 00:56:22 +0200 Subject: Add current configuration --- common/bin/rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 common/bin/rb (limited to 'common/bin/rb') diff --git a/common/bin/rb b/common/bin/rb new file mode 100755 index 0000000..980016b --- /dev/null +++ b/common/bin/rb @@ -0,0 +1,14 @@ +#!/usr/bin/ruby +# Taken from https://github.com/thisredone/rb + +File.join(Dir.home, '.rbrc').tap { |f| load f if File.exist?(f) } + +def execute(_, code) + puts _.instance_eval(&code) +rescue Errno::EPIPE + exit +end + +single_line = ARGV.delete('-l') +code = eval("Proc.new { #{ARGV.join(' ')} }") +single_line ? STDIN.each { |l| execute(l.chomp, code) } : execute(STDIN.each_line, code) -- cgit v1.2.3