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

Version Path
knife-chop-0.12.18 lib/ruby-beautify/bin/rbeautify
knife-chop-0.12.17 lib/ruby-beautify/bin/rbeautify
knife-chop-0.12.03 lib/ruby-beautify/bin/rbeautify
knife-chop-0.11.12 lib/ruby-beautify/bin/rbeautify
knife-chop-0.9.5 lib/ruby-beautify/bin/rbeautify
knife-chop-0.9.4 lib/ruby-beautify/bin/rbeautify
knife-chop-0.9.2 lib/ruby-beautify/bin/rbeautify
knife-chop-0.9.1 lib/ruby-beautify/bin/rbeautify
knife-chop-0.9.0 lib/ruby-beautify/bin/rbeautify
knife-chop-0.8.3 lib/ruby-beautify/bin/rbeautify
knife-chop-0.8.2 lib/ruby-beautify/bin/rbeautify
knife-chop-0.8.0 lib/ruby-beautify/bin/rbeautify
knife-chop-0.7.8 lib/ruby-beautify/bin/rbeautify
knife-chop-0.7.2 lib/ruby-beautify/bin/rbeautify
knife-chop-0.7.1 lib/ruby-beautify/bin/rbeautify
knife-chop-0.7.0 lib/ruby-beautify/bin/rbeautify
knife-chop-0.6.7 lib/ruby-beautify/bin/rbeautify
knife-chop-0.5.15 lib/ruby-beautify/bin/rbeautify
knife-chop-0.4.1 lib/ruby-beautify/bin/rbeautify
knife-chop-0.4.0 lib/ruby-beautify/bin/rbeautify