Project

General

Profile

Actions

Bug #14572

closed

Gem::Text methods not available

Added by svnpenn (Steven Penny) almost 7 years ago. Updated almost 7 years ago.

Status:
Rejected
Target version:
-
[ruby-core:85907]

Description

http://ruby-doc.org/stdlib/libdoc/rubygems/rdoc/Gem/Text.html

none of these work because they are private? see example here of workaround

http://stackoverflow.com/a/46029581

Updated by svnpenn (Steven Penny) almost 7 years ago

correcting myself - looks like it just needs to be invoked like this

require 'rubygems/text'
extend Gem::Text
p levenshtein_distance("asd", "sdf")

Updated by shevegen (Robert A. Heiler) almost 7 years ago

Yes, I would not have known myself if havenwood would not have
pointed out to me, a few years ago, that levensthein-calculation
exists within the Gem namespace (I make use of it in one gem that
deals with bioinformatics of some sorts; there the levensthein
distance can be useful to assess differences between
nucleotide/aminoacid sequences).

I think this is not a bug but more like a suggestion to enhance
the documentation - perhaps one or two examples could be added.

PS: The Gem namespace has quite a few nifty things; I especially
like Gem::Version.new() to compare version of programs, and
if you ever need the registered licenses, you can use
Gem::Licenses::IDENTIFIERS - there is a lot of useful stuff
within Gem; finding them is not always trivial though.

Updated by hsbt (Hiroshi SHIBATA) almost 7 years ago

  • Status changed from Open to Rejected
  • Assignee set to hsbt (Hiroshi SHIBATA)

Gem::Text is a Module. It's expected behavior.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0