diff options
author | hut <hut@lavabit.com> | 2009-06-15 21:26:20 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2009-06-15 21:26:20 +0200 |
commit | 0926af9fd100c4196d4ae51a5840020094526b69 (patch) | |
tree | 9825909696cc01b8cb7ed8ee1bc2287c00beeb7d /data/types.rb | |
parent | ae16120aebf58a79c804f8be75174a6470f1a9b5 (diff) | |
download | ranger-0926af9fd100c4196d4ae51a5840020094526b69.tar.gz |
reset filetype association system
Diffstat (limited to 'data/types.rb')
-rw-r--r-- | data/types.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/data/types.rb b/data/types.rb index d6e00a09..f1e3d24e 100644 --- a/data/types.rb +++ b/data/types.rb @@ -1,19 +1,20 @@ 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? + + ## first look at the basename case @basename when 'Makefile' - log "i use make" use.make + when /^[Rr]akefile(.rb)?$/ use.rake end + + ## then look at the mime-type case @mimetype when /^video/ use.mplayer_detached @@ -38,18 +39,20 @@ class Directory::Entry when 'text/html', 'application/x-shockwave-flash' use.firefox - end + + ## then at the extension case @ext when 'swc', 'smc' use.zsnes when 'rar', 'zip', 'tar', 'gz', '7z', 'jar', 'bz', 'bz2' use.aunpack - end + + ## is it executable? if executable? use.vi_or_run end @@ -57,5 +60,7 @@ class Directory::Entry ## otherwise use vi use.vi end + + INTERPRETED_LANGUAGES = %w[haskell perl python ruby sh] end |