Dear Matt,
I totally agree with Jamie, the best way is to write a Ruby module
with your commands, factorize them and include this file in your TM
command. You can find an example in my Graffiti bundle:
#!/usr/bin/env ruby
require ENV['TM_BUNDLE_SUPPORT'] + '/graffiti.rb'
include Graffiti
findDefinitionsOfCurrentWord()
The command does its processing and them calls a formatting method of
the Graffiti Ruby module. Very easy to put in place and then very
handy to change and edit your TM commands.
Hope this helps.
Best regards,
Mathieu
___________________________________________
Mathieu Godart
Skype: mathieu_godart
MSN: [email protected]
ASIC Integration Manager
Coolsand Technologies
___________________________________________
Le 22 mai 09 à 16:19, [email protected] a écrit :
We were struggling with doing exactly this, and we ended up writing
some Ruby modules and classes to abstract this process because we
couldn't find any obvious way to chain or build commands together.
So, now all our individual commands are in our Ruby module and our
TextMate commands call one or more of those Ruby methods to build
out a more complex command. I don't know that this is the only way
to do it, but it's working great for us and allows us to develop
commands outside of TextMate's bundle editor first and it also
avoids the problem of TextMate being stubborn about reloading
bundles sometime. We've also developed a folder of "templates" that
is separate and allows some of our less technical team members to
update the copy in those templates.
Cheers,
Jamie
On Wed, May 20, 2009 at 7:10 PM, Matt Handler
([email protected]) wrote:
>
does anyone know if there's a way to invoke another textmate command
from within a textmate command?
for example, i have a formatted output command that writes info to a
clean html window... i want to have a compile command that gathers
information, compiles, and then passes that resulting messages to
the to the formatted output–the goal being to avoid copying my
formatted output to every command that needs to output to an html
window.
i assume i can invoke the formatted output command using osascript
and passing the gathered information via 'defaults write com...',
but this seems like a sloppy fix
ideally i could just do something like: `echo "$gatheredInfoArray" |
$TM_BUNDLE_DIRECTORY/MyBundle.tmBundle/formattedOutput.sh`
any ideas??
thanks a bunch,
-matt
> _______________________________________________
> textmate-dev mailing list
> [email protected]
> http://lists.macromates.com/listinfo/textmate-dev
>
>
> _______________________________________________
textmate-dev mailing list
[email protected]
http://lists.macromates.com/listinfo/textmate-dev
_______________________________________________
textmate-dev mailing list
[email protected]
http://lists.macromates.com/listinfo/textmate-dev