class Libis::Format::Cli::Format
Constants
- DEFAULT_CONFIG
- STRING_CONFIG
Public Class Methods
description(field)
click to toggle source
# File lib/libis/format/cli/format.rb, line 13 def self.description(field) "#{STRING_CONFIG[field]}." + (DEFAULT_CONFIG[field].nil? ? '' : " default: #{DEFAULT_CONFIG[field]}") end
Public Instance Methods
identify(source_file)
click to toggle source
# File lib/libis/format/cli/format.rb, line 51 def identify(source_file) ::Libis::Tools::Config.logger.level = :WARN opts = options.inject({}) { |h, x| h[x.first.to_sym] = x.last; h} opts[:keep_output] = true result = ::Libis::Format::Identifier.get source_file, opts puts '--- messages ---' result[:messages].each do |message| puts "#{message[0]} : #{message[1]}" end puts '--- formats ---' result[:formats].each do |file, info| puts "#{file}:" ap info end puts '--- tool results ---' result[:output].each do |file, info| puts "#{file}:" ap info end end