view lib/redmine/core_ext/string.rb @ 1376:6ba24edae331 luisf

Moved the code in bibliography.js and order_authorships.js from the js files to the view files - so that I can use ERB to build the AJAX call paths - otherwise I woudl have problems with redmine installations in subfolders.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Fri, 30 Aug 2013 17:33:05 +0100
parents 433d4f72a19b
children
line wrap: on
line source
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