class TxOcr::CLI
Public Class Methods
source_root()
click to toggle source
# File lib/tx_ocr/cli.rb, line 9 def self.source_root File.expand_path('../..', __dir__) end
Public Instance Methods
config()
click to toggle source
# File lib/tx_ocr/cli.rb, line 14 def config config_path = Dir.home + '/.tx_ocr' if Dir.exist?(config_path) puts "Your current name is [#{TxOcr.config[:name]}]." else template 'templates/settings.yml.tt', "http://#{config_path}/settings.yml" end end
image(filename)
click to toggle source
# File lib/tx_ocr/cli.rb, line 25 def image(filename) puts TxOcr::Image.new(filename).indent_result end
url(url)
click to toggle source
# File lib/tx_ocr/cli.rb, line 30 def url(url) puts TxOcr::Text.new(url).indent_result end
Private Instance Methods
display_name(name)
click to toggle source
# File lib/tx_ocr/cli.rb, line 36 def display_name(name) puts name end