Permalink
Browse files

Removed coffee-script as a dependency.

  • Loading branch information...
1 parent 53b2cf3 commit 85b13ab137d98ff0cd564376644c9fddab4b4d38 @michaelhodgins committed Mar 18, 2013
Showing with 116 additions and 25 deletions.
  1. +5 −4 package.json
  2. +0 −21 registry.coffee
  3. +66 −0 registry.js
  4. +45 −0 src/registry.coffee
View
9 package.json
@@ -4,7 +4,9 @@
"description": "A simple registry for saving and retrieving objects and values.",
"main": "registry.coffee",
"scripts": {
- "test": "./node_modules/.bin/mocha --compilers coffee:coffee-script -G -u bdd ./test"
+ "test": "./node_modules/.bin/mocha --compilers coffee:coffee-script -G -u bdd ./test",
+ "compile": "./node_modules/coffee-script/bin/coffee -o . -cb src/registry.coffee",
+ "docs": "./node_modules/codo/bin/codo src"
},
"repository": "https://github.com/michaelhodgins/simple-registry.git",
"keywords": [
@@ -13,10 +15,9 @@
"author": "Michael Hodgins",
"license": "BSD",
"devDependencies": {
+ "codo": "~1.5.6",
+ "coffee-script": "~1.6.1",
"mocha": "~1.8.1",
"should": "~1.2.2"
- },
- "dependencies": {
- "coffee-script": "~1.6.1"
}
}
View
21 registry.coffee
@@ -1,21 +0,0 @@
-class Registry
-
- variables: null
-
- constructor: ->
- @variables = {}
-
- set: (key, value) ->
- @variables[key] = value
-
- get: (key) ->
- @variables[key]
-
- has: (key) ->
- key of @variables
-
- remove: (key) ->
- if @has key
- delete @variables[key]
-
-module.exports = new Registry()
View
66 registry.js
@@ -0,0 +1,66 @@
+// Generated by CoffeeScript 1.6.1
+var Registry;
+
+Registry = (function() {
+
+ Registry.prototype.variables = null;
+
+ /*
+ Constructs an instance of Registry. Called when simple-registry
+ is first required.
+ */
+
+
+ function Registry() {
+ this.variables = {};
+ }
+
+ /*
+ Associates a value with a key. The key should be a string
+ @param string key
+ @param object value
+ */
+
+
+ Registry.prototype.set = function(key, value) {
+ return this.variables[key] = value;
+ };
+
+ /*
+ Returns the value previously associated with the given key.
+ @param string key
+ */
+
+
+ Registry.prototype.get = function(key) {
+ return this.variables[key];
+ };
+
+ /*
+ Returns true if the given key has been associated with
+ a value.
+ @param string key
+ */
+
+
+ Registry.prototype.has = function(key) {
+ return key in this.variables;
+ };
+
+ /*
+ Removes any value associated with the given key.
+ @param string key
+ */
+
+
+ Registry.prototype.remove = function(key) {
+ if (this.has(key)) {
+ return delete this.variables[key];
+ }
+ };
+
+ return Registry;
+
+})();
+
+module.exports = new Registry();
View
45 src/registry.coffee
@@ -0,0 +1,45 @@
+class Registry
+
+ variables: null
+
+ ###
+ Constructs an instance of Registry. Called when simple-registry
+ is first required.
+ ###
+ constructor: ->
+ @variables = {}
+
+ ###
+ Associates a value with a key. The key should be a string
+ @param [String] key
+ @param [Object] value
+ ###
+ set: (key, value) ->
+ @variables[key] = value
+
+ ###
+ Returns the value previously associated with the given key.
+ @param [String] key
+ @return [Object]
+ ###
+ get: (key) ->
+ @variables[key]
+
+ ###
+ Returns true if the given key has been associated with
+ a value.
+ @param [String] key
+ @return [Boolean]
+ ###
+ has: (key) ->
+ key of @variables
+
+ ###
+ Removes any value associated with the given key.
+ @param [String] key
+ ###
+ remove: (key) ->
+ if @has key
+ delete @variables[key]
+
+module.exports = new Registry()

0 comments on commit 85b13ab

Please sign in to comment.