Unfortunately, this wasn't a very productive day since I'm feeling a bit sick. I still somehow managed to finish everything I was planning to do, though - the research system is now finished. :) Not sure, what I'll be working on next, but I'll definitely figure it out. There are tons of things to do, including art which I'm delaying as usual. :)
Yesterday's update can be found here.
In a case of any questions or suggestions, don't hesitate to contact me here or on twitter. ;)
For more updates, you should follow my twitter account - @PeterLauris and the account of Crystal Kingdom - @CrystalKingdom_.
Implementing the require_tree was fairly trivial since everything else was basically in place. I was able to make use of filepath.Walk to just walk the files and then run the Javascript processor over the files, one by one.
There are still a few issues with the implementation. For instance, using a require_tree .. is likely going to crash. The easy solution would be to disallow going up directories. A perhaps better solution would be to checksum the files, store that in a hash, and only process files that don't match a processed checksum. This is going to be slower, but should provide a better experience when using it.
Other things that still need to be done are:
Other things that might be interesting. Getting the baseline application layout from ember-rails, getting the uncompressed jQuery, HTMLBars, & Ember.js, and then loading them from application.js with appropriate requires; everything seems to work as expected. It'll be faster, to include these normally, but it's a slightly interesting point of reference that it processed 2020288 bytes in about 20ms. Honestly, this was the end goal I was really hoping to accomplish with this project. I was really wanting to play with Ember from a non-Rails application (specifically in Go) that had Sprockets-like autoloading of Javascript files for quick iterations. The project will likely be going on Github in the next few days after I write some documentation & tests for it.
I renamed some variables to help me remember what type they are. (No strict typing PHP, yayyy) Got a concert tonight, The Antlers in Melbourne, so not enough time today to get real work done!