Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
minor rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Isao Yagi committed Dec 3, 2012
1 parent 7c9d7f2 commit 042cf4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lib/app/commands/build/hybridapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

var path = require('path'),
fn = require('./shared'),
fl;
wr; // writer.js file system related functions or test stub


function copyProperties(from, into) {
Expand All @@ -23,7 +23,7 @@ function copyProperties(from, into) {
function mungePackageJson(conf, to) {
var name = 'package.json',
file = path.join(conf.app.dir, name),
data = JSON.parse(fl.read(file));
data = JSON.parse(wr.read(file));

if (!data.hasOwnProperty('dependencies')) {
data.dependencies = conf.snapshot.packages;
Expand All @@ -35,7 +35,7 @@ function mungePackageJson(conf, to) {
delete data.dependencies.mojito;
}

fl.writeJson(path.join(to, name), data);
wr.writeJson(path.join(to, name), data);
}

/**
Expand All @@ -51,7 +51,7 @@ function makeSnapshot(conf) {
};

snap.packages[conf.app.name] = conf.app.version;
fl.writeJson(file, snap);
wr.writeJson(file, snap);
}

/**
Expand All @@ -60,7 +60,7 @@ function makeSnapshot(conf) {
* @param {Object} scraper
*/
function Hybridapp(writer, scraper) {
fl = writer;
wr = writer;
fn.init(writer);
this.scraper = scraper;
}
Expand Down
12 changes: 6 additions & 6 deletions lib/app/commands/build/shared.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*jslint node:true */
'use strict';

var fl,
var wr, // writer.js file system related functions or test stub
path = require('path'),
STORE_EXT_RE = /\.(css|js|json)$/i,
MUNGE_EXT_RE = /\.html?$/i;


function init(writer) {
fl = writer; // module ./writer.js containing static filesystem functions
wr = writer; // module ./writer.js containing static filesystem functions
}

function copydir(from, to) {
fl.copydir(from, to);
wr.copydir(from, to);
}

function copyModule(src_dir, module_name, dest_dir) {
Expand All @@ -31,7 +31,7 @@ function mapStoreUris(buildmap, conf, storemap) {
} else {
from = storemap[uri]; // source mojito app filesystem path
to = path.join(conf.build.dir, uri);
fl.copy(from, to);
wr.copy(from, to);
}
});
}
Expand Down Expand Up @@ -83,7 +83,7 @@ function makeManifest(uris, dir, stamp) {
Object.keys(uris).forEach(function (i) {
lines.push(uris[i]);
});
fl.write(path.join(dir, 'cache.manifest'), lines.join("\n"));
wr.write(path.join(dir, 'cache.manifest'), lines.join("\n"));
}

function injectManifestAttr(uri, str) {
Expand Down Expand Up @@ -126,7 +126,7 @@ function mungePage(conf, mapuri, contents) {
}
}

fl.write(file, contents);
wr.write(file, contents);
}

module.exports = {
Expand Down

0 comments on commit 042cf4f

Please sign in to comment.