summaryrefslogtreecommitdiff
path: root/bower_components/bootstrap/grunt
diff options
context:
space:
mode:
authorThomas Park <thomas@thomaspark.me>2014-06-27 01:07:56 -0400
committerThomas Park <thomas@thomaspark.me>2014-06-27 01:07:56 -0400
commitf3189e26cff5142e200568a81ef3db608530cc6f (patch)
tree00efe6915ac2ca82e175dbdcb15085b2e90c5ca6 /bower_components/bootstrap/grunt
parent25f107274a4a05e2be8d1c0a7ae77c19f8da5fa9 (diff)
3.1.1 -> 3.2.0
Diffstat (limited to 'bower_components/bootstrap/grunt')
-rw-r--r--bower_components/bootstrap/grunt/bs-glyphicons-data-generator.js17
-rw-r--r--bower_components/bootstrap/grunt/bs-lessdoc-parser.js2
-rw-r--r--bower_components/bootstrap/grunt/bs-raw-files-generator.js33
-rw-r--r--bower_components/bootstrap/grunt/sauce_browsers.yml82
-rw-r--r--bower_components/bootstrap/grunt/shrinkwrap.js28
5 files changed, 119 insertions, 43 deletions
diff --git a/bower_components/bootstrap/grunt/bs-glyphicons-data-generator.js b/bower_components/bootstrap/grunt/bs-glyphicons-data-generator.js
index 16a0ca2a..82dc727b 100644
--- a/bower_components/bootstrap/grunt/bs-glyphicons-data-generator.js
+++ b/bower_components/bootstrap/grunt/bs-glyphicons-data-generator.js
@@ -7,18 +7,19 @@
'use strict';
var fs = require('fs');
-module.exports = function generateGlyphiconsData() {
+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 glpyhiconsLines = glyphiconsFile.split('\n');
+ 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';
- for (var i = 0, len = glpyhiconsLines.length; i < len; i++) {
- var match = glpyhiconsLines[i].match(iconClassName);
+ 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';
@@ -30,5 +31,11 @@ module.exports = function generateGlyphiconsData() {
fs.mkdirSync('docs/_data');
}
- fs.writeFileSync('docs/_data/glyphicons.yml', glyphiconsData);
+ try {
+ fs.writeFileSync(glyphiconsYml, glyphiconsData);
+ }
+ catch (err) {
+ grunt.fail.warn(err);
+ }
+ grunt.log.writeln('File ' + glyphiconsYml.cyan + ' created.');
};
diff --git a/bower_components/bootstrap/grunt/bs-lessdoc-parser.js b/bower_components/bootstrap/grunt/bs-lessdoc-parser.js
index 5a86f13a..c1821de1 100644
--- a/bower_components/bootstrap/grunt/bs-lessdoc-parser.js
+++ b/bower_components/bootstrap/grunt/bs-lessdoc-parser.js
@@ -22,7 +22,7 @@ Mini-language:
//=== This is a subheading.
//** Optional description for the following variable. You **can** use Markdown in descriptions to discuss `<html>` stuff.
- @foo: #ffff;
+ @foo: #fff;
//-- This is a heading for a section whose variables shouldn't be customizable
diff --git a/bower_components/bootstrap/grunt/bs-raw-files-generator.js b/bower_components/bootstrap/grunt/bs-raw-files-generator.js
index b5b33093..ec8c5314 100644
--- a/bower_components/bootstrap/grunt/bs-raw-files-generator.js
+++ b/bower_components/bootstrap/grunt/bs-raw-files-generator.js
@@ -1,31 +1,46 @@
-/* global btoa: true */
/*!
* Bootstrap Grunt task for generating raw-files.min.js for the Customizer
* http://getbootstrap.com
* Copyright 2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
+
+/* global btoa: true */
+
'use strict';
-var btoa = require('btoa');
var fs = require('fs');
+var btoa = require('btoa');
+var glob = require('glob');
function getFiles(type) {
var files = {};
- fs.readdirSync(type)
+ var recursive = (type === 'less');
+ var globExpr = (recursive ? '/**/*' : '/*');
+ glob.sync(type + globExpr)
.filter(function (path) {
return type === 'fonts' ? true : new RegExp('\\.' + type + '$').test(path);
})
- .forEach(function (path) {
- var fullPath = type + '/' + path;
- files[path] = (type === 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8'));
+ .forEach(function (fullPath) {
+ var relativePath = fullPath.replace(/^[^/]+\//, '');
+ files[relativePath] = (type === 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8'));
});
return 'var __' + type + ' = ' + JSON.stringify(files) + '\n';
}
-module.exports = function generateRawFilesJs(banner) {
+module.exports = function generateRawFilesJs(grunt, banner) {
if (!banner) {
banner = '';
}
- var files = banner + getFiles('js') + getFiles('less') + getFiles('fonts');
- fs.writeFileSync('docs/assets/js/raw-files.min.js', files);
+ var dirs = ['js', 'less', 'fonts'];
+ var files = banner + dirs.map(getFiles).reduce(function (combined, file) {
+ return combined + file;
+ }, '');
+ var rawFilesJs = 'docs/assets/js/raw-files.min.js';
+ try {
+ fs.writeFileSync(rawFilesJs, files);
+ }
+ catch (err) {
+ grunt.fail.warn(err);
+ }
+ grunt.log.writeln('File ' + rawFilesJs.cyan + ' created.');
};
diff --git a/bower_components/bootstrap/grunt/sauce_browsers.yml b/bower_components/bootstrap/grunt/sauce_browsers.yml
new file mode 100644
index 00000000..8014bfcb
--- /dev/null
+++ b/bower_components/bootstrap/grunt/sauce_browsers.yml
@@ -0,0 +1,82 @@
+[
+ # Docs: https://saucelabs.com/docs/platforms/webdriver
+
+ {
+ browserName: "safari",
+ platform: "OS X 10.9"
+ },
+ {
+ browserName: "chrome",
+ platform: "OS X 10.9"
+ },
+ {
+ browserName: "firefox",
+ platform: "OS X 10.9"
+ },
+
+ # Mac Opera not currently supported by Sauce Labs
+
+ {
+ browserName: "internet explorer",
+ version: "11",
+ platform: "Windows 8.1"
+ },
+ {
+ browserName: "internet explorer",
+ version: "10",
+ platform: "Windows 8"
+ },
+ {
+ browserName: "internet explorer",
+ version: "9",
+ platform: "Windows 7"
+ },
+ {
+ browserName: "internet explorer",
+ version: "8",
+ platform: "Windows 7"
+ },
+
+ # { # Unofficial
+ # browserName: "internet explorer",
+ # version: "7",
+ # platform: "Windows XP"
+ # },
+
+ {
+ browserName: "chrome",
+ platform: "Windows 8.1"
+ },
+ {
+ browserName: "firefox",
+ platform: "Windows 8.1"
+ },
+
+ # Win Opera 15+ not currently supported by Sauce Labs
+
+ {
+ browserName: "iphone",
+ platform: "OS X 10.9",
+ version: "7.1"
+ },
+
+ # iOS Chrome not currently supported by Sauce Labs
+
+ # Linux (unofficial)
+ {
+ browserName: "chrome",
+ platform: "Linux"
+ },
+ {
+ browserName: "firefox",
+ platform: "Linux"
+ }
+
+ # Android Chrome not currently supported by Sauce Labs
+
+ # { # Android Browser (super-unofficial)
+ # browserName: "android",
+ # version: "4.0",
+ # platform: "Linux"
+ # }
+]
diff --git a/bower_components/bootstrap/grunt/shrinkwrap.js b/bower_components/bootstrap/grunt/shrinkwrap.js
deleted file mode 100644
index d3292b49..00000000
--- a/bower_components/bootstrap/grunt/shrinkwrap.js
+++ /dev/null
@@ -1,28 +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 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(shrinkwrapData));
- grunt.log.writeln('File ' + DEST_FILE.cyan + ' updated.');
-}
-
-
-module.exports = updateShrinkwrap;