bin/rb

Wed, 27 Dec 2023 01:39:00 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 27 Dec 2023 01:39:00 -0600
changeset 1137
f767f8cd6a9f
parent 719
490da8798a6a
permissions
-rwxr-xr-x

add asciidoctor and timetrap stubs

#!/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