Module: Redmine::Scm::Adapters::ScmData

Defined in:
lib/redmine/scm/adapters/abstract_adapter.rb

Class Method Summary collapse

Class Method Details

.binary?(data) ⇒ Boolean

Returns:

  • (Boolean)

431
432
433
434
435
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 431

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