Skip to content

Commit

Permalink
go generator go
Browse files Browse the repository at this point in the history
  • Loading branch information
thanpolas committed Mar 16, 2013
1 parent ffca173 commit 566feb7
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 10 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

78 changes: 78 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**
* Project specific jshint linting options.
*
* Forked of Airbnb JSHint settings.
*
* @version 0.3.1
* @see http://www.jshint.com/docs/
*/
{
/*
* ENVIRONMENTS
* =================
*/

// Define globals exposed by modern browsers.
"browser": true,

// Define globals exposed by jQuery.
"jquery": true,

// Define globals exposed by Node.js.
"node": true,

/*
* ENFORCING OPTIONS
* =================
*/

// Force all variable names to use either camelCase style or UPPER_CASE
// with underscores.
"camelcase": true,

// Prohibit use of == and != in favor of === and !==.
"eqeqeq": true,

// Suppress warnings about == null comparisons.
"eqnull": true,

// Enforce tab width of 2 spaces.
"indent": 2,

// Prohibit use of a variable before it is defined.
"latedef": true,

// Require capitalized names for constructor functions.
"newcap": true,

// Enforce use of single quotation marks for strings.
"quotmark": "single",

// Prohibit trailing whitespace.
"trailing": true,

// Prohibit use of explicitly undeclared variables.
"undef": true,

// Warn when variables are defined but never used.
"unused": true,

// do not complain for lack of 'use strict';
"globalstrict": false,
"strict": false,

"es5": false,

// suppress object dot notation warnings, we know what we're doing
"sub": true,


/**
* PROJECT GLOBALS
* ================
*
*/
"predef": [
"goog"
]
}
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Closure Library Yeoman Generator

# Not Maintained

This repo is now maintained as a yeoman generator.


[Find it here https://github.com/thanpolas/generator-closure](https://github.com/thanpolas/generator-closure)
Hello World!
1 change: 0 additions & 1 deletion html/js/closure-library
Submodule closure-library deleted from c7fdf4
68 changes: 68 additions & 0 deletions html/js/example/sample1/configTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
goog.provide('example.ct');

goog.require('goog.object');
goog.require('goog.structs.Map');

/**
* A sample object
*
* @type {Object}
*/
example.ct.aDeepObject = {
'one': 1,
'two': 2,
'three': {
'tone': 'one',
'ttwo': 'two',
'tthree': {
'ttone': 'tone',
'tttwo': true,
'ttthree': [1, 2, 3, 4, 5, 6]
}
}
};

/** @lends {example.ct.aDeepObject} */
example.ct.useObject = {};

/** @type {goog.structs.Map} */
example.ct.map = new goog.structs.Map();

/**
* Export our deep object
*/
example.ct.init = function()
{
example.ct.useObject = goog.object.unsafeClone(example.ct.aDeepObject);
example.ct.map.addAll(example.ct.aDeepObject);
example.ct.paint('Original values');

example.ct.map.set('two', 3);
example.ct.paint('key "two" was changed in map to 3');

example.ct.useObject = example.ct.map.toObject();
example.ct.paint('useObject was assigned from map');

goog.global['conf']['two'] = 4;
example.ct.paint('Globalized conf.two was changed to 4');

};

example.ct.paint = function(opt_words)
{
var el = example.sample1.getElement('objects');
var ret = '';
if (opt_words) {
ret += '<h4 style="margin:0">' + opt_words + '</h4>';
}
ret += 'useObject.two:<b>' + example.ct.useObject['two'] + '</b>';
ret += ' aDeepObject.two:<b>' + example.ct.aDeepObject['two'] + '</b>';
ret += '<br /><br />';
example.sample1.elementHTML(el, ret, true);

};


goog.exportSymbol('app.paint', example.ct.paint);
goog.exportSymbol('app.map', example.ct.map);
goog.exportSymbol('conf', example.ct.aDeepObject);
42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "generator-closure",
"version": "0.0.1",
"description": "Yeoman generator for Closure Library",
"keywords": [
"yeoman-generator",
"yeoman",
"generator",
"framework",
"component",
"front-end",
"app",
"closure",
"closure library"
],
"homepage": "https://github.com/thanpolas/generator-closure",
"bugs": "https://github.com/thanpolas/generator-closure/issues",
"author": {
"name": "Thanasis Polychronakis",
"email": "thanpolas@gmail.com",
"url": "http://thanpol.as"
},
"main": "app/index.js",
"repository": {
"type": "git",
"url": "git://github.com/thanpolas/generator-closure.git"
},
"dependencies": {
"yeoman-generator": "~0.10.2"
},
"devDependencies": {
},
"engines": {
"node": ">=0.8.0"
},
"licenses": [
{
"type": "MIT",
"url": "http://en.wikipedia.org/wiki/MIT_License"
}
]
}

0 comments on commit 566feb7

Please sign in to comment.