Coffeescript setup

Hello,

Here is what I did to get a good coffescript setup for me...........

#### after coffeescript installation ####

In Rubymine got to plugins, get coffeebrew.....

I wanted to be able to compile and output my coffeescript to corresponding js files, and I wanted to be able to run the coffeescript files:

Go to external tools and add: "Coffee_My_Tool_Name"; program: coffee; Paramters: -co public/javascripts app/scripts/$FileName$; Working Directory: $ProjectFileDir$

This allow me to compile and output the coffeescipt file to a corresponding js file when I want.....when I set watch on the whole directory....funny things happened in the terminal....no errors....files would compile on save.....but no output over the top of existing js files.......

I then went to Preferences>Keymap>Other and found my tool addition.....and set the key as ctrl+F10

Now to run:
Repeat above.....when you get to Parameters....use $FileName$ - and in Working Directory: $FileDir$......

Save tool and then go to Keymap and use F10....

This allows me to stack my js file below my coffeescript file (Drag the js editor file window down and dock it half-way)......now I can edit my coffeescript.....press ctrl+F10 to compile and watch changes in the js file.....and then press F10 to watch my script run.

Rubymine 3.1 and coffeescript 1.1.1

The original idea for this set up came from here: http://devblog.aoteastudios.com/ - I just took out the watch and added a run tool........I had problems getting the watch to work. When I added --watch I was able to get coffee to compile my scripts, but it wouldn't always output them.

Anybody else with tips and tricks from their own coffeescript setup...please reply.

2 comments
Comment actions Permalink

Hello Roy,

Thanks a lot for your tips and tricks on the coffescript. Please note that coffescript plugin is going to become first class citizen of RubyMine in next public version.

Regards,
OIeg

0
Comment actions Permalink

Yes,
I saw that on the blog or roadmap somewhere. But I wanted something temporarily while I'm playing with rails 3.1 and learning coffeescript, and how all of the asset pipeline will work. I'm looking forward to when you integrate it into rubymine though.

0

Please sign in to leave a comment.