Class: Interscript::Command

Inherits:
Thor
  • Object
show all
Defined in:
lib/interscript/command.rb

Overview

Command line interface

Instance Method Summary collapse

Instance Method Details

#listObject



22
23
24
25
26
# File 'lib/interscript/command.rb', line 22

def list
  Interscript.maps(load_path: true).each do |path|
    puts path
  end
end

#translit(input) ⇒ Object

Was this option really well thought out? The last parameter is a cache, isn’t it? option :map, aliases: ‘-m’, required: false, default: “{}”, desc: ‘Transliteration mapping json’



13
14
15
16
17
18
19
# File 'lib/interscript/command.rb', line 13

def translit(input)
  if options[:output]
    Interscript.transliterate_file(options[:system], input, options[:output]) #, JSON.parse(options[:map]))
  else
    puts Interscript.transliterate(options[:system], IO.read(input))
  end
end