class Rufo::Command
def format_stdin
def format_stdin code = STDIN.read result = format(code, @filename_for_dot_rufo || Dir.getwd) print(result) if !@want_check code == result ? CODE_OK : CODE_CHANGE rescue Rufo::SyntaxError STDERR.puts "Error: the given text is not a valid ruby program (it has syntax errors)" CODE_ERROR rescue => ex STDERR.puts "You've found a bug!" STDERR.puts "Please report it to https://github.com/ruby-formatter/rufo/issues with code that triggers it" STDERR.puts raise ex end