Skip to content

Commit

Permalink
Fixed compatibility with Ruby 1.8.7 by not interning empty strings.
Browse files Browse the repository at this point in the history
What was happening was *kinds was creating an array resembling [nil] and so kinds = [:latin] was not being evaluated as the array was not .empty?
What I've done is told the array to compact before checking emptiness and also before looping. This resolves the issue.
  • Loading branch information
parndt authored and norman committed Mar 12, 2012
1 parent 6ef5d16 commit 74fb4ae
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/babosa/identifier.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def empty?
# @param *args <Symbol> # @param *args <Symbol>
# @return String # @return String
def transliterate!(*kinds) def transliterate!(*kinds)
kinds.compact!
kinds = [:latin] if kinds.empty? kinds = [:latin] if kinds.empty?
kinds.each do |kind| kinds.each do |kind|
transliterator = Transliterator.get(kind).instance transliterator = Transliterator.get(kind).instance
Expand Down

0 comments on commit 74fb4ae

Please sign in to comment.