SproutCore TextMate Bundle

I just published the very beginnings of a new TextMate bundle for SproutCore written by our very own Joshua Dickens.  Way to go Josh!

Right now the bundle has only a few helper commands but its open source, so add more and we’ll take em.  I’d LOVE to see some inline help hookups here. :-)

Here is what you get right now:

  1. .ob [tab] => [currentText]Observer: function() { }.observes(’currentText’,’
  2. .prop [tab] =>  text: function () { }.property(’text’,'optional2′),
  3. super [tab] => arguments.callee.base.apply(this, arguments)

The last one is particularly helpful since SproutCore implements calling your superclass in the way you can in other languages.  The only catch is you have to use this long, magical incantation above  (arguments.callee.base.apply(this, arguments)).  If you don’t like to remember that, just install the tmbundle, type super[tab], and TextMate will remember for you.

How to Install

Just do the following on the command line in your terminal:

cd ~/Library/Application\ Support/TextMate/Bundles
curl http://github.com/sproutit/sproutcore-tmbundle/tarball/master -o sproutcore-tmbundle.tar
tar -x sproutcore-tmbundle.tar
mv sproutcore-tmbundle SproutCore.tmbundle
rm sproutcore-tmbundle.tar

If you are on Git, there is an even better way.  Do this from your terminal:
w
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/sproutit/sproutcore-tmbundle.git SproutCore.tmbundle

Now, when you want to update the bundle to get new features, just do:

cd ~/Library/Application\ Support/TextMate/Bundles/SproutCore.tmbundle
git pull

After you install the bundle (using either method), you will need to restart TextMate…

UPDATE:  August suggests that you can also just choose Bundles -> Bundle Editor -> Reload Bundles so you don’t need to restart TextMate.

 

6 Responses to “SproutCore TextMate Bundle”

  1. you could write a small bash script for keeping your git checked out bundles up to date:

    #/bin/sh
    cd ~/Library/Application\ Support/TextMate/Bundles
    for f in `ls`
    do
    if [ -d $f ]
    then
    if [ -d $f/.git ]
    then
    echo “Updating $f …”
    cd $f
    git pull
    cd ..
    echo
    fi
    fi
    done

    osascript -e ‘tell app “TextMate” to reload bundles’


  2. I had trouble with this, not sure why, but I had to pull down and extract the following instead:http://github.com/tarballs/sproutit-sproutcore-tmbundle-70873e84c75e87a927b29d0cb5efef6ee90cc9fc.tar.gz -o sproutcore-tmbundle.tar.gz


  3. [...] haven’t done much with Sproutcore yet, but it does already have its own TextMate bundle which provides a few tab-completion [...]


  4. I get this error validating JavaScript

    dyld: Symbol not found: __ZN3KJS14JSGlobalObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectE Referenced from: /Users/zzzz/Library/Application Support/TextMate/Bundles/SproutCore.tmbundle/Support/bin/jsc Expected in: /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore
    JavaScript Lint


  5. hey angeldm — that’s an issue I haven’t resolved yet. I’m trying to include a custom build of jsc, the WebKit javascriptcore commandline shell, but it’s currently compiled against my local machine, it seems. I’m pretty clueless when it comes to xcode & the like, so it might take me some time to figure out the right approach. Keep checking or subscribe to the commit log on github so you can find out if I get it working reliably!


  6. Angeldm — if you get a chance, try pulling the latest bundle from the repo; I made several changes; here’s hoping they work


Discussion Area - Leave a Comment