Class: Interscript::Command
- Inherits:
-
Thor
- Object
- Thor
- Interscript::Command
- Defined in:
- lib/interscript/command.rb
Overview
Command line interface
Instance Method Summary collapse
- #list ⇒ Object
-
#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’.
Instance Method Details
#list ⇒ Object
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 [:output] Interscript.transliterate_file([:system], input, [:output]) #, JSON.parse(options[:map])) else puts Interscript.transliterate([:system], IO.read(input)) end end |