From tmtxpstuff@consking.com Wed Aug 9 15:03:10 2006 From: marios To: textmate@lists.macromates.com Subject: Re: [TxMt] drag commands Date: Wed, 09 Aug 2006 18:02:58 +0300 Message-ID: <44D9F922.5070902@consking.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5685108851654250663==" --===============5685108851654250663== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Torsten Becker wrote: > marios wrote: >> I have the following drag command for zip files to be inserted as >> snippet: >> >> echo -n "> title=\"\${2:"$TM_DROPPED_FILE"}\">\${3:"$TM_DROPPED_FILE"}" >> >> This will insert a download snippet for a default URL on a live server. >> >> However, I would like to strip the path somehow from the variable. >> >> >> Does anyone know how to do this,through a substitution reg ex maybe ? > > ruby can do this for you: > > echo -n " title=\"\${2:`ruby -e 'print > ENV['\''TM_DROPPED_FILE'\''].gsub(/^(.*\/)/, > String.new)'`}\">\${3:\$2}" > I tried the above, but String.new outputs nil instead. (My SupportFolder is updated through subversion) regards, marios --===============5685108851654250663==--