couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject [32/50] git commit: remove templating configuration from grunt.js
Date Fri, 15 Mar 2013 21:50:08 GMT
remove templating configuration from grunt.js


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/fe6da475
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/fe6da475
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/fe6da475

Branch: refs/heads/fauxton-rebase
Commit: fe6da4751851144aa0826406113bc0ecdb90d906
Parents: 9777f43
Author: Simon Metson <simon+github@cloudant.com>
Authored: Mon Mar 11 15:30:04 2013 +0000
Committer: Russell Branca <chewbranca@gmail.com>
Committed: Fri Mar 15 14:35:41 2013 -0700

----------------------------------------------------------------------
 src/fauxton/grunt.js              |   64 ++++++++-----------------------
 src/fauxton/settings.json.default |   11 +++++-
 2 files changed, 27 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/fe6da475/src/fauxton/grunt.js
----------------------------------------------------------------------
diff --git a/src/fauxton/grunt.js b/src/fauxton/grunt.js
index 8abdd02..08c95af 100644
--- a/src/fauxton/grunt.js
+++ b/src/fauxton/grunt.js
@@ -68,6 +68,22 @@ module.exports = function(grunt) {
     return theAssets;
   }();
 
+  var templateSettings = function(){
+    var defaultSettings = {
+      "template": {
+        "src": "assets/index.underscore",
+        "dest": "dist/debug/index.html",
+        "variables": {
+          "assets_root": "./",
+          "requirejs": "require.js",
+          "base": null
+        }
+      }
+    };
+    var settings = grunt.file.readJSON("settings.json") || defaultSettings;
+    return {template: settings.template};
+  }();
+
   grunt.initConfig({
 
     // The clean task ensures all files are removed from the dist/ directory so
@@ -119,53 +135,7 @@ module.exports = function(grunt) {
 
     // Create static html files from templates, for managing change of script
     // or css name.
-    template: {
-      couchdb:{
-        src: 'assets/index.underscore',
-        dest: '../../share/www/fauxton/index.html',
-        variables: {
-          assets_root: '/_utils/fauxton/',
-          requirejs: 'require.min.js',
-          base: '/_utils/fauxton/'
-        }
-      },
-      couchdebug:{
-        src: 'assets/index.underscore',
-        dest: '../../share/www/fauxton/index.html',
-        variables: {
-          assets_root: '/_utils/fauxton/',
-          requirejs: 'require.js',
-          base: '/_utils/fauxton/'
-        }
-      },
-      release: {
-        src: 'assets/index.underscore',
-        dest: 'dist/release/index.html',
-        variables: {
-          assets_root: '/',
-          requirejs: 'require.min.js',
-          base: '/'
-        }
-      },
-      debug: {
-        src: 'assets/index.underscore',
-        dest: 'dist/debug/index.html',
-        variables: {
-          assets_root: '/',
-          requirejs: 'require.js',
-          base: '/'
-        }
-      },
-      couchapp: {
-        src: 'assets/index.underscore',
-        dest: 'dist/debug/index.html',
-        variables: {
-          assets_root: './',
-          requirejs: 'require.js',
-          base: null
-        }
-      }
-    },
+    template: templateSettings,
 
     // The concatenate task is used here to merge the almond require/define
     // shim and the templates into the application code.  It's named

http://git-wip-us.apache.org/repos/asf/couchdb/blob/fe6da475/src/fauxton/settings.json.default
----------------------------------------------------------------------
diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default
index 01c04a4..32cd774 100644
--- a/src/fauxton/settings.json.default
+++ b/src/fauxton/settings.json.default
@@ -4,5 +4,14 @@
     { "name": "logs" },
     { "name": "stats" },
     { "name": "contribute" }
-  ]
+  ],
+  "template": {
+    "src": "assets/index.underscore",
+    "dest": "dist/debug/index.html",
+    "variables": {
+      "assets_root": "./",
+      "requirejs": "require.js",
+      "base": null
+    }
+  }
 }


Mime
View raw message