Sha256: 564c53aa2172aef09358423cd0951879e696bd004f29f1c0ac69df8d49ca89e5

Contents?: true

Size: 572 Bytes

Versions: 2

Compression:

Stored size: 572 Bytes

Contents

#!/usr/bin/ruby
require 'ruby-beautify'

include RBeautify

Options = OptionParser.new do |opts|
  opts.on("-V", "--version", "Print version") { |version| puts RBeautify::VERSION;exit 0}
  opts.banner = "Usage: print ruby into a pretty format, or break trying."
end
Options.parse!

if ARGV.empty?
  begin
    puts RBeautify.beautify_string :ruby, STDIN
  rescue Exception => e
    puts e.message
    exit
  end
else
  ARGV.each do |f|
    if File.exist? f
      puts RBeautify.beautify_string :ruby, open(f).read
    else
      puts "No such file: #{f}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-beautify-0.92.1 bin/rbeautify
ruby-beautify-0.92.0 bin/rbeautify