To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / lib / redmine / core_ext / string.rb @ 1298:4f746d8966dd

History | View | Annotate | Download (374 Bytes)

1
require File.dirname(__FILE__) + '/string/conversions'
2
require File.dirname(__FILE__) + '/string/inflections'
3

    
4
class String #:nodoc:
5
  include Redmine::CoreExtensions::String::Conversions
6
  include Redmine::CoreExtensions::String::Inflections
7

    
8
  def is_binary_data?
9
    ( self.count( "^ -~", "^\r\n" ).fdiv(self.size) > 0.3 || self.index( "\x00" ) ) unless empty?
10
  end
11
end