Skip to content

Commit

Permalink
Revert "We no longer support 1.9.3" turns out 2.0.0 doesn't have scru…
Browse files Browse the repository at this point in the history
…b either

This reverts commit 6ffd6c3.
  • Loading branch information
JoshCheek committed Nov 19, 2016
1 parent 41fa33b commit 065d0e2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/seeing_is_believing/event_stream/consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@ def self.fix_encoding(str)
rescue EncodingError
str = str.force_encoding(Encoding::UTF_8)
end
str.scrub '�'
return str.scrub('�') if str.respond_to? :scrub
# basically reimplement scrub, b/c it's not implemented on 1.9.3
str.each_char.inject("") do |new_str, char|
if char.valid_encoding?
new_str << char
else
new_str << '�'
end
end
end

def initialize(streams)
Expand Down

0 comments on commit 065d0e2

Please sign in to comment.