Sha256: b5d61c8ffccd3a90a0086cbc8cd742b4ee63d7c8d2d1d7a6ace0a64b04ac46a5
Contents?: true
Size: 727 Bytes
Versions: 14
Compression:
Stored size: 727 Bytes
Contents
require 'thor' module FindbugsTranslateCheckstyleFormat class CLI < Thor include ::FindbugsTranslateCheckstyleFormat::Translate desc 'translate', 'Exec Translate' option :data option :file def translate data = fetch_data(options) xml = parse(data) checkstyle = trans(xml) checkstyle.write(STDOUT, 2) end no_commands do def fetch_data(options) data = \ if options[:data] options[:data] elsif options[:file] File.read(options[:file]) elsif !$stdin.tty? ARGV.clear ARGF.read end fail NoInputError if !data || data.empty? data end end end end
Version data entries
14 entries across 14 versions & 1 rubygems