Sha256: 76839809d4aee4b94884d06099b9b6ce2567b1519057117bbbd85d47a76a40e8

Contents?: true

Size: 374 Bytes

Versions: 34

Compression:

Stored size: 374 Bytes

Contents

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

class String #:nodoc:
  include Redmine::CoreExtensions::String::Conversions
  include Redmine::CoreExtensions::String::Inflections

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

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
redmine_extensions-0.0.39 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.0.38 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.0.37 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.1.11 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.1.10 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.0.36 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.0.34 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.1.09 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.1.07 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.1.06 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.1.05 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.1.04 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.1.03 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.0.33 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.1.02 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.1.01 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.0.29 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.0.28 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.0.27 spec/redmine/lib/redmine/core_ext/string.rb
redmine_extensions-0.0.24 spec/redmine/lib/redmine/core_ext/string.rb