Class: Ucode::Cli::Lookup

Inherits:
Thor
  • Object
show all
Defined in:
lib/ucode/cli.rb

Overview

─────────────── lookup ───────────────

Instance Method Summary collapse

Instance Method Details

#block(codepoint) ⇒ Object



127
128
129
130
131
132
133
# File 'lib/ucode/cli.rb', line 127

def block(codepoint)
  cp = parse_cp(codepoint)
  with_db_handling do
    result = Commands::LookupCommand.new.lookup_block(options[:version], codepoint: cp)
    puts "#{format("U+%04X", cp)}#{result.block || "(unassigned)"}"
  end
end

#char(codepoint) ⇒ Object



148
149
150
151
152
153
154
155
# File 'lib/ucode/cli.rb', line 148

def char(codepoint)
  cp = parse_cp(codepoint)
  with_db_handling do
    result = Commands::LookupCommand.new
      .lookup_char(options[:version], codepoint: cp, output_root: options[:from])
    puts "#{format("U+%04X", cp)} block=#{result.block_id} glyph=#{result.glyph_path}"
  end
end

#script(codepoint) ⇒ Object



137
138
139
140
141
142
143
# File 'lib/ucode/cli.rb', line 137

def script(codepoint)
  cp = parse_cp(codepoint)
  with_db_handling do
    result = Commands::LookupCommand.new.lookup_script(options[:version], codepoint: cp)
    puts "#{format("U+%04X", cp)}#{result.script || "(none)"}"
  end
end