Skip to content

Commit

Permalink
lib/svgo/
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsweet committed Nov 9, 2012
1 parent c633d71 commit aa10a8b
Show file tree
Hide file tree
Showing 18 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bin/svgo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require('../lib/coa').run();
require('../lib/svgo/coa').run();
8 changes: 4 additions & 4 deletions lib/svgo.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
*/

var INHERIT = require('inherit'),
CONFIG = require('./config'),
SVG2JS = require('./svg2js'),
PLUGINS = require('./plugins'),
JS2SVG = require('./js2svg');
CONFIG = require('./svgo/config'),
SVG2JS = require('./svgo/svg2js'),
PLUGINS = require('./svgo/plugins'),
JS2SVG = require('./svgo/js2svg');

/**
* @class SVGO.
Expand Down
4 changes: 2 additions & 2 deletions lib/coa.js → lib/svgo/coa.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var Q = require('q'),
FS = require('fs'),
UTIL = require('util'),
SVGO = require('./svgo'),
info = JSON.parse(require('fs').readFileSync(__dirname + '/../package.json')),
SVGO = require('../svgo'),
info = JSON.parse(require('fs').readFileSync(__dirname + '/../../package.json')),
datauriPrefix = 'data:image/svg+xml;base64,';

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/config.js → lib/svgo/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = function(params) {
*/
function _getConfig(params) {

var defaultConfigPath = PATH.resolve(__dirname, '../config.yml');
var defaultConfigPath = PATH.resolve(__dirname, '../../config.yml');

// if there are no any params then return default config
if (!params) return readConfig(defaultConfigPath);
Expand Down Expand Up @@ -129,7 +129,7 @@ function readConfig(path) {
function preparePluginsArray(plugins) {

return plugins.map(function(plugin) {
plugin.fn = require('../plugins/' + plugin.name)[plugin.name];
plugin.fn = require('../../plugins/' + plugin.name)[plugin.name];

return [plugin];
});
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion plugins/collapseGroups.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var flattenOneLevel = require('../lib/tools').flattenOneLevel;
var flattenOneLevel = require('../lib/svgo/tools').flattenOneLevel;

/*
* Collapse useless groups.
Expand Down
2 changes: 1 addition & 1 deletion plugins/convertPathData.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var cleanupOutData = require('../lib/tools').cleanupOutData,
var cleanupOutData = require('../lib/svgo/tools').cleanupOutData,
regPathInstructions = /([MmLlHhVvCcSsQqTtAaZz])\s*/,
regPathData = /(?=-)|[\s,]+/,
pathElems = ['path', 'glyph', 'missing-glyph'];
Expand Down
2 changes: 1 addition & 1 deletion plugins/convertStyleToAttrs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var extend = require('../lib/tools').extend,
var extend = require('../lib/svgo/tools').extend,
stylingProps = require('./_collections').stylingProps,
regCleanupStyle = /(:|;)\s+/g;

Expand Down
2 changes: 1 addition & 1 deletion plugins/convertTransform.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var cleanupOutData = require('../lib/tools').cleanupOutData,
var cleanupOutData = require('../lib/svgo/tools').cleanupOutData,
regTransformTypes = /matrix|translate|scale|rotate|skewX|skewY/,
regTransformSplit = /(matrix|translate|scale|rotate|skewX|skewY)\s*\((.+?)\)[\s,]*/,
regTransformDataSplit = /[\s,]+/;
Expand Down
2 changes: 1 addition & 1 deletion plugins/moveElemsAttrsToGroup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var intersectAttrs = require('../lib/tools').intersectAttrs;
var intersectAttrs = require('../lib/svgo/tools').intersectAttrs;

/**
* Collapse content's intersected attributes to the existing group wrapper.
Expand Down
2 changes: 1 addition & 1 deletion test/config/_index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var cover = process.argv[3] === 'mocha-istanbul',
config = require(cover ? '../../lib-cov/config' : '../../lib/config');
config = require(cover ? '../../lib-cov/svgo/config' : '../../lib/svgo/config');

function getPlugin(name, config) {

Expand Down
2 changes: 1 addition & 1 deletion test/svg2js/_index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var cover = process.argv[3] === 'mocha-istanbul',
svg2js = require(cover ? '../../lib-cov/svg2js' : '../../lib/svg2js');
svg2js = require(cover ? '../../lib-cov/svgo/svg2js' : '../../lib/svgo/svg2js');

describe('svg2js', function() {

Expand Down

0 comments on commit aa10a8b

Please sign in to comment.