summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions
'>5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32
33
34
35
36






























                                                                                        
                                   



                      
class Directory::Entry
	INTERPRETED_LANGUAGES = %w[haskell perl python ruby sh]
	MOVIE_EXTENSIONS = %w[avi mpg mpeg mp4 mp5 ogv ogm wmv mkv flv fid vob div divx]

	def get_handler
		## directories or sockets don't have any handler
		use.no_handler if dir? or socket?

		## at first, look at the mime type
		case @mimetype
		when /^video|audio/
			use.mplayer

		when "application/pdf"
			use.evince

		when /^image/
			use.feh

		when /^(text|application).x-(#{INTERPRETED_LANGUAGES.join('|')})$/
			use.interpreted_language

		end

		## second, look at the extension
		case @ext
		when 'swc', 'smc'
			use.zsnes

		end

		## otherwise use vi
		use.vi
	end
end