Class: Lang::Cli

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

Constant Summary collapse

NAME_REGEX =
/^(?:#{Subtags::SUBTAG}|#{Subtags::TAG}):\s*([\w-]+)\s*$/io.freeze
TYPE_REGEX =
/^#{Subtags::TYPE}:\s*(\w+)\s*$/io.freeze

Instance Method Summary collapse

Instance Method Details

#index(path = Lang::Subtags.registry_path) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/lang/cli.rb', line 14

def index(path = Lang::Subtags.registry_path)
  @path = File.expand_path(path)
  if !exists? || options.update?
    download 'http://www.iana.org/assignments/language-subtag-registry'
  end
  build_indices
end