The If Works This dirt was a building before

PackR

Helium: a package server for JavaScript

Last week, my former employer theOTHERmedia open-sourced the last project I worked on there: Helium. It’s a web application that lets you deploy JavaScript packages from Git and load them on-demand into any website by including a single script tag. There’s been a lot of innovation in JavaScript deployment recently, and Helium fits a particular [...]

PackR 3.1: improved compression and private variable support

Dean Edwards recently released version 3.1 of Packer, his JavaScript compression tool. You’ll be pleased to know I’ve been keeping up with development, and I’ve just released PackR 3.1. PackR is a Ruby version of Packer that can be used from the command line or within Ruby apps. sudo gem install packr This release improves [...]

Announcing Bluff, plus a few other project updates

I put out a few new software releases over the last few days, and thought I’d gather them into one post rather than lots of little ones. Let’s start with the biggest. Update: for those wishing to contribute bug reports (as failing test cases) and patches, Bluff is hosted on Github. In what can only [...]

PackR won’t touch your $supers

Another quick update: PackR received an update today that means that when you use its :shrink_vars mode, it won’t minify any variables called $super. In Prototype, $super is used to implement inheritance and your class definitions will break if you change its name. I didn’t really want to make PackR inconsistent with Dean’s original, but [...]

PackR gem now available

Update: the gem seems to be up on RubyForge now, so just gem install packr and you’re all set. At the request of Aman Gupta (again!) PackR is now available as a gem. I’ve not got myself all set up on RubyForge yet, but in the meantime you can download the gem from my subversion [...]

PackR, now with class methods

Quick note: at the suggestion of Aman Gupta, PackR now supports Packr.pack, Packr.minify and Packr.pack_file as class methods, so you don’t need to create an instance of PackR before doing anything. Originally, I wanted PackR’s design to mirror the JavaScript version to make maintainance easier, but these methods are a tiny addition so I’m happy [...]

Emulating JavaScript’s String#replace in Ruby

Update: turns out this is a lot easier than the method presented below: see Christoffer Sawicki’s implementation. Consider my method an example of what happens when you’re trying to port features from one language to another and end up looking in all the wrong places for a solution. I know what you’re thinking: we already [...]

Announcing PackR

I’ve no idea who may have done this already, but I certainly coundn’t find anyone who had in five minutes of searching. I’ve written a Ruby port of Dean Edwards’ Packer, and released it as a Rails plugin. It includes a rake task for batch-processing the scripts in your application. Install like so: ruby script/plugin [...]