24
Feb
12

using coffeescript on windows



If you want to develop with CoffeeScript outside of Rails, here’s one way you could do it:

  • download the coffee.exe executable from CoffeeScript compiler for Windows
  • copy coffee.exe in a folder that is on the PATH
  • create a watchr file, for the ruby gem watchr. This way, everytime you modify the .coffee file, the js file gets recompiled. Here are the contents of my watchr file:
    
    watch("js/application.coffee") do |s|
    	puts "#{Time.now} => Compiling #{s}"
    	system("coffee -c #{s[0]}")
    end
    
  • start watching the file for modifications:
    
    watcher your_watch_file.rb
    
    
    
  • add the include for the resulting JS in your html code and you’re done

Advertisements

0 Responses to “using coffeescript on windows”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Blog Stats

  • 221,294 hits

%d bloggers like this: