diff options
author | James Friend <james.friend@agworld.com.au> | 2014-08-28 05:32:08 +0400 |
---|---|---|
committer | James Friend <james.friend@agworld.com.au> | 2014-08-28 05:32:08 +0400 |
commit | 9aeaf19b1dca68ee71e916ae415a0c270a47d301 (patch) | |
tree | bc8385acb8ec7a46bba03ff2ef7e4283cd9f1146 /grunt | |
parent | e7991a9a1e2f474c8f1d8a2e0ed113816f1c5e82 (diff) | |
parent | 35f09315ed543a0479719afa2143240952c215db (diff) |
Merge remote-tracking branch 'upstream/master' into node-requirable
Conflicts:
Gruntfile.js
Diffstat (limited to 'grunt')
-rw-r--r-- | grunt/.jshintrc | 1 | ||||
-rw-r--r-- | grunt/bs-glyphicons-data-generator.js | 41 | ||||
-rw-r--r-- | grunt/sauce_browsers.yml | 29 | ||||
-rw-r--r-- | grunt/shrinkwrap.js | 41 |
4 files changed, 15 insertions, 97 deletions
diff --git a/grunt/.jshintrc b/grunt/.jshintrc index 78df94b9bc..0ea0495e9a 100644 --- a/grunt/.jshintrc +++ b/grunt/.jshintrc @@ -1,5 +1,6 @@ { "extends" : "../js/.jshintrc", + "asi" : false, "browser" : false, "es3" : false, "node" : true diff --git a/grunt/bs-glyphicons-data-generator.js b/grunt/bs-glyphicons-data-generator.js deleted file mode 100644 index 82dc727b6f..0000000000 --- a/grunt/bs-glyphicons-data-generator.js +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * Bootstrap Grunt task for Glyphicons data generation - * http://getbootstrap.com - * Copyright 2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -'use strict'; -var fs = require('fs'); - -module.exports = function generateGlyphiconsData(grunt) { - // Pass encoding, utf8, so `readFileSync` will return a string instead of a - // buffer - var glyphiconsFile = fs.readFileSync('less/glyphicons.less', 'utf8'); - var glyphiconsLines = glyphiconsFile.split('\n'); - - // Use any line that starts with ".glyphicon-" and capture the class name - var iconClassName = /^\.(glyphicon-[^\s]+)/; - var glyphiconsData = '# This file is generated via Grunt task. **Do not edit directly.**\n' + - '# See the \'build-glyphicons-data\' task in Gruntfile.js.\n\n'; - var glyphiconsYml = 'docs/_data/glyphicons.yml'; - for (var i = 0, len = glyphiconsLines.length; i < len; i++) { - var match = glyphiconsLines[i].match(iconClassName); - - if (match !== null) { - glyphiconsData += '- ' + match[1] + '\n'; - } - } - - // Create the `_data` directory if it doesn't already exist - if (!fs.existsSync('docs/_data')) { - fs.mkdirSync('docs/_data'); - } - - try { - fs.writeFileSync(glyphiconsYml, glyphiconsData); - } - catch (err) { - grunt.fail.warn(err); - } - grunt.log.writeln('File ' + glyphiconsYml.cyan + ' created.'); -}; diff --git a/grunt/sauce_browsers.yml b/grunt/sauce_browsers.yml index 4024a189b3..8014bfcb80 100644 --- a/grunt/sauce_browsers.yml +++ b/grunt/sauce_browsers.yml @@ -5,11 +5,10 @@ browserName: "safari", platform: "OS X 10.9" }, - # { - # browserName: "chrome", - # platform: "OS X 10.9", - # version: "31" - # }, + { + browserName: "chrome", + platform: "OS X 10.9" + }, { browserName: "firefox", platform: "OS X 10.9" @@ -27,16 +26,16 @@ version: "10", platform: "Windows 8" }, - # { - # browserName: "internet explorer", - # version: "9", - # platform: "Windows 7" - # }, - # { - # browserName: "internet explorer", - # version: "8", - # platform: "Windows 7" - # }, + { + browserName: "internet explorer", + version: "9", + platform: "Windows 7" + }, + { + browserName: "internet explorer", + version: "8", + platform: "Windows 7" + }, # { # Unofficial # browserName: "internet explorer", diff --git a/grunt/shrinkwrap.js b/grunt/shrinkwrap.js deleted file mode 100644 index 270fcb7b16..0000000000 --- a/grunt/shrinkwrap.js +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * Bootstrap Grunt task for generating npm-shrinkwrap.canonical.json - * http://getbootstrap.com - * Copyright 2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -/* -This Grunt task updates the npm-shrinkwrap.canonical.json file that's used as the key for Bootstrap's npm packages cache. -This task should be run and the updated file should be committed whenever Bootstrap's dependencies change. -*/ -'use strict'; -var canonicallyJsonStringify = require('canonical-json'); -var NON_CANONICAL_FILE = 'npm-shrinkwrap.json'; -var DEST_FILE = 'test-infra/npm-shrinkwrap.canonical.json'; - - -function cleanup(shrinkwrap) { - // Remove `resolved` property to avoid irrelevant changes - // See https://github.com/npm/npm/issues/3581 - if (typeof shrinkwrap === 'string') { - return shrinkwrap; - } - delete shrinkwrap.resolved; - for (var key in shrinkwrap) { - shrinkwrap[key] = cleanup(shrinkwrap[key]); - } - return shrinkwrap; -} - -function updateShrinkwrap(grunt) { - // Assumption: Non-canonical shrinkwrap already generated by prerequisite Grunt task - var shrinkwrapData = grunt.file.readJSON(NON_CANONICAL_FILE); - grunt.log.writeln('Deleting ' + NON_CANONICAL_FILE.cyan + '...'); - grunt.file.delete(NON_CANONICAL_FILE); - // Output as Canonical JSON in correct location - grunt.file.write(DEST_FILE, canonicallyJsonStringify(cleanup(shrinkwrapData))); - grunt.log.writeln('File ' + DEST_FILE.cyan + ' updated.'); -} - - -module.exports = updateShrinkwrap; |