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)


439
440
441
442
443
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 439

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