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

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

Overview

Since:

  • 3.4.0

Class Method Summary collapse

Class Method Details

.binary?(data) ⇒ Boolean

Returns:

  • (Boolean)


427
428
429
430
431
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 427

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