gregjacobs/Autolinker.js — pull request #26 by busticated (2014-05-03 00:46:59+00:00)
Title: Add support for amd & commonjs style module loaders...

First, a disclaimer: I'm not as obnoxious as this PR might imply. I swear!

I started off thinking: _Hey this is an awesome lib! if only it worked in node & w/ requirejs / amd-style loaders..._ and before I knew it I was running roughshod across your code like polar bear in a taco bell.

So, file this all under: Experiment. Take or leave any / all of it. I'm also happy to rework as needed.

Here's what I've gone done:

1. Migrated build & test tooling over to node / grunt. The goal being to make things more accessible to js devs. Grunt, Gulp, Jake, Brunch - [I don't really care](https://gist.github.com/callumacrae/9231589). I went w/ Grunt just b/c it's still the most popular over there.

2. Added a UMD wrapper to `src/Autolinker.js` and in the process in-lined the matcher regex. This is the moment the bear, after draining the soda machine, discovered an entire fridge filled with taco meat crumbs. Bears are no good with door handles so, yeah.

3. Upgraded Jasmine to v2, sourced from npm. Removed a bunch more files. F***it i'm a bear.

This gets me up and running on my end (well, less some tweaking to sensibly accommodate line-breaks mid-link). You can play with things by pulling this branch down, [installing node](http://nodejs.org/), and then:

`npm install && npm test` <-- install deps and run tests in phantomjs

`grunt serve` <-- start local web server - to run tests visit http://0.0.0.0:3000/tests

`grunt build` <-- build /dist files

`grunt test` <-- run tests in phantomjs (npm test is just an alias for this)

There's still some stuff I'd like to help with if you see any value in it:

* add support for testing across all environments: browser/global, browser/amd, node/cjs (aim being that `npm test` runs all of these and reports status accordingly)

* add linter build task

* update docs

* [add lib to npm](http://robdodson.me/blog/2012/06/16/publish-your-node-library-to-npm/)

So, yeah, I guess that's the whole of it here. Sincere thanks for sharing such a great tool!
-matt