I've been experimenting with some ideas for enhancing editing of code, particularly Ruby and JavaScript, but this query is more general. I'm writing scripts in Ruby and quite happy with ruby18 if it has to be that. Can I get scope information from within a script? I realise that a scope or list of scopes can act as a kind of guard for whether a script is activated. But once a script is running can it take a look at the results of the various scope definitions applied to the current code file?