Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Created separate npm packages for non-development versions

  • Loading branch information...
commit 7ffe158d9df69ed7aaec3d40e2503be4177655c2 1 parent 0cc35f8
Kevin Malakoff authored
5 easy-bake-config.yml
View
@@ -3,6 +3,11 @@ library:
compress: true
files:
- src/**/*.coffee
+ modes:
+ build:
+ commands:
+ - 'cp lifecycle.js packages/npm/lifecycle.js'
+ - 'cp lifecycle.min.js packages/npm/lifecycle.min.js'
tests:
output: build
7 package.json
View
@@ -1,6 +1,6 @@
{
- "author" : "Kevin Malakoff <https://github.com/kmalakoff>",
- "name" : "lifecycle",
+ "author" : {"name": "Kevin Malakoff", "url": "https://github.com/kmalakoff"},
+ "name" : "lifecycle_dev",
"description" : "Lifecycle.js provides conventions and helpers to manage the life cycles of Javascript instances",
"keywords" : ["lifecycle", "lifecyclejs", "json", "util", "server", "client"],
@@ -16,9 +16,6 @@
"postinstall": "cake postinstall",
"test": "cake -c -b test"
},
- "optionalDependencies": {
- "browserify": "latest"
- },
"main" : "lifecycle.js",
"version" : "1.0.1"
236 packages/npm/lifecycle.js
View
@@ -0,0 +1,236 @@
+// Generated by CoffeeScript 1.3.3
+
+/*
+ Lifecycle.js 1.0.1
+ (c) 2011, 2012 Kevin Malakoff.
+ Lifecycle is freely distributable under the MIT license.
+ https:#github.com/kmalakoff/Lifecycle
+
+ Note: some code from Backbone.js is repeated in this file.
+ Please see the following for details on Backbone.js and its licensing:
+ https:github.com/documentcloud/backbone
+ https:github.com/documentcloud/backbone/blob/master/LICENSE
+*/
+
+
+(function() {
+ var LC, copyProps, isArray;
+
+ LC = this.LC = typeof exports !== 'undefined' ? exports : {};
+
+ LC.VERSION = "1.0.1";
+
+ isArray = function(obj) {
+ return obj.constructor === Array;
+ };
+
+ copyProps = function(dest, source) {
+ var key, value;
+ for (key in source) {
+ value = source[key];
+ dest[key] = value;
+ }
+ return dest;
+ };
+
+
+// Shared empty constructor function to aid in prototype-chain creation.
+var ctor = function(){};
+
+// Helper function to correctly set up the prototype chain, for subclasses.
+// Similar to 'goog.inherits', but uses a hash of prototype properties and
+// class properties to be extended.
+var inherits = function(parent, protoProps, staticProps) {
+ var child;
+
+ // The constructor function for the new subclass is either defined by you
+ // (the "constructor" property in your extend definition), or defaulted
+ // by us to simply call the parent's constructor.
+ if (protoProps && protoProps.hasOwnProperty('constructor')) {
+ child = protoProps.constructor;
+ } else {
+ child = function(){ parent.apply(this, arguments); };
+ }
+
+ // Inherit class (static) properties from parent.
+ copyProps(child, parent);
+
+ // Set the prototype chain to inherit from parent, without calling
+ // parent's constructor function.
+ ctor.prototype = parent.prototype;
+ child.prototype = new ctor();
+
+ // Add prototype properties (instance properties) to the subclass,
+ // if supplied.
+ if (protoProps) copyProps(child.prototype, protoProps);
+
+ // Add static properties to the constructor function, if supplied.
+ if (staticProps) copyProps(child, staticProps);
+
+ // Correctly set child's 'prototype.constructor'.
+ child.prototype.constructor = child;
+
+ // Set a convenience property in case the parent's prototype is needed later.
+ child.__super__ = parent.prototype;
+
+ return child;
+};
+
+// The self-propagating extend function that BacLCone classes use.
+var extend = function (protoProps, classProps) {
+ var child = inherits(this, protoProps, classProps);
+ child.extend = this.extend;
+ return child;
+};
+;
+
+
+ LC.own = function(obj, options) {
+ var clone, key, value, _i, _j, _len, _len1;
+ if (!obj || (typeof obj !== "object")) {
+ return obj;
+ }
+ options || (options = {});
+ if (isArray(obj)) {
+ if (options.share_collection) {
+ for (_i = 0, _len = obj.length; _i < _len; _i++) {
+ value = obj[_i];
+ LC.own(value, {
+ prefer_clone: options.prefer_clone
+ });
+ }
+ return obj;
+ } else {
+ clone = [];
+ for (_j = 0, _len1 = obj.length; _j < _len1; _j++) {
+ value = obj[_j];
+ clone.push(LC.own(value, {
+ prefer_clone: options.prefer_clone
+ }));
+ }
+ return clone;
+ }
+ } else if (options.properties) {
+ if (options.share_collection) {
+ for (key in obj) {
+ value = obj[key];
+ LC.own(value, {
+ prefer_clone: options.prefer_clone
+ });
+ }
+ return obj;
+ } else {
+ clone = {};
+ for (key in obj) {
+ value = obj[key];
+ clone[key] = LC.own(value, {
+ prefer_clone: options.prefer_clone
+ });
+ }
+ return clone;
+ }
+ } else if (obj.retain) {
+ if (options.prefer_clone && obj.clone) {
+ return obj.clone();
+ } else {
+ return obj.retain();
+ }
+ } else if (obj.clone) {
+ return obj.clone();
+ }
+ return obj;
+ };
+
+ LC.disown = function(obj, options) {
+ var index, key, value, _i, _len;
+ if (options == null) {
+ options = {};
+ }
+ if (!obj || (typeof obj !== "object")) {
+ return obj;
+ }
+ if (isArray(obj)) {
+ if (options.clear_values) {
+ for (index in obj) {
+ value = obj[index];
+ LC.disown(value, {
+ clear_values: options.clear_values
+ });
+ obj[index] = null;
+ }
+ } else {
+ for (_i = 0, _len = obj.length; _i < _len; _i++) {
+ value = obj[_i];
+ LC.disown(value, {
+ remove_values: options.remove_values
+ });
+ }
+ if (options.remove_values) {
+ obj.length = 0;
+ }
+ }
+ } else if (options.properties) {
+ if (options.clear_values) {
+ for (key in obj) {
+ value = obj[key];
+ LC.disown(value, {
+ clear_values: options.clear_values
+ });
+ obj[key] = null;
+ }
+ } else {
+ for (key in obj) {
+ value = obj[key];
+ LC.disown(value, {
+ remove_values: options.remove_values
+ });
+ delete obj[key];
+ }
+ }
+ } else if (obj.release) {
+ obj.release();
+ } else if (obj.destroy) {
+ obj.destroy();
+ }
+ return obj;
+ };
+
+ LC.RefCountable = (function() {
+
+ RefCountable.extend = extend;
+
+ function RefCountable() {
+ this.__LC || (this.__LC = {});
+ this.__LC.ref_count = 1;
+ }
+
+ RefCountable.prototype.__destroy = function() {};
+
+ RefCountable.prototype.retain = function() {
+ if (this.__LC.ref_count <= 0) {
+ throw "RefCountable: ref_count is corrupt: " + this.__LC.ref_count;
+ }
+ this.__LC.ref_count++;
+ return this;
+ };
+
+ RefCountable.prototype.release = function() {
+ if (this.__LC.ref_count <= 0) {
+ throw "RefCountable: ref_count is corrupt: " + this.__LC.ref_count;
+ }
+ this.__LC.ref_count--;
+ if (!this.__LC.ref_count) {
+ this.__destroy();
+ }
+ return this;
+ };
+
+ RefCountable.prototype.refCount = function() {
+ return this.__LC.ref_count;
+ };
+
+ return RefCountable;
+
+ })();
+
+}).call(this);
13 packages/npm/lifecycle.min.js
View
@@ -0,0 +1,13 @@
+// Generated by CoffeeScript 1.3.3
+
+/*
+ Lifecycle.js 1.0.1
+ (c) 2011, 2012 Kevin Malakoff.
+ Lifecycle is freely distributable under the MIT license.
+ https:#github.com/kmalakoff/Lifecycle
+
+ Note: some code from Backbone.js is repeated in this file.
+ Please see the following for details on Backbone.js and its licensing:
+ https:github.com/documentcloud/backbone
+ https:github.com/documentcloud/backbone/blob/master/LICENSE
+*/(function(){var LC,copyProps,isArray;LC=this.LC=typeof exports!="undefined"?exports:{},LC.VERSION="1.0.1",isArray=function(obj){return obj.constructor===Array},copyProps=function(dest,source){var key,value;for(key in source)value=source[key],dest[key]=value;return dest};var ctor=function(){},inherits=function(parent,protoProps,staticProps){var child;return protoProps&&protoProps.hasOwnProperty("constructor")?child=protoProps.constructor:child=function(){parent.apply(this,arguments)},copyProps(child,parent),ctor.prototype=parent.prototype,child.prototype=new ctor,protoProps&&copyProps(child.prototype,protoProps),staticProps&&copyProps(child,staticProps),child.prototype.constructor=child,child.__super__=parent.prototype,child},extend=function(protoProps,classProps){var child=inherits(this,protoProps,classProps);return child.extend=this.extend,child};LC.own=function(obj,options){var clone,key,value,_i,_j,_len,_len1;if(!obj||typeof obj!="object")return obj;options||(options={});if(isArray(obj)){if(options.share_collection){for(_i=0,_len=obj.length;_i<_len;_i++)value=obj[_i],LC.own(value,{prefer_clone:options.prefer_clone});return obj}clone=[];for(_j=0,_len1=obj.length;_j<_len1;_j++)value=obj[_j],clone.push(LC.own(value,{prefer_clone:options.prefer_clone}));return clone}if(options.properties){if(options.share_collection){for(key in obj)value=obj[key],LC.own(value,{prefer_clone:options.prefer_clone});return obj}clone={};for(key in obj)value=obj[key],clone[key]=LC.own(value,{prefer_clone:options.prefer_clone});return clone}return obj.retain?options.prefer_clone&&obj.clone?obj.clone():obj.retain():obj.clone?obj.clone():obj},LC.disown=function(obj,options){var index,key,value,_i,_len;options==null&&(options={});if(!obj||typeof obj!="object")return obj;if(isArray(obj))if(options.clear_values)for(index in obj)value=obj[index],LC.disown(value,{clear_values:options.clear_values}),obj[index]=null;else{for(_i=0,_len=obj.length;_i<_len;_i++)value=obj[_i],LC.disown(value,{remove_values:options.remove_values});options.remove_values&&(obj.length=0)}else if(options.properties)if(options.clear_values)for(key in obj)value=obj[key],LC.disown(value,{clear_values:options.clear_values}),obj[key]=null;else for(key in obj)value=obj[key],LC.disown(value,{remove_values:options.remove_values}),delete obj[key];else obj.release?obj.release():obj.destroy&&obj.destroy();return obj},LC.RefCountable=function(){function RefCountable(){this.__LC||(this.__LC={}),this.__LC.ref_count=1}return RefCountable.extend=extend,RefCountable.prototype.__destroy=function(){},RefCountable.prototype.retain=function(){if(this.__LC.ref_count<=0)throw"RefCountable: ref_count is corrupt: "+this.__LC.ref_count;return this.__LC.ref_count++,this},RefCountable.prototype.release=function(){if(this.__LC.ref_count<=0)throw"RefCountable: ref_count is corrupt: "+this.__LC.ref_count;return this.__LC.ref_count--,this.__LC.ref_count||this.__destroy(),this},RefCountable.prototype.refCount=function(){return this.__LC.ref_count},RefCountable}()}).call(this);
16 packages/npm/package.json
View
@@ -0,0 +1,16 @@
+{
+ "author" : {"name": "Kevin Malakoff", "url": "https://github.com/kmalakoff"},
+ "name" : "lifecycle",
+ "description" : "Lifecycle.js provides conventions and helpers to manage the life cycles of Javascript instances",
+ "keywords" : ["lifecycle", "lifecyclejs", "json", "util", "server", "client"],
+
+ "url" : "http://kmalakoff.github.com/lifecycle/",
+ "homepage" : "http://kmalakoff.github.com/lifecycle/",
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/kmalakoff/lifecycle.git"
+ },
+
+ "main" : "lifecycle.js",
+ "version" : "1.0.1"
+}
Please sign in to comment.
Something went wrong with that request. Please try again.