Class: String

Inherits:
Object
  • Object
show all
Includes:
Diffable, Redmine::CoreExtensions::String::Conversions, Redmine::CoreExtensions::String::Inflections
Defined in:
lib/redmine/core_ext/string.rb,
lib/diff.rb

Overview

:nodoc:

Since:

  • 0.5.1

Direct Known Subclasses

RedCloth3, Redmine::Scm::Adapters::Branch

Instance Method Summary collapse

Methods included from Redmine::CoreExtensions::String::Inflections

#with_leading_slash

Methods included from Redmine::CoreExtensions::String::Conversions

#to_hours

Methods included from Diffable

#diff, #patch, #replacenextlarger, #reverse_hash

Instance Method Details

#is_binary_data?Boolean

Deprecated.

Removed at 3.4.0

Returns:

  • (Boolean)

Since:

  • 2.0.0



8
9
10
# File 'lib/redmine/core_ext/string.rb', line 8

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