Sha256: 9b1ec39108059cb800543d42e95c4b20bc3252a4b10f3edc6186b39c5f8c1ad9

Contents?: true

Size: 559 Bytes

Versions: 5

Compression:

Stored size: 559 Bytes

Contents

#!/usr/bin/ruby -ws

require 'rubygems'
require 'ruby2ruby'
require 'ruby_parser'

$h ||= false
$s ||= false

if $h then
  puts "usage: #{File.basename $0} [options] [file...]"
  puts "options:"
  puts "-h     : display usage"
  puts "-s     : print the sexp before displaying the translated ruby"

  exit 1
end

ARGV.push "-" if ARGV.empty?

parser    = RubyParser.new
ruby2ruby = Ruby2Ruby.new

ARGV.each do |file|
  ruby = file == "-" ? $stdin.read : File.read(file)

  sexp = parser.process(ruby, file)

  p sexp if $s

  puts ruby2ruby.process(sexp)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby2ruby-2.5.1 bin/r2r_show
ruby2ruby-2.5.0 bin/r2r_show
ruby2ruby-2.4.4 bin/r2r_show
ruby2ruby-2.4.3 bin/r2r_show
ruby2ruby-2.4.2 bin/r2r_show