Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added travis build

  • Loading branch information...
commit edf87d14ad492216141805cfd80d3a953ae89785 1 parent 5e01a37
@doug-martin doug-martin authored
View
4 .travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.6
+ - 0.8
View
2  README.md
@@ -1,3 +1,5 @@
+[![build status](https://secure.travis-ci.org/C2FO/comb.png)](http://travis-ci.org/C2FO/comb)
+
#Comb
View
40 docs-md/coverage.html
@@ -3160,20 +3160,20 @@
<li class='green'><span class=''> </span><code> * @param {Number} [amount=0] the amount to add</code></li>
<li class='green'><span class=''> </span><code> */</code></li>
<li class='green'><span class=''> </span><code> add:function (/*Date*/date, /*String*/interval, /*int*/amount) {</code></li>
-<li class='green'><span class='hits'>216</span><code> var res = addTransform(interval, date, amount || 0);</code></li>
-<li class='green'><span class='hits'>216</span><code> amount = res[0];</code></li>
-<li class='green'><span class='hits'>216</span><code> var property = res[1];</code></li>
-<li class='green'><span class='hits'>216</span><code> var sum = new Date(date);</code></li>
-<li class='green'><span class='hits'>216</span><code> var fixOvershoot = res[2];</code></li>
-<li class='green'><span class='hits'>216</span><code> if (property) {</code></li>
-<li class='green'><span class='hits'>216</span><code> sum["set" + property](sum["get" + property]() + amount);</code></li>
+<li class='green'><span class='hits'>228</span><code> var res = addTransform(interval, date, amount || 0);</code></li>
+<li class='green'><span class='hits'>228</span><code> amount = res[0];</code></li>
+<li class='green'><span class='hits'>228</span><code> var property = res[1];</code></li>
+<li class='green'><span class='hits'>228</span><code> var sum = new Date(date);</code></li>
+<li class='green'><span class='hits'>228</span><code> var fixOvershoot = res[2];</code></li>
+<li class='green'><span class='hits'>228</span><code> if (property) {</code></li>
+<li class='green'><span class='hits'>228</span><code> sum["set" + property](sum["get" + property]() + amount);</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
<li class='green'><span class=''> </span><code></code></li>
-<li class='green'><span class='hits'>216</span><code> if (fixOvershoot &amp;&amp; (sum.getDate() &lt; date.getDate())) {</code></li>
+<li class='green'><span class='hits'>228</span><code> if (fixOvershoot &amp;&amp; (sum.getDate() &lt; date.getDate())) {</code></li>
<li class='green'><span class='hits'>26</span><code> sum.setDate(0);</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
<li class='green'><span class=''> </span><code></code></li>
-<li class='green'><span class='hits'>216</span><code> return sum; // Date</code></li>
+<li class='green'><span class='hits'>228</span><code> return sum; // Date</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
<li class='green'><span class=''> </span><code></code></li>
<li class='green'><span class=''> </span><code> /**</code></li>
@@ -3729,7 +3729,7 @@
<li class='green'><span class=''> </span><code></code></li>
<li class='green'><span class='hits'>1</span><code>var addMap = {</code></li>
<li class='green'><span class=''> </span><code> day:function addDay(date, amount) {</code></li>
-<li class='green'><span class='hits'>60</span><code> return [amount, "Date", false];</code></li>
+<li class='green'><span class='hits'>62</span><code> return [amount, "Date", false];</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
<li class='green'><span class=''> </span><code> weekday:function addWeekday(date, amount) {</code></li>
<li class='green'><span class=''> </span><code> // Divide the increment time span into weekspans plus leftover days</code></li>
@@ -3762,7 +3762,7 @@
<li class='green'><span class='hits'>32</span><code> return [(7 * weeks) + days + adj, "Date", false];</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
<li class='green'><span class=''> </span><code> year:function addYear(date, amount) {</code></li>
-<li class='green'><span class='hits'>34</span><code> return [amount, "FullYear", true];</code></li>
+<li class='green'><span class='hits'>36</span><code> return [amount, "FullYear", true];</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
<li class='green'><span class=''> </span><code> week:function addWeek(date, amount) {</code></li>
<li class='green'><span class='hits'>6</span><code> return [amount * 7, "Date", false];</code></li>
@@ -3771,16 +3771,16 @@
<li class='green'><span class='hits'>18</span><code> return [amount * 3, "Month", true];</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
<li class='green'><span class=''> </span><code> month:function addYear(date, amount) {</code></li>
-<li class='green'><span class='hits'>20</span><code> return [amount, "Month", true];</code></li>
+<li class='green'><span class='hits'>22</span><code> return [amount, "Month", true];</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
<li class='green'><span class=''> </span><code>};</code></li>
<li class='green'><span class=''> </span><code></code></li>
<li class='green'><span class='hits'>1</span><code>function addTransform(interval, date, amount) {</code></li>
-<li class='green'><span class='hits'>216</span><code> interval = interval.replace(/s$/, "");</code></li>
-<li class='green'><span class='hits'>216</span><code> if (addMap.hasOwnProperty(interval)) {</code></li>
-<li class='green'><span class='hits'>170</span><code> return addMap[interval](date, amount);</code></li>
+<li class='green'><span class='hits'>228</span><code> interval = interval.replace(/s$/, "");</code></li>
+<li class='green'><span class='hits'>228</span><code> if (addMap.hasOwnProperty(interval)) {</code></li>
+<li class='green'><span class='hits'>176</span><code> return addMap[interval](date, amount);</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
-<li class='green'><span class='hits'>46</span><code> return [amount, "UTC" + interval.charAt(0).toUpperCase() + interval.substring(1) + "s", false];</code></li>
+<li class='green'><span class='hits'>52</span><code> return [amount, "UTC" + interval.charAt(0).toUpperCase() + interval.substring(1) + "s", false];</code></li>
<li class='green'><span class=''> </span><code>}</code></li>
<li class='green'><span class=''> </span><code></code></li>
<li class='green'><span class=''> </span><code></code></li>
@@ -6187,12 +6187,12 @@
<li class='green'><span class='hits'>351</span><code> ch = ch || " ";</code></li>
<li class='green'><span class='hits'>351</span><code> var strLen = string.length;</code></li>
<li class='green'><span class='hits'>351</span><code> while (strLen &lt; length) {</code></li>
-<li class='green'><span class='hits'>271</span><code> if (end) {</code></li>
+<li class='green'><span class='hits'>295</span><code> if (end) {</code></li>
<li class='green'><span class='hits'>157</span><code> string += ch;</code></li>
<li class='green'><span class=''> </span><code> } else {</code></li>
-<li class='green'><span class='hits'>114</span><code> string = ch + string;</code></li>
+<li class='green'><span class='hits'>138</span><code> string = ch + string;</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
-<li class='green'><span class='hits'>271</span><code> strLen++;</code></li>
+<li class='green'><span class='hits'>295</span><code> strLen++;</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
<li class='green'><span class='hits'>351</span><code> return string;</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
@@ -10344,7 +10344,7 @@
<li class='green'><span class=''> </span><code> *</code></li>
<li class='green'><span class=''> </span><code> *</code></li>
<li class='green'><span class=''> </span><code> * @header</code></li>
-<li class='green'><span class=''> </span><code> *</code></li>
+<li class='green'><span class=''> </span><code> * [![build status](https://secure.travis-ci.org/C2FO/comb.png)](http://travis-ci.org/C2FO/comb)</code></li>
<li class='green'><span class=''> </span><code> * #Comb</code></li>
<li class='green'><span class=''> </span><code> *</code></li>
<li class='green'><span class=''> </span><code> * ##Overview</code></li>
View
40 docs/coverage.html
@@ -3160,20 +3160,20 @@
<li class='green'><span class=''> </span><code> * @param {Number} [amount=0] the amount to add</code></li>
<li class='green'><span class=''> </span><code> */</code></li>
<li class='green'><span class=''> </span><code> add:function (/*Date*/date, /*String*/interval, /*int*/amount) {</code></li>
-<li class='green'><span class='hits'>216</span><code> var res = addTransform(interval, date, amount || 0);</code></li>
-<li class='green'><span class='hits'>216</span><code> amount = res[0];</code></li>
-<li class='green'><span class='hits'>216</span><code> var property = res[1];</code></li>
-<li class='green'><span class='hits'>216</span><code> var sum = new Date(date);</code></li>
-<li class='green'><span class='hits'>216</span><code> var fixOvershoot = res[2];</code></li>
-<li class='green'><span class='hits'>216</span><code> if (property) {</code></li>
-<li class='green'><span class='hits'>216</span><code> sum["set" + property](sum["get" + property]() + amount);</code></li>
+<li class='green'><span class='hits'>228</span><code> var res = addTransform(interval, date, amount || 0);</code></li>
+<li class='green'><span class='hits'>228</span><code> amount = res[0];</code></li>
+<li class='green'><span class='hits'>228</span><code> var property = res[1];</code></li>
+<li class='green'><span class='hits'>228</span><code> var sum = new Date(date);</code></li>
+<li class='green'><span class='hits'>228</span><code> var fixOvershoot = res[2];</code></li>
+<li class='green'><span class='hits'>228</span><code> if (property) {</code></li>
+<li class='green'><span class='hits'>228</span><code> sum["set" + property](sum["get" + property]() + amount);</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
<li class='green'><span class=''> </span><code></code></li>
-<li class='green'><span class='hits'>216</span><code> if (fixOvershoot &amp;&amp; (sum.getDate() &lt; date.getDate())) {</code></li>
+<li class='green'><span class='hits'>228</span><code> if (fixOvershoot &amp;&amp; (sum.getDate() &lt; date.getDate())) {</code></li>
<li class='green'><span class='hits'>26</span><code> sum.setDate(0);</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
<li class='green'><span class=''> </span><code></code></li>
-<li class='green'><span class='hits'>216</span><code> return sum; // Date</code></li>
+<li class='green'><span class='hits'>228</span><code> return sum; // Date</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
<li class='green'><span class=''> </span><code></code></li>
<li class='green'><span class=''> </span><code> /**</code></li>
@@ -3729,7 +3729,7 @@
<li class='green'><span class=''> </span><code></code></li>
<li class='green'><span class='hits'>1</span><code>var addMap = {</code></li>
<li class='green'><span class=''> </span><code> day:function addDay(date, amount) {</code></li>
-<li class='green'><span class='hits'>60</span><code> return [amount, "Date", false];</code></li>
+<li class='green'><span class='hits'>62</span><code> return [amount, "Date", false];</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
<li class='green'><span class=''> </span><code> weekday:function addWeekday(date, amount) {</code></li>
<li class='green'><span class=''> </span><code> // Divide the increment time span into weekspans plus leftover days</code></li>
@@ -3762,7 +3762,7 @@
<li class='green'><span class='hits'>32</span><code> return [(7 * weeks) + days + adj, "Date", false];</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
<li class='green'><span class=''> </span><code> year:function addYear(date, amount) {</code></li>
-<li class='green'><span class='hits'>34</span><code> return [amount, "FullYear", true];</code></li>
+<li class='green'><span class='hits'>36</span><code> return [amount, "FullYear", true];</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
<li class='green'><span class=''> </span><code> week:function addWeek(date, amount) {</code></li>
<li class='green'><span class='hits'>6</span><code> return [amount * 7, "Date", false];</code></li>
@@ -3771,16 +3771,16 @@
<li class='green'><span class='hits'>18</span><code> return [amount * 3, "Month", true];</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
<li class='green'><span class=''> </span><code> month:function addYear(date, amount) {</code></li>
-<li class='green'><span class='hits'>20</span><code> return [amount, "Month", true];</code></li>
+<li class='green'><span class='hits'>22</span><code> return [amount, "Month", true];</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
<li class='green'><span class=''> </span><code>};</code></li>
<li class='green'><span class=''> </span><code></code></li>
<li class='green'><span class='hits'>1</span><code>function addTransform(interval, date, amount) {</code></li>
-<li class='green'><span class='hits'>216</span><code> interval = interval.replace(/s$/, "");</code></li>
-<li class='green'><span class='hits'>216</span><code> if (addMap.hasOwnProperty(interval)) {</code></li>
-<li class='green'><span class='hits'>170</span><code> return addMap[interval](date, amount);</code></li>
+<li class='green'><span class='hits'>228</span><code> interval = interval.replace(/s$/, "");</code></li>
+<li class='green'><span class='hits'>228</span><code> if (addMap.hasOwnProperty(interval)) {</code></li>
+<li class='green'><span class='hits'>176</span><code> return addMap[interval](date, amount);</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
-<li class='green'><span class='hits'>46</span><code> return [amount, "UTC" + interval.charAt(0).toUpperCase() + interval.substring(1) + "s", false];</code></li>
+<li class='green'><span class='hits'>52</span><code> return [amount, "UTC" + interval.charAt(0).toUpperCase() + interval.substring(1) + "s", false];</code></li>
<li class='green'><span class=''> </span><code>}</code></li>
<li class='green'><span class=''> </span><code></code></li>
<li class='green'><span class=''> </span><code></code></li>
@@ -6187,12 +6187,12 @@
<li class='green'><span class='hits'>351</span><code> ch = ch || " ";</code></li>
<li class='green'><span class='hits'>351</span><code> var strLen = string.length;</code></li>
<li class='green'><span class='hits'>351</span><code> while (strLen &lt; length) {</code></li>
-<li class='green'><span class='hits'>271</span><code> if (end) {</code></li>
+<li class='green'><span class='hits'>295</span><code> if (end) {</code></li>
<li class='green'><span class='hits'>157</span><code> string += ch;</code></li>
<li class='green'><span class=''> </span><code> } else {</code></li>
-<li class='green'><span class='hits'>114</span><code> string = ch + string;</code></li>
+<li class='green'><span class='hits'>138</span><code> string = ch + string;</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
-<li class='green'><span class='hits'>271</span><code> strLen++;</code></li>
+<li class='green'><span class='hits'>295</span><code> strLen++;</code></li>
<li class='green'><span class=''> </span><code> }</code></li>
<li class='green'><span class='hits'>351</span><code> return string;</code></li>
<li class='green'><span class=''> </span><code> },</code></li>
@@ -10344,7 +10344,7 @@
<li class='green'><span class=''> </span><code> *</code></li>
<li class='green'><span class=''> </span><code> *</code></li>
<li class='green'><span class=''> </span><code> * @header</code></li>
-<li class='green'><span class=''> </span><code> *</code></li>
+<li class='green'><span class=''> </span><code> * [![build status](https://secure.travis-ci.org/C2FO/comb.png)](http://travis-ci.org/C2FO/comb)</code></li>
<li class='green'><span class=''> </span><code> * #Comb</code></li>
<li class='green'><span class=''> </span><code> *</code></li>
<li class='green'><span class=''> </span><code> * ##Overview</code></li>
View
4 docs/index.html
@@ -274,7 +274,9 @@
- <h1>Comb</h1>
+ <p><a href="http://travis-ci.org/C2FO/comb"><img src="https://secure.travis-ci.org/C2FO/comb.png" alt="build status"></a>
+</p>
+<h1>Comb</h1>
<h2>Overview</h2>
<p>Framework for node that provides a one stop shop for frequently needed utilities, including:
View
2  lib/index.js
@@ -16,7 +16,7 @@ var base = require("./base"),
*
*
* @header
- *
+ * [![build status](https://secure.travis-ci.org/C2FO/comb.png)](http://travis-ci.org/C2FO/comb)
* #Comb
*
* ##Overview
View
3  package.json
@@ -13,6 +13,9 @@
"directories":{
"lib":"lib"
},
+ "scripts": {
+ "test": "make test"
+ },
"engines":{
"node":">= 0.6.1"
}
View
24 test/base/date.test.js
@@ -2068,25 +2068,25 @@ it.describe("comb.date",function (it) {
it.describe("when using convenice methods *fromNow *ago", function (it) {
it.should("add/subtract", function () {
- assert.deepEqual(comb.yearsFromNow(2).getFullYear(), new Date().getFullYear() + 2);
- assert.deepEqual(comb(comb.yearsAgo(2)).getFullYear(), new Date().getFullYear() - 2);
+ assert.deepEqual(comb.yearsFromNow(2).getFullYear(), comb.date.add(new Date(), "year", 2).getFullYear());
+ assert.deepEqual(comb(comb.yearsAgo(2)).getFullYear(), comb.date.add(new Date(), "year", -2).getFullYear());
- assert.deepEqual(comb.monthsFromNow(2).getMonth(), new Date().getMonth() + 2);
- assert.deepEqual(comb.monthsAgo(2).getMonth(), new Date().getMonth() - 2);
+ assert.deepEqual(comb.monthsFromNow(2).getMonth(), comb.date.add(new Date(), "month", 2).getMonth());
+ assert.deepEqual(comb.monthsAgo(2).getMonth(), comb.date.add(new Date(), "month", -2).getMonth());
- assert.deepEqual(comb.daysFromNow(2).getDate(), new Date().getDate() + 2);
- assert.deepEqual(comb.daysAgo(2).getDate(), new Date().getDate() - 2);
+ assert.deepEqual(comb.daysFromNow(2).getDate(), comb.date.add(new Date(), "day", 2).getDate());
+ assert.deepEqual(comb.daysAgo(2).getDate(), comb.date.add(new Date(), "day", -2).getDate());
- assert.deepEqual(comb.hoursFromNow(2).getHours(), new Date().getHours() + 2);
- assert.deepEqual(comb.hoursAgo(2).getHours(), new Date().getHours() - 2);
+ assert.deepEqual(comb.hoursFromNow(2).getHours(), comb.date.add(new Date(), "hour", 2).getHours());
+ assert.deepEqual(comb.hoursAgo(2).getHours(), comb.date.add(new Date(), "hour", -2).getHours());
- assert.deepEqual(comb.minutesFromNow(2).getMinutes(), (new Date().getMinutes() + 2) % 60);
- assert.deepEqual(comb.minutesAgo(2).getMinutes(), new Date().getMinutes() - 2);
+ assert.deepEqual(comb.minutesFromNow(2).getMinutes(), comb.date.add(new Date(), "minute", 2).getMinutes());
+ assert.deepEqual(comb.minutesAgo(2).getMinutes(), comb.date.add(new Date(), "minute", -2).getMinutes());
- assert.deepEqual(comb.secondsFromNow(2).getSeconds(), (new Date().getSeconds() + 2) % 60);
- assert.deepEqual(comb.secondsAgo(2).getSeconds(), new Date().getSeconds() - 2);
+ assert.deepEqual(comb.secondsFromNow(2).getSeconds(), comb.date.add(new Date(), "second", 2).getSeconds());
+ assert.deepEqual(comb.secondsAgo(2).getSeconds(), comb.date.add(new Date(), "second", -2).getSeconds());
});
});
}).as(module);
Please sign in to comment.
Something went wrong with that request. Please try again.