Skip to content

Commit

Permalink
Added up to date install directions.
Browse files Browse the repository at this point in the history
  • Loading branch information
collin committed May 16, 2012
1 parent 271d37a commit f723123
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions Readme.md
Expand Up @@ -108,39 +108,38 @@ Todo.Application = AS.Application.extend

```

Now you're off to the races
## dependencies

## Serving Assets/Packages
### This is mostly terrible and will be replaced with a [bpm](https://github.com/bpm/bpm) based solution
You can get a package of dependencies with <a href="https://github.com/collin/html_package"> html_package </a>.

AlphaSimprini currently uses [module_loader](https://github.com/collin/module_loader) to server node modules
and provide an implementation of 'require' in the browser.
```sh
curl http://spader.herokuapp.com/minispade.js > vendor/minispade.js
gem install html_package
hip install \
--file="http://cloud.github.com/downloads/collin/alpha_simprini/alpha_simprini-0.5.0.html" \
--out="vendor/alpha_simprini"
```

module_loader requires a node server and can be set-up like this:
## minispade

```coffee
pathname = require("path")
ModuleLoader = require("../lib/module_loader")

# see https://github.com/collin/module_loader for complete
# configuration options (including specifying your own http server)
new ModuleLoader
module_root: pathname.resolve("./node_modules")
packages: ["underscore", "underscore.string", "project"]
The best supported use of Alpha Simprini is through minispade.
The javascript files downloaded by `hip install` are pre-wrapped in minispade

A copy of minispade can be downloaded here, or from <a href="https://github.com/wycats/minispade/blob/master/lib/main.js">Github</a>.
```sh
curl http://spader.herokuapp.com/minispade.js > vendor/minispade.js
```

To include your project, you must specify a package.json and install that package. If your project was called
'project' you could use npm like so in development.
Get all those files into your application,
for example, with the Rails asset pipeline:

```
npm link project && npm link
```coffee
#= require 'vendor/minispade'
#= require_dir 'vendor/alpha_simprini'

minispade.require 'alpha_simprini'
```

Then in your application:
Now you're off to the races.


```html
<script src="//localhost:2334/node_modules.js"></script>
<script>
require("project").boot()
</script>
```

0 comments on commit f723123

Please sign in to comment.