<commit_before>'use strict';

/*
 *
 * The key parameter 'pack'
 * The supplied 'custom_prelude.js' file is needed for 
 * .load function of soop.
 */

var fs = require('fs');
var browserify = require('browserify');
var browserPack = require('browser-pack');
var program = require('commander');

// concat browser vendor files
var exec = require('child_process').exec;
var sys = require('sys');
var puts = function(error, stdout, stderr) {
  if (error) console.log(error);
  sys.puts(stdout);
  sys.puts(stderr);
};

exec('cd browser; sh concat.sh', puts);

var list = function(val) {
  return val.split(',');
};

program
  .version('0.0.1')
  .option('-a, --includeall', 'Include all submodules.')
  .option('-d, --dontminify', 'Don\'t minify the code.')
  .option('-s, --submodules <items>', 'Include the listed comma-separated submodules.', list)
  .parse(process.argv);

if (!program.includeall && (!program.submodules || program.submodules.length === 0)) {
  console.log('Must use either -s or -a option. For more info use the --help option');
  process.exit(1);
}

var pack = function (params) {
  var preludePath  = 'node_modules/soop/example/custom_prelude.js';
  params.raw = true;
  params.sourceMapPrefix = '//#';
  params.prelude = fs.readFileSync(preludePath, 'utf8');
  params.preludePath = preludePath;
  return browserPack(params);
};

var modules = [
  'Address',
  'Block',
  'Bloom',
  'Buffers.monkey',
  'Connection',
  'Deserialize',
  'Gruntfile',
  'Number.monkey',
  'Opcode',
  'Peer',
  'PeerManager',
  'PrivateKey',
  'RpcClient',
  'Key',<commit_msg>soop may not be in the bitcore directory<commit_after>'use strict';

/*
 *
 * The key parameter 'pack'
 * The supplied 'custom_prelude.js' file is needed for 
 * .load function of soop.
 */

var fs = require('fs');
var browserify = require('browserify');
var browserPack = require('browser-pack');
var program = require('commander');

// concat browser vendor files
var exec = require('child_process').exec;
var sys = require('sys');
var puts = function(error, stdout, stderr) {
  if (error) console.log(error);
  sys.puts(stdout);
  sys.puts(stderr);
};

exec('cd browser; sh concat.sh', puts);

var list = function(val) {
  return val.split(',');
};

program
  .version('0.0.1')
  .option('-a, --includeall', 'Include all submodules.')
  .option('-d, --dontminify', 'Don\'t minify the code.')
  .option('-s, --submodules <items>', 'Include the listed comma-separated submodules.', list)
  .parse(process.argv);

if (!program.includeall && (!program.submodules || program.submodules.length === 0)) {
  console.log('Must use either -s or -a option. For more info use the --help option');
  process.exit(1);
}

var pack = function (params) {
  var file = require.resolve('soop');
  var dir = file.substr(0, file.length - String('soop.js').length);
  var preludePath = dir + 'example/custom_prelude.js';
  params.raw = true;
  params.sourceMapPrefix = '//#';
  params.prelude = fs.readFileSync(preludePath, 'utf8');
  params.preludePath = preludePath;
  return browserPack(params);
};

var modules = [
  'Address',
  'Block',
  'Bloom',
  'Buffers.monkey',
  'Connection',
  'Deserialize',
  'Gruntfile',
  'Number.monkey',
  'Opcode',
  'Peer',
  'PeerManager',
  'PrivateKey',
  'RpcClient',
  'Key',
{'fraction_non_alphanumeric': 0.1774390243902439, 'fraction_numerical': 0.0039634146341463415, 'mean_word_length': 4.110591900311526, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2921121', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1141, 'n_words': 285}