professiaonl mover

This commit is contained in:
Peter Cottle 2012-12-27 13:48:35 -08:00
parent a9d14521de
commit e30130b28d
3 changed files with 178 additions and 222 deletions

View file

@ -10996,6 +10996,8 @@ var Errors = require('../util/errors');
var GitCommands = require('../git/commands'); var GitCommands = require('../git/commands');
var GitOptionParser = GitCommands.GitOptionParser; var GitOptionParser = GitCommands.GitOptionParser;
var sandboxInstantCommands = require('../level/sandboxCommands').sandboxInstantCommands;
var CommandProcessError = Errors.CommandProcessError; var CommandProcessError = Errors.CommandProcessError;
var GitError = Errors.GitError; var GitError = Errors.GitError;
var Warning = Errors.Warning; var Warning = Errors.Warning;
@ -11091,77 +11093,6 @@ var Command = Backbone.Model.extend({
this.set('result', this.get('error').toResult()); this.set('result', this.get('error').toResult());
}, },
getSandboxCommands: function() {
return [
[/^ls/, function() {
throw new CommandResult({
msg: "DontWorryAboutFilesInThisDemo.txt"
});
}],
[/^cd/, function() {
throw new CommandResult({
msg: "Directory Changed to '/directories/dont/matter/in/this/demo'"
});
}],
[/^git help($|\s)/, function() {
// sym link this to the blank git command
var allCommands = Command.prototype.getSandboxCommands();
// wow this is hacky :(
var equivalent = 'git';
_.each(allCommands, function(bits) {
var regex = bits[0];
if (regex.test(equivalent)) {
bits[1]();
}
});
}],
[/^git$/, function() {
var lines = [
'Git Version PCOTTLE.1.0',
'<br/>',
'Usage:',
_.escape('\t git <command> [<args>]'),
'<br/>',
'Supported commands:',
'<br/>'
];
var commands = GitOptionParser.prototype.getMasterOptionMap();
// build up a nice display of what we support
_.each(commands, function(commandOptions, command) {
lines.push('git ' + command);
_.each(commandOptions, function(vals, optionName) {
lines.push('\t ' + optionName);
}, this);
}, this);
// format and throw
var msg = lines.join('\n');
msg = msg.replace(/\t/g, '&nbsp;&nbsp;&nbsp;');
throw new CommandResult({
msg: msg
});
}],
[/^refresh$/, function() {
var events = require('../app').getEvents();
events.trigger('refreshTree');
throw new CommandResult({
msg: "Refreshing tree..."
});
}],
[/^rollup (\d+)$/, function(bits) {
var events = require('../app').getEvents();
// go roll up these commands by joining them with semicolons
events.trigger('rollupCommands', bits[1]);
throw new CommandResult({
msg: 'Commands combined!'
});
}]
];
},
parse: function() { parse: function() {
var str = this.get('rawStr'); var str = this.get('rawStr');
// first if the string is empty, they just want a blank line // first if the string is empty, they just want a blank line
@ -11173,7 +11104,7 @@ var Command = Backbone.Model.extend({
this.set('rawStr', str); this.set('rawStr', str);
// then check if it's one of our sandbox commands // then check if it's one of our sandbox commands
_.each(this.getSandboxCommands(), function(tuple) { _.each(sandboxInstantCommands, function(tuple) {
var regex = tuple[0]; var regex = tuple[0];
var results = regex.exec(str); var results = regex.exec(str);
if (results) { if (results) {
@ -11380,6 +11311,90 @@ exports.GitOptionParser = GitOptionParser;
}); });
require.define("/src/js/level/sandboxCommands.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
var GitCommands = require('../git/commands');
var GitOptionParser = GitCommands.GitOptionParser;
var Errors = require('../util/errors');
var CommandProcessError = Errors.CommandProcessError;
var GitError = Errors.GitError;
var Warning = Errors.Warning;
var CommandResult = Errors.CommandResult;
var sandboxInstantCommands = [
[/^ls/, function() {
throw new CommandResult({
msg: "DontWorryAboutFilesInThisDemo.txt"
});
}],
[/^cd/, function() {
throw new CommandResult({
msg: "Directory Changed to '/directories/dont/matter/in/this/demo'"
});
}],
[/^git help($|\s)/, function() {
// sym link this to the blank git command
var allCommands = Command.prototype.getSandboxCommands();
// wow this is hacky :(
var equivalent = 'git';
_.each(allCommands, function(bits) {
var regex = bits[0];
if (regex.test(equivalent)) {
bits[1]();
}
});
}],
[/^git$/, function() {
var lines = [
'Git Version PCOTTLE.1.0',
'<br/>',
'Usage:',
_.escape('\t git <command> [<args>]'),
'<br/>',
'Supported commands:',
'<br/>'
];
var commands = GitOptionParser.prototype.getMasterOptionMap();
// build up a nice display of what we support
_.each(commands, function(commandOptions, command) {
lines.push('git ' + command);
_.each(commandOptions, function(vals, optionName) {
lines.push('\t ' + optionName);
}, this);
}, this);
// format and throw
var msg = lines.join('\n');
msg = msg.replace(/\t/g, '&nbsp;&nbsp;&nbsp;');
throw new CommandResult({
msg: msg
});
}],
[/^refresh$/, function() {
var events = require('../app').getEvents();
events.trigger('refreshTree');
throw new CommandResult({
msg: "Refreshing tree..."
});
}],
[/^rollup (\d+)$/, function(bits) {
var events = require('../app').getEvents();
// go roll up these commands by joining them with semicolons
events.trigger('rollupCommands', bits[1]);
throw new CommandResult({
msg: 'Commands combined!'
});
}]
];
exports.sandboxInstantCommands = sandboxInstantCommands;
});
require.define("/src/js/app/index.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore'); require.define("/src/js/app/index.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
var Backbone = require('backbone'); var Backbone = require('backbone');
@ -13787,8 +13802,6 @@ function InputWaterfall(options) {
'git rebase': true 'git rebase': true
}; };
console.log('made');
this.listen(); this.listen();
} }
@ -16207,8 +16220,6 @@ function InputWaterfall(options) {
'git rebase': true 'git rebase': true
}; };
console.log('made');
this.listen(); this.listen();
} }
@ -16273,6 +16284,91 @@ exports.InputWaterfall = InputWaterfall;
}); });
require("/src/js/level/inputWaterfall.js"); require("/src/js/level/inputWaterfall.js");
require.define("/src/js/level/sandboxCommands.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
var GitCommands = require('../git/commands');
var GitOptionParser = GitCommands.GitOptionParser;
var Errors = require('../util/errors');
var CommandProcessError = Errors.CommandProcessError;
var GitError = Errors.GitError;
var Warning = Errors.Warning;
var CommandResult = Errors.CommandResult;
var sandboxInstantCommands = [
[/^ls/, function() {
throw new CommandResult({
msg: "DontWorryAboutFilesInThisDemo.txt"
});
}],
[/^cd/, function() {
throw new CommandResult({
msg: "Directory Changed to '/directories/dont/matter/in/this/demo'"
});
}],
[/^git help($|\s)/, function() {
// sym link this to the blank git command
var allCommands = Command.prototype.getSandboxCommands();
// wow this is hacky :(
var equivalent = 'git';
_.each(allCommands, function(bits) {
var regex = bits[0];
if (regex.test(equivalent)) {
bits[1]();
}
});
}],
[/^git$/, function() {
var lines = [
'Git Version PCOTTLE.1.0',
'<br/>',
'Usage:',
_.escape('\t git <command> [<args>]'),
'<br/>',
'Supported commands:',
'<br/>'
];
var commands = GitOptionParser.prototype.getMasterOptionMap();
// build up a nice display of what we support
_.each(commands, function(commandOptions, command) {
lines.push('git ' + command);
_.each(commandOptions, function(vals, optionName) {
lines.push('\t ' + optionName);
}, this);
}, this);
// format and throw
var msg = lines.join('\n');
msg = msg.replace(/\t/g, '&nbsp;&nbsp;&nbsp;');
throw new CommandResult({
msg: msg
});
}],
[/^refresh$/, function() {
var events = require('../app').getEvents();
events.trigger('refreshTree');
throw new CommandResult({
msg: "Refreshing tree..."
});
}],
[/^rollup (\d+)$/, function(bits) {
var events = require('../app').getEvents();
// go roll up these commands by joining them with semicolons
events.trigger('rollupCommands', bits[1]);
throw new CommandResult({
msg: 'Commands combined!'
});
}]
];
exports.sandboxInstantCommands = sandboxInstantCommands;
});
require("/src/js/level/sandboxCommands.js");
require.define("/src/js/models/collections.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore'); require.define("/src/js/models/collections.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
// horrible hack to get localStorage Backbone plugin // horrible hack to get localStorage Backbone plugin
var Backbone = (!require('../util').isBrowser()) ? Backbone = require('backbone') : Backbone = window.Backbone; var Backbone = (!require('../util').isBrowser()) ? Backbone = require('backbone') : Backbone = window.Backbone;
@ -16390,6 +16486,8 @@ var Errors = require('../util/errors');
var GitCommands = require('../git/commands'); var GitCommands = require('../git/commands');
var GitOptionParser = GitCommands.GitOptionParser; var GitOptionParser = GitCommands.GitOptionParser;
var sandboxInstantCommands = require('../level/sandboxCommands').sandboxInstantCommands;
var CommandProcessError = Errors.CommandProcessError; var CommandProcessError = Errors.CommandProcessError;
var GitError = Errors.GitError; var GitError = Errors.GitError;
var Warning = Errors.Warning; var Warning = Errors.Warning;
@ -16485,77 +16583,6 @@ var Command = Backbone.Model.extend({
this.set('result', this.get('error').toResult()); this.set('result', this.get('error').toResult());
}, },
getSandboxCommands: function() {
return [
[/^ls/, function() {
throw new CommandResult({
msg: "DontWorryAboutFilesInThisDemo.txt"
});
}],
[/^cd/, function() {
throw new CommandResult({
msg: "Directory Changed to '/directories/dont/matter/in/this/demo'"
});
}],
[/^git help($|\s)/, function() {
// sym link this to the blank git command
var allCommands = Command.prototype.getSandboxCommands();
// wow this is hacky :(
var equivalent = 'git';
_.each(allCommands, function(bits) {
var regex = bits[0];
if (regex.test(equivalent)) {
bits[1]();
}
});
}],
[/^git$/, function() {
var lines = [
'Git Version PCOTTLE.1.0',
'<br/>',
'Usage:',
_.escape('\t git <command> [<args>]'),
'<br/>',
'Supported commands:',
'<br/>'
];
var commands = GitOptionParser.prototype.getMasterOptionMap();
// build up a nice display of what we support
_.each(commands, function(commandOptions, command) {
lines.push('git ' + command);
_.each(commandOptions, function(vals, optionName) {
lines.push('\t ' + optionName);
}, this);
}, this);
// format and throw
var msg = lines.join('\n');
msg = msg.replace(/\t/g, '&nbsp;&nbsp;&nbsp;');
throw new CommandResult({
msg: msg
});
}],
[/^refresh$/, function() {
var events = require('../app').getEvents();
events.trigger('refreshTree');
throw new CommandResult({
msg: "Refreshing tree..."
});
}],
[/^rollup (\d+)$/, function(bits) {
var events = require('../app').getEvents();
// go roll up these commands by joining them with semicolons
events.trigger('rollupCommands', bits[1]);
throw new CommandResult({
msg: 'Commands combined!'
});
}]
];
},
parse: function() { parse: function() {
var str = this.get('rawStr'); var str = this.get('rawStr');
// first if the string is empty, they just want a blank line // first if the string is empty, they just want a blank line
@ -16567,7 +16594,7 @@ var Command = Backbone.Model.extend({
this.set('rawStr', str); this.set('rawStr', str);
// then check if it's one of our sandbox commands // then check if it's one of our sandbox commands
_.each(this.getSandboxCommands(), function(tuple) { _.each(sandboxInstantCommands, function(tuple) {
var regex = tuple[0]; var regex = tuple[0];
var results = regex.exec(str); var results = regex.exec(str);
if (results) { if (results) {

View file

@ -25,8 +25,6 @@ function InputWaterfall(options) {
'git rebase': true 'git rebase': true
}; };
console.log('made');
this.listen(); this.listen();
} }

View file

@ -6,6 +6,8 @@ var Errors = require('../util/errors');
var GitCommands = require('../git/commands'); var GitCommands = require('../git/commands');
var GitOptionParser = GitCommands.GitOptionParser; var GitOptionParser = GitCommands.GitOptionParser;
var sandboxInstantCommands = require('../level/sandboxCommands').sandboxInstantCommands;
var CommandProcessError = Errors.CommandProcessError; var CommandProcessError = Errors.CommandProcessError;
var GitError = Errors.GitError; var GitError = Errors.GitError;
var Warning = Errors.Warning; var Warning = Errors.Warning;
@ -101,77 +103,6 @@ var Command = Backbone.Model.extend({
this.set('result', this.get('error').toResult()); this.set('result', this.get('error').toResult());
}, },
getSandboxCommands: function() {
return [
[/^ls/, function() {
throw new CommandResult({
msg: "DontWorryAboutFilesInThisDemo.txt"
});
}],
[/^cd/, function() {
throw new CommandResult({
msg: "Directory Changed to '/directories/dont/matter/in/this/demo'"
});
}],
[/^git help($|\s)/, function() {
// sym link this to the blank git command
var allCommands = Command.prototype.getSandboxCommands();
// wow this is hacky :(
var equivalent = 'git';
_.each(allCommands, function(bits) {
var regex = bits[0];
if (regex.test(equivalent)) {
bits[1]();
}
});
}],
[/^git$/, function() {
var lines = [
'Git Version PCOTTLE.1.0',
'<br/>',
'Usage:',
_.escape('\t git <command> [<args>]'),
'<br/>',
'Supported commands:',
'<br/>'
];
var commands = GitOptionParser.prototype.getMasterOptionMap();
// build up a nice display of what we support
_.each(commands, function(commandOptions, command) {
lines.push('git ' + command);
_.each(commandOptions, function(vals, optionName) {
lines.push('\t ' + optionName);
}, this);
}, this);
// format and throw
var msg = lines.join('\n');
msg = msg.replace(/\t/g, '&nbsp;&nbsp;&nbsp;');
throw new CommandResult({
msg: msg
});
}],
[/^refresh$/, function() {
var events = require('../app').getEvents();
events.trigger('refreshTree');
throw new CommandResult({
msg: "Refreshing tree..."
});
}],
[/^rollup (\d+)$/, function(bits) {
var events = require('../app').getEvents();
// go roll up these commands by joining them with semicolons
events.trigger('rollupCommands', bits[1]);
throw new CommandResult({
msg: 'Commands combined!'
});
}]
];
},
parse: function() { parse: function() {
var str = this.get('rawStr'); var str = this.get('rawStr');
// first if the string is empty, they just want a blank line // first if the string is empty, they just want a blank line
@ -183,7 +114,7 @@ var Command = Backbone.Model.extend({
this.set('rawStr', str); this.set('rawStr', str);
// then check if it's one of our sandbox commands // then check if it's one of our sandbox commands
_.each(this.getSandboxCommands(), function(tuple) { _.each(sandboxInstantCommands, function(tuple) {
var regex = tuple[0]; var regex = tuple[0];
var results = regex.exec(str); var results = regex.exec(str);
if (results) { if (results) {