rsl / stringex

Some [hopefully] useful extensions to Ruby’s String class. It is made up of three libraries: ActsAsUrl [permalink solution with better character translation], Unidecoder [Unicode to Ascii transliteration], and StringExtensions [miscellaneous helper methods for the String class].
MIT License
984 stars 158 forks source link

Both asciidoctor and string_ex define String#limit() #192

Closed gpakosz closed 7 years ago

gpakosz commented 8 years ago

asciidoctor just started extending the String class with #limit().

See asciidoctor/core_ext/string/limit.rb and https://github.com/asciidoctor/asciidoctor/issues/1889.

rsl commented 7 years ago

looks like this got fixed on the other side. sorry about delay. new year resolution to be more active here. :D thanks.

gpakosz commented 7 years ago

It seems asciidoctor still has a long way to go before 1.5.6 gets released. In the meantime if you plan a stringex release could you maybe detect #limit() already exists and use it?

rsl commented 7 years ago

i don't think blindly using some other library's potentially random definition of #limit works in this codebase. it's impossible to know what the definition of that method might be. someone could make #limit mean something that doesn't work in StringEx's context/needs. open to pull requests [doesn't mean i except them all, obviously hehe] so let me know if you come up with something that you think could work. thanks.

gpakosz commented 7 years ago

Alright.

In fact could stringex not define String#limit() in the first place? As far as I can tell, this is an implementation detail

rsl commented 7 years ago

that would break anyone who's actually using it so i don't think that's a great solution.