On 21 Dec 2005, at 17:30, Charilaos Skiadas wrote:
Dave On Dec 21, 2005, at 10:11 AM, Dave Baldwin wrote:
- I would like the run script command (command R) to save all
files and run my designated 'main' file - this may not be the one that is currently open. This is what Xcode does and while I could write a macro to do this it would seem a generally useful thing to have built in.
You can probably do what we do in the LaTeX bundle. In there, you can define a project specific environment variable, in that case TM_LATEX_MASTER, and have that be used if it is set, via a command like: M=${TM_LATEX_MASTER:=$TM_FILEPATH} and then using "$M" whenever you need to. Take a look at the "Typeset & View (PDF)" command in the LaTeX bundle. As for saving all files in project, you can set that as the "Save:" option in the command editing window. As I understand it, it is not currently set up because this way you an execute a Ruby script even if it is not saved, by saving it in a temporary directory, as the current command does. So I would consider this a separate command, preferably associated to cmd-B (for build).
- When I run script (command R) in my 'main' ruby file I get an
error window popping up, but when I click on any of the hyper links a blank file is opened, rather the one identified in the error line. The file in error is in the project.
I believe that we do that also in the LaTeX bundle, same command. Not sure how we accomplish it though. I think there is a script doing that, but I haven't looked into it too closely.
I have looked in the Ruby bundle, but what is going on is a mystery to me.
What part of the Ruby bundle are you referring to?
I was looking at the tmruby.rb file.
I have spend some time looking at the Run script and the tmruby file and basically understand what they are doing. I don't think it is too hard to get the behaviour I want, and having a TM_MAIN_RUBY or some such variable as you have for Latex looks like the best way, particularly as this can be bound to a project. Thanks for this tip.
My main frustration is not being able to click through on reported errors. While I understand what the script is doing, I don't understand why the error produces different results when run from the terminal or within TextMate.
From the terminal I get:
/Users/dave/Chips/DES/mediaUI/Classes/ui.rb:63:in `initialize': undefined method `readConfigW' for #<UI:0x11087cc @allowTransition=false, @keysFromFile=false> (NoMethodError) from /Users/dave/Chips/DES/mediaUI/Classes/os_gl.rb:32:in `initialize' from start.rb:34
but from within TextMate the HTML looks like: <p id="exception"><strong>NoMethodError</strong>: undefined method `readConfigW' for #<UI:0x35b84c @allowTransition=false, @keysFromFile=false></p> <blockquote><table border="0" cellspacing="0" cellpadding="0"> <tr><td><a class="near" title="in ./Classes/ui.rb" href="txmt://open? url=file://./Classes/ui.rb&line=63">method initialize</a></td><td>in <strong>ui.rb</strong> at line 63</td></tr><tr><td><a class="near" title="in ./Classes/os_gl.rb" href="txmt://open?url=file://./Classes/ os_gl.rb&line=32">method initialize</a></td><td>in <strong>os_gl.rb</ strong> at line 32</td></tr><tr><td><a class="near" title="in /Users/ dave/Chips/DES/mediaUI/start.rb" href="txmt://open?url=file:///Users/ dave/Chips/DES/mediaUI/start.rb&line=34"><em>at top level</em></a></ td><td>in <strong>start.rb</strong> at line 34</td></tr></table></ blockquote>
The two differences are
1. In 'top level' line in terminal just includes the file name while in the HTML it has the full path name in the url (and I can click through here).
2. The lower level lines in terminal have the fully qualified path name, but the HTML is relative to the top level file (and clicking through just opens an empty window
Maybe the cause is the fork?
One fix would be to combine the top level path with the lower level paths when making the url to make it an absolute path.
Dave.
Thanks for any help,
Dave.
Haris
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate