[SVN] r6454 (Ruby)

James.Strachan james.strachan at gmail.com
Thu Jan 18 14:39:58 UTC 2007



James.Strachan wrote:
> 
> 
> James.Strachan wrote:
>> 
>> It'd be great if it'd work inside, say, Rails controllers/models too
>> rather than self contained ruby scripts. I wonder if the user is in a
>> Rails project we could switch the 'ruby -I' stuff with 'script/console'
>> (or something like that - maybe a require 'config/boot' or something) so
>> that working on a rails project it would boot up the various rails
>> plugins so that we'd get lovely completion inside controllers & models?
>> Will noodle around and see if I can figure it out...
>> 
> 
> I've reached the end of my rcodetools/ruby knowledge unfortunately - but I
> did figure out how to boot up rails config/environment if it was present
> and pass it into rcodetools which avoids the error message you get with
> undefined constants like ActionController or ActiveRecord, though when
> this is added it seems to stop finding any matches at all :) 
> 
> I'm attaching it here in case it helps anyone else figure it out...
> http://www.nabble.com/file/5703/patch.txt patch.txt 
> 

Actually this patch does work when trying completion at the class level!
e.g. inside an ActiveRecord::Base you get completion of the various
validates_* or act_as_* methods etc. YAY!

Though it doesn't seem to find any completions inside a method declaration
(with or without the self. prefix). This appears to be some kind of
limitations with rcodetools rather than the TextMate integration (as with
further testing, even a vanilla ruby class, you can't seem to access
instance methods of a class from inside a method declaration). Even so this
is an awesome start!

James

-- 
View this message in context: http://www.nabble.com/r6454-%28Ruby%29-tf3018266.html#a8431866
Sent from the textmate-dev mailing list archive at Nabble.com.




More information about the textmate-dev mailing list