From 46ad9bb591d057715fcd63376326336f3339fba7 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 13 Jun 2009 02:33:35 +0200 Subject: cleaning up --- code/runcontext.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'code') diff --git a/code/runcontext.rb b/code/runcontext.rb index 3d9ff457..1e10aa8d 100644 --- a/code/runcontext.rb +++ b/code/runcontext.rb @@ -114,13 +114,26 @@ class RunContext ## rc.paths.map {|x| ~x}.join(' ') ## otherwise: ## ~(rc.paths.first) - def ~() @paths.map {|x| ~x}.join(' ') end + def ~ + if @multi + @paths.map {|x| ~x}.join(' ') + else + ~@paths.first + end + end + + ## escape one (the first) file for direct use in the shell. + ## this is a shortcut for: + ## ~(rc.paths.first) + def one + ~@paths.first + end ## shortcut for _files.size_ def size() @files.size end ## shortcut for _files.first.path_ - def first() @files.first.path end + def first() @files.first end ## shortcut for _files.first.name_ def name() @files.first.name end -- cgit 1.4.1-2-gfad0