diff options
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 |