Sha256: 714e01b329d8b6fba661b389d9b0501598a9bfd9e1f5efb430bff8fdaa8c2ee1
Contents?: true
Size: 591 Bytes
Versions: 34
Compression:
Stored size: 591 Bytes
Contents
#!/usr/bin/ruby require 'ruby-beautify' require 'optparse' 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
34 entries across 34 versions & 2 rubygems