Skip to content

Commit

Permalink
Add Initial Files
Browse files Browse the repository at this point in the history
  • Loading branch information
David Murdoch committed Feb 3, 2012
1 parent 63d4a9c commit 0f8fe18
Show file tree
Hide file tree
Showing 11 changed files with 734 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
.DS_Store
lib-cov
testing
node_modules
5 changes: 5 additions & 0 deletions History.md
@@ -0,0 +1,5 @@

0.1.0 / 2012-02-01
==================

* Init
22 changes: 22 additions & 0 deletions LICENSE
@@ -0,0 +1,22 @@
(The MIT License)

Copyright (c) 2012 David Murdoch <david@vervestudios.co>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7 changes: 7 additions & 0 deletions index.js
@@ -0,0 +1,7 @@
/*!
* Razor
* Copyright(c) 2012 David Murdoch <david@vervestudios.co>
* MIT Licensed
*/

module.exports = require('./lib/razor');
30 changes: 30 additions & 0 deletions lib/html.js
@@ -0,0 +1,30 @@
/*!
* Razor
* Copyright(c) 2012 David Murdoch <david@vervestudios.co>
* MIT Licensed
*/

var Utils = require( "./utils" ),
HtmlString = require( "./htmlstring" ),
Html;

var Html = {
"Raw": function( str ) {
return new HtmlString( str );
},

"Encode": function( value ) {
return Utils.escapeHTML( value );
},

"ToString": function( value ) {
if ( value instanceof HtmlString ) {
return value.toString();
}
else {
return Html.Encode( value );
}
}
};

exports = module.exports = Html;
20 changes: 20 additions & 0 deletions lib/htmlstring.js
@@ -0,0 +1,20 @@
/*!
* Razor
* Copyright(c) 2012 David Murdoch <david@vervestudios.co>
* MIT Licensed
*/

var HtmlString = function( str ) {
if( !(this instanceof HtmlString) ){
return new HtmlString( str );
}
this.str = str;
return this;
}
HtmlString.prototype = {
"toString": function() {
return this.str;
}
};

exports = module.exports = HtmlString;
1 change: 1 addition & 0 deletions lib/index.js
@@ -0,0 +1 @@
razor.js

0 comments on commit 0f8fe18

Please sign in to comment.