mirror of
				https://github.com/redmine/redmine.git
				synced 2025-10-31 10:25:55 +01:00 
			
		
		
		
	git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9528 e93f8b46-1217-0410-a6f0-8f06a7374b81
		
			
				
	
	
		
			12 lines
		
	
	
		
			374 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			374 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| 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
 |