class Romajic::CLI
Command-line interface of {Romajic}
Public Instance Methods
search(word = nil)
click to toggle source
Search romaji in the source files
@param word [String] Target romaji
# File lib/romajic/cli.rb, line 20 def search(word = nil) cop_options = {} cop_options[:word] = word if word cop_options[:exclude_word] = options[:exclude_word] if options[:exclude_word] if options[:config] cop_options[:config] = File.expand_path(options[:config]) else cop_options[:config] = File.expand_path('../../../default.yml', __FILE__) end cop_options[:dir] = options[:dir] if options[:dir] cop_options[:extensions] = options[:extensions] if options[:extensions] cop_options[:distance] = options[:distance] if options[:distance] cop_options[:converter] = options[:converter] if options[:converter] cop = Cop.new(cop_options) cop.search end
version()
click to toggle source
Print the version
# File lib/romajic/cli.rb, line 45 def version puts "romajic #{Romajic::VERSION}" end