<commit_before>/*******************************************************************************
 * @license
 * Copyright (c) 2013 VMware, Inc. All Rights Reserved.
 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
 * You can obtain a current copy of the Eclipse Public License from
 * http://www.opensource.org/licenses/eclipse-1.0.php
 *
 * Contributors:
 *   <NAME>
 ******************************************************************************/

//
// A start script to run scripted server on cloudfoundry
//


var path = require('path');

var nodefs = require('fs');
var mappedFs = require('../server/plugable-fs/mapped-fs');
var scriptedFs = require('../server/plugable-fs/scripted-fs');
var githubFs = require('../server/plugable-fs/github-fs');
var compose = require('../server/plugable-fs/composite-fs').compose;

var withBaseDir = mappedFs.withBaseDir;
var withPrefix = mappedFs.withPrefix;

var scriptedHomeLocation = path.resolve(__dirname, '..');

var sandbox = mappedFs.withBaseDir(path.resolve(__dirname, '../sandbox'));

var github = withPrefix('/github', githubFs.configure(
	JSON.parse(nodefs.readFileSync(__dirname+'/../secret.json'))
));

var scriptedHome = withPrefix('/scripted.home', compose(
	withPrefix('/plugins', withBaseDir(scriptedHomeLocation + '/plugins')),
	withPrefix('/completions', withBaseDir(scriptedHomeLocation + '/completions'))
));

//All of our files, with the 'slim' node-like fs API:
var corefs = compose(
	sandbox,
	github,
	scriptedHome
);

//Now wrap that to create our 'fat' API that scripted uses throughout its codebase.
var filesystem = scriptedFs.configure(corefs, {
	userHome: '/user.home',
	scriptedHome: '/scripted.home'
});
<commit_msg>Add scripted/client to 'scripted.home' filesystem so plugin content assist works on CF.<commit_after>/*******************************************************************************
 * @license
 * Copyright (c) 2013 VMware, Inc. All Rights Reserved.
 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
 * You can obtain a current copy of the Eclipse Public License from
 * http://www.opensource.org/licenses/eclipse-1.0.php
 *
 * Contributors:
 *   <NAME>
 ******************************************************************************/

//
// A start script to run scripted server on cloudfoundry
//


var path = require('path');

var nodefs = require('fs');
var mappedFs = require('../server/plugable-fs/mapped-fs');
var scriptedFs = require('../server/plugable-fs/scripted-fs');
var githubFs = require('../server/plugable-fs/github-fs');
var compose = require('../server/plugable-fs/composite-fs').compose;
var readOnly = require('../server/plugable-fs/read-only-fs');

var withBaseDir = mappedFs.withBaseDir;
var withPrefix = mappedFs.withPrefix;

var scriptedHomeLocation = path.resolve(__dirname, '..');

var sandbox = mappedFs.withBaseDir(path.resolve(__dirname, '../sandbox'));

var github = withPrefix('/github', githubFs.configure(
	JSON.parse(nodefs.readFileSync(__dirname+'/../secret.json'))
));

var scriptedHome = withPrefix('/scripted.home', readOnly(compose(
	//Needed to load built-in plugins
	withPrefix('/plugins', withBaseDir(scriptedHomeLocation + '/plugins')),
	//Needed to load built-in completions:
	withPrefix('/completions', withBaseDir(scriptedHomeLocation + '/completions')),
	//Needed to provide content assist for plugin APIs:
	withPrefix('/client', withBaseDir(scriptedHomeLocation + '/client'))
)));

//All of our files, with the 'slim' node-like fs API:
var corefs = compose(
	sandbox,
	scriptedHome,
	github
);

//Now wrap that to create our 'fat' API that scripted uses throughout its codebase.
var filesystem = scriptedFs.configure(corefs, {
	userHome: '/user.home',
	scriptedHome: '/scripted.home'
});

{'fraction_non_alphanumeric': 0.2085095794973874, 'fraction_numerical': 0.002985817367504354, 'mean_word_length': 5.100151745068286, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5276553', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1159, 'n_words': 323}