Skip to content

Commit

Permalink
#4 saving options as a class var
Browse files Browse the repository at this point in the history
  • Loading branch information
tracend committed Jun 18, 2013
1 parent 57b6ade commit b573bc5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ var Main = function(){

Main.prototype = {

options: {},

queue: [],

icon: function( source, options ){
// merge with defaults
options = extend( defaults, ( options || {} ) );
this.options = extend( defaults, ( options || {} ) );
// load sizes from options
var sizes = options.icons;
var sizes = this.options.icons;
// get (or create) the destination dir
var destdir = path.join( dir( source ), options.output, "icon/");
var destdir = path.join( dir( source ), this.options.output, "icon/");
check( destdir );
// create the queue based on the sizes
for( var i in sizes ){
Expand All @@ -30,11 +32,11 @@ Main.prototype = {

splash: function( source, options ){
// merge with defaults
options = extend( defaults, ( options || {} ) );
this.options = extend( defaults, ( options || {} ) );
// load sizes from options
var sizes = options.splash;
var sizes = this.options.splash;
// get (or create) the destination dir
var destdir = path.join( dir( source ), options.output, "splash/");
var destdir = path.join( dir( source ), this.options.output, "splash/");
check( destdir );
// create the queue based on the sizes
for( var i in sizes ){
Expand Down

0 comments on commit b573bc5

Please sign in to comment.