is there a coffeescript auto compile / file watcher for windows? - coffeescript

I'd like to play around with integrating coffeescript into my dev process. But as I see it, I'll have to make a bat file that iterates a set of coffee files and spits out js files. Every time I write a bat file, useful as they may be, I ask myself: is there a better way?
Which makes me wonder: is there an app of some sort for Windows that will watch a directory or a file and spit out one/many js files when a coffee file is saved? I'm thinking of building one but don't want to reinvent the wheel. I looked around and found things that were similar but nothing that elevated it beyond "run this command line" on Windows.
Edit: already marked an answer, but looking at this 10 months later the answer is: grunt. Because it'll do a lot more than just auto-compile your coffeescript and you'll probably need to do more than just that to get your app going.

coffee --watch -o lib -c src
where src is a directory containing your coffee files, and lib is your JavaScript output directory.

See update at bottom of post.
I was hunting for the same thing the other day and came across this: https://github.com/danenania/CoffeePy
It's a simple python script that uses PyV8 to run coffee-script.js.
It doesn't do anything fancy, just watches a folder recursively, and compiles any .coffee files whenever they're changed. It doesn't even have a bare option. These things could be very easily added though!
Edit:
I forked the script and added --bare and --output options.
You can get it here: https://github.com/johtso/CoffeePy

Personally, I prefer using build tools like grunt.js / yeoman or brunch for that purpose.
grunt.js
&
grunt coffee

Mindscape Workbench has a built in compiler/editor for VS 2010. Haven't tried it yet, but it looks like it'd be even better than a watcher/compiler. Scott Hanselman has a post about it here:
http://www.hanselman.com/blog/CoffeeScriptSassAndLESSSupportForVisualStudioAndASPNETWithTheMindscapeWebWorkbench.aspx

I think there is a simplier way just using -w option of coffeescript compiler
coffee -c -w *.coffee
This will compile all coffee files under the folder you are (put more file pathes if needed) each time you change one.

Another possibility: WebStorm 6. They've added a built in file-watcher for a variety of next-gen languages like SASS and Coffescript.

If you want a different way of doing it, this might help:
http://jashkenas.github.com/coffee-script/#scripts
If you include the coffeescript compiler on your page, you can include files with a "text/coffeescript" type and they will get compiled client-side.
Word of warning: Obviously, client-side compilation is not for something serious, but its completely fine for a small project/quick development. It would then be trivial to compile them on the server and change the MIME-type and filename when something a bit quicker is necessary.

CoffeeScript-dotnet does what you want, but it is a command line tool.
Command line tool for compiling CoffeeScript. Includes a file system watcher to automatically recompile CoffeeScripts when they change. Roughly equivalent to the coffee-script node package for linux / mac.

Here is the best way to do it:
Say your work is in "my-project-path" folder.
Go to the parent folder of "my-project-path"
Start a terminal and type coffee -o my-project-path -cw my-project-path
This line will watch and compile anything name as "*.coffee" in "my-project-path" folder, even if it is in "my-project-path/scripts/core" or "my-project-path/test/core".The js file will locate in the save folder as the .coffee file.

Related

Linking Allegro 5 with Eclipse on Ubuntu

I've been struggling for a couple of hours now trying to link Allegro 5 to Eclipse on Ubuntu. And yes, I've been searching for it but I must be missing something really simple and you guys will surely find it right away, so please help me out...
I create the project like this:
And when I try to link any library (example below)
I get this error when compiling my program!
And here is a pic of the relevant folders with the correctly compiled libraries:
EDIT:
If you are struggling with this as well, all I had to do was very simple, you just need to add these to you libraries:
here is the list so you can just copy and paste it:
allegro
allegro_acodec
allegro_audio
allegro_color
allegro_dialog
allegro_font
allegro_image
allegro_main
allegro_memfile
allegro_physfs
allegro_primitives
allegro_ttf
You should get out of eclipse and just use the command line until you have this sorted. Eclipse is just a complex way to obfuscating the command line.
To link a .so, you need:
-LpathToLibrary
-lnameOfLibrary, with 'lib' and '.so' stripped off.
If your library is sitting in /usr/lib, which is suggested by what you are trying, then you don't need the -L at all. If the name is 'liballegro5.so', you'll need -lallegro5.
I recommend:
find /usr -name liballegro.so -print
if the answer is '/usr/lib/liballegro.so', then all you need is -lallegro.
If the answer is /SOMETHINGELSE/liballegro.so, then you need -L/SOMETHINGELSE/.
If you don't find liballegro, then you need to figure out if it's actually liballegro5.so.
You can also stop using -L and -l and just put the entire path of the .so in there.

erl does not autocomplete code loaded using -pa

This is my first couple of hours of Erlang experimentation. So be gentle, please.
I checked out a project (https://github.com/wooga/eredis)
Installed rebar
Compiled the modules (beam files went into ebin)
Fired up erl -pa ./ebin
Typed eredi - and hit tab
At this point nothing was displayed, whereas all other modules were auto-completed. So I (reasonably) assumed that the module beam files hadn't been loaded - lead me to all sorts of fruitless investigations of paths, etc.
But the code had been loaded, it just wasn't being auto-completed.
1> {ok,C} = eredis:start_link().
{ok,<0.35.0>}
2> eredis:q(C,["SET","foo","bar"]).
{ok,<<"OK">>}
3> eredis:q(C,["GET","foo"]).
{ok,<<"bar">>}
Great, but I'd really like auto-complete to work. Is there a way to get it working? In Zsh for example, I have to execute rehash for new path items to show up - do I need to execute something similar here?
You need to make sure the module is loaded in the shell, adding it to the path with -pa just tells the VM where to look for modules when trying to load them.
There are several ways of loading a module
Call a function in the module that should be loaded (so after doing the eredis:start_link() call you would be able to tab-complete eredis)
Explicitly load the module with l(Module)
Programmatically: code:load_file(Module)
Load all erlang modules in path is very useful!

How to generate phpDoc documentation for a specific folder in Netbeans IDE?

Due to the fact that we need to integrate the Zend Framework on our project root, and that generating that documentation will be useless and take long time, I would like to generate documentation for all files inside application folder only.
Does anyone know how I can generate documentation for a specific project folder, trough Netbeans 7.0 interface?
Update:
The best I've found so far was to:
Open the terminal window from netbeans, and type:
sudo phpdoc -d public_html/yoursite.dev/application/ -t public_html/yoursite.dev/docs/
Update 2
Let's suppose our Zend library is inside projectrootname/library/Zend we also can try, by going to: Tools > Options > Php > PhpDoc and place the following:
/usr/bin/phpdoc -i library/Zend/ -o HTML:frames:earthli
At least for me, that doesn't seem to work, because, when I try to generate the documentation, I get permission error issues displayed on the output window.
Thanks
The -d/--directory option [1] should be used to highlight the most high-level code directory that you want phpDocumentor to start reading from. If your Zend folder is at or above the level of your application directory, then just using --directory /path/to/application should help you document only your application code.
If your Zend folder is somewhere inside your application (e.g. in your app's ./lib folder), then you can use the -i/--ignore option [2] to tell phpDocumentor about any directories that it will see but should ignore, --ignore *zend*. Just be aware that formatting your ignore value can be tricky, so see the examples in the manual. Also, be aware that as phpDocumentor runs, you will see these ignored folders and files being listed in the output... phpDocumentor "ignores" them by not generating docs for those files. It does, however, still need to parse them, in case those objects are referenced in files that do get documented.
[1] -- http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.command-line.directory
[2] -- http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.command-line.ignore

how to run doctrine.php in command prompt

I'm trying to use Doctrine with Zend, I have copied the doctrine.php and doctrine file in the script folder in the Source Files folder.
However when I type in command prompt following command: "php doctrine.php" by entering in the scripts folder, Nothing happens, there is no error printed, the cursor just goes to next line. Can someone please tell me how can I use doctrine.php.
When using Guilherme's integration suite, you need to do a couple of things.
Download / clone the Doctrine Common, DBAL and ORM libraries and make sure they're available in your include path. For this, I usually just copy the lib/Doctrine code from each into my project's library folder. If using git, you can add them as subtree splits but that's a topic for another time ;-)
You also need the Symfony Console and Yaml namespaces. Again, it's easiest to place them in your project's library folder under library/Symfony/Component/Console and library/Symfony/Component/Yaml. These usually come as submodule dependencies in the Doctrine libraries but you can also get them from their github pages
Console
Yaml
Remove the bootstrap('Config') call from the doctrine.php script. Don't know what Guilherme was thinking there :-)
That's it, from there it should work as expected.

How do I build project files and packages for Borland C++ Builder 5 from the command line?

How do I build Borland C++ project files (bpr) and package files (bpk) from the command line? Project groups (bpg) are apparently make files and can be compile with make. But bpks and bprs are xml based and the Export to Makefile won't compile with make.
If I put a project in a bpg, make can't seem to find any of the files specified in the bpg since they all appear to be relative references. I changed the references to absolutes and make reports:
Fatal: Unable to open makefile
You don't need to directly compile a bpr. Just create a bpk which just includes that single bpr, and you can use make to compile it.
"c:\program files\borland\cbuilder5\bin\make" -B -s -fabc.bpg
If you also have other borland compilers installed, do not call the make.exe from the other compiler.
EDIT: execute the make command in the directory where the bpg and bpr is located.
Using bpr2mak and make works for me just fine, so as Roger said, you need to give details on what errors you're getting. BPK files can also be processed with bpr2mak. I'm using this method to compile a large project with many components, without difficulties.
Perhaps you could give some more information on 'won't compile'.
I.e. What error messages are you getting.
One frequent problem the come up with make is addressed at the following
http://www.delphigroups.info/3/8/36427.html