On 11. Dec 2006, at 20:29, Chris Thomas wrote:
Yes, yes, sorry, I read Haris's note the other day and was suitably
chastened. It hadn't occurred to me that Ruby wouldn't canonicalize
require paths, although I realize it's a Really Hard Problem when
considering all the edge cases and other platforms.
I guess on *nix Ruby could always cache headers using the inode
number as key!?!
Btw: rather than have bundle developers abide to strict rules about
how to include our support files, we should probably just add the
proper guard code (for multiple inclusions) to each of them.
It would be nice someday to be able to write something like
'require "textmate/progress", though. Would need to move the lib/
support ruby files into a 'textmate' folder and modify RUBYLIB. I
wonder if this can be accomplished without modifying the TM app
binary.
I guess not really (modifying RUBYLIB) as we would need to make it
relative to TM_SUPPORT_PATH (and probably also append to a
potentially already setup RUBYLIB), but currently TM’s shell variable
setup doesn’t support any form of interpolation. I do however plan
for a more sophisticated variable setup system (which is also used
even when bash_init.sh is not sourced, i.e. for shebang scripts/
commands).
On Dec 11, 2006, at 5:46 PM, James Edward Gray II wrote:
IMPORTANT NOTE TO BUNDLE DEVELOPERS: Please, refrain from any
$LOAD_PATH ($:) modifications in bundle support files. I realize
it is a more elegant way to write requires, but it creates bugs in
a load system such as we use for the bundles. The problem is that
support libraries often load other libraries and $LOAD_PATH
hacking makes the relative paths look like new files, so Ruby
loads the library more than once. This often triggers
redefinition warnings. When those warnings end up in the output,
as they did with Diff commands before this fix, you break the
document format. Stick to absolute path requires and we won't
have this problem anymore. Thank you.
Changed:
U trunk/Bundles/Subversion.tmbundle/Support/svn_commit.rb
U trunk/Bundles/Subversion.tmbundle/Support/svn_diff.rb
U trunk/Support/lib/progress.rb
_______________________________________________
textmate-dev mailing list
[email protected]
http://lists.macromates.com/mailman/listinfo/textmate-dev
_______________________________________________
textmate-dev mailing list
[email protected]
http://lists.macromates.com/mailman/listinfo/textmate-dev