1. Damon Oehlman
  2. recipe

Commits

Damon Oehlman  committed 884c44e

Renaming cookbook > compo

  • Participants
  • Parent commits 34f09b3
  • Branches master

Comments (0)

Files changed (5)

File README.md

View file
-# cookbook
+# compo
 
-This library provides a set of Javascript helpers for interpreting textual recipes which define the requirements of a web component.
+This library provides a set of Javascript helpers for interpreting textual recipes which define the requirements of a web component.  Compo is not designed to function as a build-tool in it's own right, this is left to tools such as [bake-js](/DamonOehlman/bake-js) and others.
+
+<a href="http://travis-ci.org/#!/DamonOehlman/compo"><img src="https://secure.travis-ci.org/DamonOehlman/compo.png" alt="Build Status"></a>
+
+Any standalone that can be accessed via HTTP can be described in a cookbook recipe.  For example, the following is a recipe that describes [keymaster](/madrobby/keymaster) using a [getit custom url scheme](/DamonOehlman/getit#custom-url-schemes):
+
+```
+# dsc: A simple micro-library for defining and dispatching keyboard shortcuts.
+# url: https://github.com/madrobby/keymaster
+
+[core]
+js <= github://madrobby/keymaster/keymaster.js
+```
+
+## What is a Web Component?
+
+A web component is a small functional unit, that is 

File package.json

View file
 {
-  "name": "cookbook",
+  "name": "compo",
   "description": "Web Component Recipe Helpers",
   "author": "Damon Oehlman <damon.oehlman@sidelab.com>",
   "tags": [
   },
   "repository": {
     "type": "git",
-    "url": "git://github.com/DamonOehlman/cookbook.git"
+    "url": "git://github.com/DamonOehlman/compo.git"
   },
   "bugs": {
-    "url": "http://github.com/DamonOehlman/cookbook/issues"
+    "url": "http://github.com/DamonOehlman/compo/issues"
   },
   "scripts": {
     "test": "node_modules/mocha/bin/mocha --reporter spec"

File src/compo.js

View file
+// req: formatter
+
+//= core/recipe
+
+function compo() {
+}
+
+// patch the recipe class into the cookbook
+compo.Recipe = Recipe;

File src/cookbook.js

-// req: formatter
-
-//= core/recipe
-
-function cookbook() {
-}
-
-// patch the recipe class into the cookbook
-cookbook.Recipe = Recipe;

File test/metadata.js

View file
-var cookbook = require('../pkg/cjs/cookbook'),
+var compo = require('../pkg/cjs/compo'),
     expect = require('expect.js'),
     samples = {
         simple: '# dsc: small JS library for DOM class manipulation\n' + 
 
 describe('recipe metadata tests', function() {
     it('should be able to read metdata from a simple recipe definition', function() {
-        var recipe = new cookbook.Recipe(samples.simple);
+        var recipe = new compo.Recipe(samples.simple);
         
         expect(recipe.desc).to.equal('small JS library for DOM class manipulation');
         expect(recipe.url).to.equal('https://github.com/DamonOehlman/classtweak');
     });
     
     it('should be able to find sections within a simple recipe', function() {
-        var recipe = new cookbook.Recipe(samples.simple);
+        var recipe = new compo.Recipe(samples.simple);
         
         expect(recipe.sections.core).to.be.ok();
     });
     
     it('should have contents for the section specified in the simple recipe', function() {
-        var recipe = new cookbook.Recipe(samples.simple),
+        var recipe = new compo.Recipe(samples.simple),
             core = recipe.sections.core;
         
         expect(core.js).to.be.ok();