Permalink
Browse files

updating comments across codebase

  • Loading branch information...
1 parent 9b3467e commit 3f3865d599ae63990ac701985a9856bbd7177d47 @themadcreator committed Mar 27, 2014
View
@@ -6,6 +6,9 @@ UglifyJS = require 'uglify-js'
CoffeeScript = require 'coffee-script'
packageJson = require './package.json'
+unsafeExec = exec
+exec = (cmd) -> unsafeExec(cmd, (err) -> throw err if err)
+
DISTS = {
'seen.js' : [
'src/namespace.coffee'
@@ -33,6 +36,8 @@ DISTS = {
]
}
+MIN_LICENSE = "/** seen.js v#{packageJson.version} | themadcreator.github.io/seen | @license: Apache 2.0 */\n"
+
DIST = path.join(__dirname, 'dist', packageJson.version)
SITE_DIST = path.join(__dirname, 'site-dist')
@@ -60,12 +65,14 @@ task 'build', 'Build and uglify seen', () ->
# Compile to javascript
jsCode = CoffeeScript.compile coffeeCode
- fs.writeFileSync path.join(DIST, javascript), jsCode, {flags: 'w'}
+ fs.writeFileSync path.join(DIST, javascript), MIN_LICENSE + jsCode, {flags: 'w'}
console.log ' Compiled.'
# Uglify
ugly = UglifyJS.minify path.join(DIST, javascript),
outSourceMap : "#{javascript}.map"
+ output :
+ comments : true
fs.writeFileSync path.join(DIST, javascript.replace(/\.js$/,'.min.js')), ugly.code, {flags: 'w'}
fs.writeFileSync path.join(DIST, "#{javascript}.map"), ugly.map, {flags: 'w'}
console.log ' Minified.'
@@ -90,17 +97,18 @@ task 'site', 'Build seen website', (options) ->
# Prepare output path
if not fs.existsSync(SITE_DIST) then fs.mkdirSync(SITE_DIST)
- exec("rm -rf #{SITE_DIST}/*", (err) -> throw err if err)
+ exec("rm -rf #{SITE_DIST}/*")
# Copy static resources
for resource in ['lib', 'css', 'assets']
- exec("cp -rf site/#{resource} #{SITE_DIST}/#{resource}", (err) -> throw err if err)
- exec("cp dist/latest/seen.min.js #{SITE_DIST}/lib/.", (err) -> throw err if err)
+ exec("cp -rf site/#{resource} #{SITE_DIST}/#{resource}")
+ exec("cp dist/latest/seen.min.js #{SITE_DIST}/lib/.")
console.log 'Copied static resources'
# Generate docco
script = path.join('node_modules' , '.bin', 'docco')
- exec("#{script} --output #{SITE_DIST}/docco dist/latest/seen.coffee", (err) -> throw err if err)
+ exec("#{script} --output #{SITE_DIST}/docco dist/latest/seen.coffee")
+ console.log 'Generated Docco'
# Demo pages
for demo, i in demos then do (demo, i) ->
View
@@ -1,15 +1,15 @@
## Apache 2.0 License
- Copyright 2013 github/themadcreator
+ Copyright 2013, 2014 github/themadcreator
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
Oops, something went wrong.

0 comments on commit 3f3865d

Please sign in to comment.