Source

bbedit_dsl /

Filename Size Date modified Message
1.7 KB
2.1 KB

Helpers for BBEdit users to deal with files with Domain Specific Languages

Right now this is a proof-of-concept with ThoughtBot's Shoulda Domain Specific Language for testing Ruby. (Read more about Shoulda.)

It's an interesting general problem: how do we make it easier to use Domain Specific Languages in BBEdit? The answer? Write some shell script.

BBEdit doesn't have support for being able to add additional features to a language. (I know - I asked Rich!). But some programming languages (like Ruby) do this all the time. Domain Specific Languages and all that jazz.

list_dsl_expressions.py is a proof-of-concept script. At some point in the future I need to update this script with support for user specified expressions (RSpec, another Ruby DSL for example). Also, as a file might contain MULTIPLE DSLs in it (uuggghhh) we need a way to say "Do this file, but only give me certain expressions".

This would make navigating long files (like you have in Ruby on Rails models) much easier, as these can contain multiple things - permissioning, workflow, helper methods, etc... but I, as a user, know that I want to look for only things in the permissioning DSL, for example.

Usage of this script is simple: clone this repository into your BBEdit Scripts folder, and run the script on a Shoulda file.

The script will output a a new window containing 2 lines for every context/fast_context, or should line it finds. The first line will be the expression it found. The second line will be a line compatiable with Open File By Name, including line number.

Again, proof of concept, so I'd be interested to hear everyone's thoughts!