Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Commit 61ef4d7

Browse files
committed
Get rid of direct references to config.json
1 parent b67abfa commit 61ef4d7

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

builder/object_factory.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
var patternEngines = require('./pattern_engines/pattern_engines');
1515
var path = require('path');
1616
var fs = require('fs-extra');
17-
var config = fs.readJSONSync('./config.json');
1817
var extend = require('util')._extend;
1918

2019
// oPattern properties
@@ -52,9 +51,6 @@
5251
// render method on oPatterns; this acts as a proxy for the PatternEngine's
5352
// render function
5453
render: function (data, partials) {
55-
if (config.debug && this.isPseudoPattern) {
56-
console.log('===', this.name + ' IS A PSEUDO-PATTERN ===');
57-
}
5854
return this.engine.renderPattern(this.extendedTemplate, data || this.jsonFileData, partials);
5955
},
6056

builder/pattern_assembler.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
plutils = require('./utilities'),
1919
patternEngines = require('./pattern_engines/pattern_engines');
2020

21-
var config = fs.readJSONSync('./config.json');
22-
2321
function setState(pattern, patternlab){
2422
if(patternlab.config.patternStates && patternlab.config.patternStates[pattern.patternName]){
2523
pattern.patternState = patternlab.config.patternStates[pattern.patternName];
@@ -56,16 +54,10 @@
5654
// if we've been passed a full oPattern, it knows what kind of template it
5755
// is, and how to render itself, so we just call its render method
5856
if (pattern instanceof of.oPattern) {
59-
if (config.debug) {
60-
console.log('rendering full oPattern: ' + pattern.name);
61-
}
6257
return pattern.render(data, partials);
6358
} else {
6459
// otherwise, assume it's a plain mustache template string and act
6560
// accordingly
66-
if (config.debug) {
67-
console.log('rendering plain mustache string:', pattern.substring(0, 20) + '...');
68-
}
6961
return patternEngines.mustache.renderPattern(pattern, data, partials);
7062
}
7163
}
@@ -76,10 +68,6 @@
7668
var filename = path.basename(file);
7769
var ext = path.extname(filename);
7870

79-
if (config.debug) {
80-
console.log('processPatternIterative:', filename);
81-
}
82-
8371
// skip non-pattern files
8472
if (!patternEngines.isPatternFile(filename, patternlab)) { return null; }
8573

0 commit comments

Comments
 (0)