class Rouge::CLI::Guess
def self.desc
def self.desc "guess the languages of file" end
def self.parse(args)
def self.parse(args) new(input_file: args.shift) end
def initialize(opts)
def initialize(opts) @input_file = opts[:input_file] || '-' @input_source = FileReader.new(@input_file).read end
def lexers
def lexers Lexer.guesses( filename: input_file, source: input_source, ) end
def run
def run lexers.each do |l| puts "{ tag: #{l.tag.inspect}, title: #{l.title.inspect}, desc: #{l.desc.inspect} }" end end