diff options
author | hut <hut@lavabit.com> | 2009-06-18 01:56:01 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2009-06-18 01:56:01 +0200 |
commit | 9097b81b515f05c5e0e3eb76b6c51f2f374dc23a (patch) | |
tree | 0d1495c516544dc4f2a55024fc557b5e862d9fb9 /data/apps.rb | |
parent | c747b1f7d103018291d83a03eec29a9ad3e54ed6 (diff) | |
download | ranger-9097b81b515f05c5e0e3eb76b6c51f2f374dc23a.tar.gz |
more comments
Diffstat (limited to 'data/apps.rb')
-rw-r--r-- | data/apps.rb | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/data/apps.rb b/data/apps.rb index 9c300f56..18856262 100644 --- a/data/apps.rb +++ b/data/apps.rb @@ -1,4 +1,42 @@ +## This file defines programs, and HOW those +## programs are run. +## +## Look at the definition of "totem" for a +## fully documented example. + + module Application + + ## def totem(files) starts the definition of totem + def totem(files) + ## this is the `case' statement. + ## it looks up the mode and does different + ## things depending on the mode. + case files.mode + + ## if the mode is 0 (default) + when 0 + ## start totem in fullscreen + "totem --fullscreen #{files}" + + ## if the mode is 1 + when 1 + ## start totem normally + "totem #{files}" + end + + ## the mode is a number which you type in + ## between two r's. for example, press: + ## r1r + ## to run the file in mode 1. + ## there are shortcuts: the key l runs in mode 0, + ## and L in mode 1. + + ## the variable `files' is of a type RunContext, + ## see ranger/code/runcontext.rb for details. + end + + def aunpack(files) case files.mode when 0; "aunpack #{files}" @@ -10,13 +48,6 @@ module Application "gedit #{files}" end - def totem(files) - case files.mode - when 0; "totem --fullscreen #{files}" - when 1; "totem #{files}" - end - end - def mplayer(files) case files.mode when 0; "mplayer -fs -sid 0 #{files}" |