When testing if a blob is indexable, check size first

Otherwise, charlock_holmes will allocate another large binary
buffer for testing the encoding, which is a problem if the binary
blob is many hundreds of MB large. It'll just fail and crash ruby.
This commit is contained in:
Scott J. Goldman
2012-08-31 22:47:19 -07:00
parent 6ec907a915
commit e415a1351b
3 changed files with 11 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ Gem::Specification.new do |s|
s.add_dependency 'escape_utils', '~> 0.2.3'
s.add_dependency 'mime-types', '~> 1.19'
s.add_dependency 'pygments.rb', '>= 0.2.13'
s.add_development_dependency 'mocha'
s.add_development_dependency 'json'
s.add_development_dependency 'rake'
s.add_development_dependency 'yajl-ruby'