bin/rb

Mon, 20 Mar 2023 10:03:46 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 20 Mar 2023 10:03:46 -0500
changeset 1090
a9da52816a33
parent 719
490da8798a6a
permissions
-rwxr-xr-x

remove lsp stuff from vim

#!/usr/bin/env ruby
File.join(Dir.home, '.rbrc').tap { |f| load f if File.exists?(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)

# https://raw.githubusercontent.com/thisredone/rb/master/rb

mercurial