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


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

def list
  dir = File.expand_path '../../maps/*.yaml', __dir__
  Dir[dir].each do |path|
    puts File.basename path, '.yaml'
  end
end

#translit(input) ⇒ Object


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

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