README.adoc in human_languages-0.8.0 vs README.adoc in human_languages-0.9.0

- old
+ new

@@ -6,11 +6,11 @@ image:https://badge.fury.io/rb/human_languages.svg["Gem Version", link="https://badge.fury.io/rb/human_languages"] image:https://img.shields.io/maintenance/yes/2024[Maintenance] image:https://github.com/bbenno/languages/actions/workflows/main.yml/badge.svg[link="https://github.com/bbenno/languages/actions/workflows/main.yml"] -Simple, dependency-less gem providing all known human languagesfootnote:[This includes all individual languages already accounted for in ISO 639-2 as well as extinct, ancient, constructed, and historical languages.] defined in ISO 639-3 +Simple, dependency-less gem providing all known human languagesfootnote:[This includes all individual languages already accounted for in ISO 639-2 as well as extinct, constructed, and historical languages.] defined in ISO 639-3 The ISO code set in link:data/[data/] is taken from the official ISO 639-3 registration authority (ISO 639-3/RA) https://iso639-3.sil.org/[SIL International]. == Installation @@ -56,30 +56,28 @@ .Get all ISO 639-3 languages [source] Languages.all -.Get languages by name +.Get languages by name (regexp search) [source] ---- -Languages.search "^Germ" +Languages.search /Germ/i Languages.search /\AJapan/ ---- [CAUTION] -- -Passing a string to `Languages.search` results in case-sensitive search. -If case-insensitive search is intended, use ignorecase regexp like `/search_pattern/i` or pass optional `case_sensitive` parameter. -[source] -Languages.search('search_pattern', case_sensitive: false) +Searching languages by name is only allowed via `Regexp` that has been prepared and validated (if it comes from a untrusted user) in terms of case sensitivity and security / timeout. +The support of passing search pattern of type String has been removed in v0.9.0. +See https://github.com/bbenno/languages/pull/123[#123] for more details. -- .Since ISO 639-3 categorizes the languages by scope and type, one can filter by them [source] ---- # By scope -Languages.ancient Languages.constructed Languages.extinct Languages.historical Languages.living Languages.special @@ -90,10 +88,10 @@ Languages.special_languages ---- .Further custom language selections can be implemented using `Languages.all` [source] -Languages.all.select { |l| %w[ancient historical].include?(l.type) } +Languages.all.select { |l| %w[extinct historical].include?(l.type) } === Data Objects The `Language` objects have a simple read-only interface: