Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
David Simon committed Apr 11, 2013
0 parents commit 61f4bd2
Show file tree
Hide file tree
Showing 23 changed files with 46,998 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
180 changes: 180 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
#################
## Vim
#################

*.swp

#################
## node
#################

node_modules

#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates
*.sln
*.nupkg
*.nuspec
*.*roj
workbench/jquery*
workbench/bootstrap*
web.config
# Build results
[Dd]ebug/
[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
*.dotCover

## TODO: If you have NuGet Package Restore enabled, uncomment this
#packages/

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp

# ReSharper is a .NET coding add-in
_ReSharper*

# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Others
[Bb]in
[Oo]bj
sql
TestResults
*.Cache
ClientBin
stylecop.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML



############
## Windows
############

# Windows image file caches
Thumbs.db

# Folder config file
Desktop.ini


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
dist
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg

# Mac crap
.DS_Store
29 changes: 29 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"node": true,
"browser": true,
"es5": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": false,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"white": false,
"sub": true,
"globals": {
"angular": false,
"_": false,
"$": false
}
}
161 changes: 161 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
'use strict';

module.exports = function (grunt) {
var stripBanner = function (src, options) {

if (!options) { options = {}; }
var m = [];
if (options.line) {
// Strip // ... leading banners.
m.push('(/{2,}[\\s\\S].*)');
}
if (options.block) {
// Strips all /* ... */ block comment banners.
m.push('(\/+\\*+[\\s\\S]*?\\*\\/+)');
} else {
// Strips only /* ... */ block comment banners, excluding /*! ... */.
m.push('(\/+\\*+[^!][\\s\\S]*?\\*\\/+)');
}
var re = new RegExp('\\s*(' + m.join('|') + ')\\s*', 'g');
src = src.replace(re, '');
src = src.replace(/\s{2,}(\r|\n|\s){2,}$/gm, '');
return src;
};

grunt.registerMultiTask('concat', 'Concatenate files.', function () {
// Merge task-specific and/or target-specific options with these defaults.
var options = this.options({
separator: grunt.util.linefeed,
banner: '',
footer: '',
stripBanners: false,
process: false
});
// Normalize boolean options that accept options objects.
if (typeof options.stripBanners === 'boolean' && options.stripBanners === true) { options.stripBanners = {}; }
if (typeof options.process === 'boolean' && options.process === true) { options.process = {}; }

// Process banner and footer.
var banner = grunt.template.process(options.banner);
var footer = grunt.template.process(options.footer);

// Iterate over all src-dest file pairs.
this.files.forEach(function (f) {
// Concat banner + specified files + footer.
var src = banner + f.src.filter(function (filepath) {
// Warn on and remove invalid source files (if nonull was set).
if (!grunt.file.exists(filepath)) {
grunt.log.warn('Source file "' + filepath + '" not found.');
return false;
} else {
return true;
}
}).map(function (filepath) {
// Read file source.
var src = grunt.file.read(filepath);
// Process files as templates if requested.
if (options.process) {
src = grunt.template.process(src, options.process);
}
// Strip banners if requested.
if (options.stripBanners) {
src = stripBanner(src, options.stripBanners);
}
return src;
}).join(grunt.util.normalizelf(options.separator)) + footer;

// Write the destination file.
grunt.file.write(f.dest, src);

// Print a success message.
grunt.log.writeln('File "' + f.dest + '" created.');
});
});

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
srcFiles: [
'src/*.js',
'src/services/*.js',
],
testFiles: { //unit & e2e goes here
karmaConfig: 'test/karma.conf.js',
//unit: ['test/unit/*.js']
},
karma: {
unit: {
options: {
configFile: '<%= testFiles.karmaConfig %>'
}
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'src/*.js',
'src/**/*.js'
]
},
concat: {
options: {
banner: '/***********************************************\n' +
'* secure-ng-resource JavaScript Library\n' +
'* https://github.com/davidmikesimon/secure-ng-resource/ \n' +
'* License: MIT (http://www.opensource.org/licenses/mit-license.php)\n' +
'* Compiled At: <%= grunt.template.today("mm/dd/yyyy HH:MM") %>\n' +
'***********************************************/\n' +
'(function(window) {\n' +
'\'use strict\';\n',
footer: '\n}(window));'
},
prod: {
options: {
stripBanners: {
block: true,
line: true
}
},
src: ['<%= srcFiles %>'],
dest: 'build/<%= pkg.name %>.js'
},
debug: {
src: ['<%= srcFiles %>'],
dest: 'build/<%= pkg.name %>.debug.js'
},
version: {
src: ['<%= srcFiles %>'],
dest: '<%= pkg.name %>-<%= pkg.version %>.debug.js'
}
},
uglify: {
build: {
src: 'build/<%= pkg.name %>.js',
dest: 'build/<%= pkg.name %>.min.js'
},
version: {
src: '<%= pkg.name %>-<%= pkg.version %>.debug.js',
dest: '<%= pkg.name %>-<%= pkg.version %>.min.js'
}
}
});

// Load grunt-karma task plugin
grunt.loadNpmTasks('grunt-karma');
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
//grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
// Default task(s).
grunt.registerTask('default', ['concat', 'uglify', 'clean']);
//grunt.registerTask('test', ['karma']);
grunt.registerTask('debug', ['concat:debug', 'clean']);
grunt.registerTask('prod', ['concat:prod', 'uglify', 'clean']);
grunt.registerTask('version', ['concat:version', 'uglify:version', 'clean']);

};
Loading

0 comments on commit 61f4bd2

Please sign in to comment.