Skip to content

Commit

Permalink
1.4.1-r234 update
Browse files Browse the repository at this point in the history
  • Loading branch information
nys3909 committed Oct 30, 2013
1 parent 39fad13 commit e6ad139
Show file tree
Hide file tree
Showing 38 changed files with 1,037 additions and 558 deletions.
198 changes: 156 additions & 42 deletions goorm.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ fs.readFile(__dirname+"/info_goorm.json", "utf8", function(err, contents) {
console.log(' $ goorm [command] [options]');
console.log(' ex) $ goorm -h');
console.log('');
console.log(' Command: update');
console.log('');
console.log(' - update goormIDE server info:');
console.log('');
console.log(' $ node goorm.js update');
console.log(' $ goorm update');
console.log('');
console.log(' Command: Start / Restart / Stop');
console.log('');
console.log(' - Start goormIDE server:');
Expand All @@ -67,6 +60,8 @@ fs.readFile(__dirname+"/info_goorm.json", "utf8", function(err, contents) {
console.log('');
console.log(' -d, --daemon run the goorm server as a daemon using the forever module...');
console.log(' -p, --port [PORT NUM] run the goorm server with port which you want...');
console.log(' -h, --home [HOME Directory] set HOME directory in server');
console.log(' -w, --workspace [WORKSPACE Directory] set WORKSPACE directory in server');
console.log(' --redis-mode run the goorm server with redis-server');
console.log('');
console.log(' $ node goorm.js start -d');
Expand Down Expand Up @@ -129,11 +124,10 @@ fs.readFile(__dirname+"/info_goorm.json", "utf8", function(err, contents) {
.command('start [option]')
.option('-d, --daemon', 'run the goorm server as a daemon using the forever module...')
.option('-p, --port [PORT NUM]', 'run the goorm server with port which you want...')
.option('-s, --send-info [Y/N],', 'send server information to developer...')
// .option('-s, --send-info [Y/N],', 'send server information to developer...')
.option('-h, --home [HOME Directory]', 'set HOME directory in server')
.option('-w, --workspace [WORKSPACE Directory]', 'set WORKSPACE directory in server')
.option('--redis-mode', 'run the goorm with redis-server')
.option('--optimization-mode', 'run the goorm by optimization mode')



Expand All @@ -150,17 +144,76 @@ fs.readFile(__dirname+"/info_goorm.json", "utf8", function(err, contents) {


function start_process(){
if (options.daemon) {
forever.startDaemon(__dirname+'/server.js', {
'env': { 'NODE_ENV': 'production' },
'spawnWith': { env: process.env },
'options': process_options
});
console.log("goormIDE server is started...");
}
else {
forever.start(__dirname+'/server.js', {'options': process_options});
}
var start = function () {
if (options.daemon) {
forever.startDaemon(__dirname+'/server.js', {
'env': { 'NODE_ENV': 'production' },
'spawnWith': { env: process.env },
'options': process_options
});
console.log("goormIDE server is started...");
}
else {
forever.start(__dirname+'/server.js', {'options': process_options});
}
}


fs.exists(process.env.HOME + '/.goorm/config.json', function(exists){
if (!exists) {
////prepare config.json
if (!fs.existsSync(process.env.HOME + '/.goorm/')) {
fs.mkdirSync(process.env.HOME + '/.goorm/');
fs.writeFileSync(process.env.HOME + '/.goorm/config.json', "", 'utf8');
}
else if(!fs.existsSync(process.env.HOME + '/.goorm/config.json')){
fs.writeFileSync(process.env.HOME + '/.goorm/config.json', "", 'utf8');
}
}

var config_data = {};
var raw_config_data = fs.readFileSync(process.env.HOME + '/.goorm/config.json', 'utf8');
if(raw_config_data && typeof(raw_config_data) != 'object' ) config_data = JSON.parse(raw_config_data);

if (!config_data.users || config_data.users.length == 0) {
if(!config_data.users) config_data.users = [];

var readline = require('readline');
var crypto = require('crypto');

var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});

console.log('Please initialize your ID & PW ...'.yellow);
rl.question("Your ID : ", function(user_id) {
rl.question("Your PW : ", function(user_pw) {
var sha_pw = crypto.createHash('sha1');
sha_pw.update(user_pw);
user_pw = sha_pw.digest('hex');

var user = {
'id' : user_id,
'pw' : user_pw
}

config_data.users.push(user);
fs.writeFileSync(process.env.HOME + '/.goorm/config.json', JSON.stringify(config_data), 'utf8');

rl.close();

start();
});
});
}
else {
start();
}
});



}


Expand All @@ -181,26 +234,28 @@ fs.readFile(__dirname+"/info_goorm.json", "utf8", function(err, contents) {



if(options['sendInfo']){
var send = options['sendInfo'];
if(send == 'y' || send == 'yes' || send == 'Y' || send == 'Yes'){
send_log("server start", function() {});
}
// if(options['sendInfo']){
// var send = options['sendInfo'];
// if(send == 'y' || send == 'yes' || send == 'Y' || send == 'Yes'){
// send_log("server start", function() {});
// }

start_process();
}
else{
var print_message = 'Do you want to send server information to developer?(yes/no) ';
commander.confirm(print_message, function(arg){
process.stdin.pause();
// start_process();
// }
// else{
// var print_message = 'Do you want to send server information to developer?(yes/no) ';
// commander.confirm(print_message, function(arg){
// process.stdin.pause();

if(arg) {
send_log("server start", function() {});
}
// if(arg) {
// send_log("server start", function() {});
// }

start_process();
});
}
// start_process();
// });
// }

start_process();
});

commander
Expand Down Expand Up @@ -229,15 +284,74 @@ fs.readFile(__dirname+"/info_goorm.json", "utf8", function(err, contents) {

if( target_index != -1 ) {
var options = list[i].options;
var start = function () {
forever.startDaemon(__dirname+'/server.js', {
'env': { 'NODE_ENV': 'production' },
'spawnWith': { env: process.env },
'options' : options
});

console.log("goormIDE server is restarted...");
}

forever.stop(target_index);
forever.startDaemon(__dirname+'/server.js', {
'env': { 'NODE_ENV': 'production' },
'spawnWith': { env: process.env },
'options' : options


fs.exists(process.env.HOME + '/.goorm/config.json', function(exists){
if (!exists) {
////prepare config.json
if (!fs.existsSync(process.env.HOME + '/.goorm/')) {
fs.mkdirSync(process.env.HOME + '/.goorm/');
fs.writeFileSync(process.env.HOME + '/.goorm/config.json', "", 'utf8');
}
else if(!fs.existsSync(process.env.HOME + '/.goorm/config.json')){
fs.writeFileSync(process.env.HOME + '/.goorm/config.json', "", 'utf8');
}
}

var config_data = {};
var raw_config_data = fs.readFileSync(process.env.HOME + '/.goorm/config.json', 'utf8');
if(raw_config_data && typeof(raw_config_data) != 'object' ) config_data = JSON.parse(raw_config_data);

if (!config_data.users || config_data.users.length == 0) {
if(!config_data.users) config_data.users = [];

var readline = require('readline');
var crypto = require('crypto');

var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});

console.log('Please initialize your ID & PW ...'.yellow);
rl.question("Your ID : ", function(user_id) {
rl.question("Your PW : ", function(user_pw) {
var sha_pw = crypto.createHash('sha1');
sha_pw.update(user_pw);
user_pw = sha_pw.digest('hex');

var user = {
'id' : user_id,
'pw' : user_pw
}

config_data.users.push(user);
fs.writeFileSync(process.env.HOME + '/.goorm/config.json', JSON.stringify(config_data), 'utf8');

rl.close();

start();
});
});
}
else {
start();
}
});


console.log("goormIDE server is restarted...");

}
else{
console.log("goormIDE server not found...");
Expand Down
2 changes: 1 addition & 1 deletion info_goorm.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.4.1","url":"http://www.goorm.io","lib":[{"name":"YUI","version":"2.9.0"},{"name":"jQuery","version":"1.7.2"},{"name":"jQuery UI","version":"1.8.12"},{"name":"CodeMirror","version":"2.38.0"}]}
{"version":"1.4.1","url":"http://goorm.io","lib":[{"name":"YUI","version":"2.9.0"},{"name":"jQuery","version":"1.7.2"},{"name":"jQuery UI","version":"1.8.12"},{"name":"CodeMirror","version":"2.38.0"}]}
4 changes: 2 additions & 2 deletions modules/org.goorm.core.edit/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,9 +864,9 @@ module.exports = {
var ctags_command = "";

if (project_type === 'cpp' || project_type === 'c') {
ctags_command = "find " + absolute_workspace_path + " -regex '.*\.c' -o -regex '.*\.cpp' | xargs ctags --c-types=+l --java-types=+l -f " + absolute_workspace_path + "/.tags";
ctags_command = "rm "+absolute_workspace_path+"/.tags; find " + absolute_workspace_path + " -regex '.*\.c' -o -regex '.*\.cpp' | xargs ctags --c-types=+l --java-types=+l -f " + absolute_workspace_path + "/.tags";
} else {
ctags_command = "find " + absolute_workspace_path + " -name '*." + project_type + "' | xargs ctags --c-types=+l --java-types=+l -f " + absolute_workspace_path + "/.tags";
ctags_command = "rm "+absolute_workspace_path+"/.tags; find " + absolute_workspace_path + " -name '*." + project_type + "' | xargs ctags --c-types=+l --java-types=+l -f " + absolute_workspace_path + "/.tags";
}

exec(ctags_command, function (err, stdout, stderr) {
Expand Down
5 changes: 4 additions & 1 deletion modules/org.goorm.core.search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = {
var author = query.author;
var find_query = query.find_query;
var project_path = query.project_path;
var folder_path = query.folder_path;
var grep_option = query.grep_option;

var nodes = {};
Expand Down Expand Up @@ -85,6 +86,7 @@ module.exports = {
self.get_data_from_project({
'find_query' : find_query,
'project_path' : project_path,
'folder_path' : folder_path,
'grep_option' : grep_option
}, function(matched_files_list){
nodes = parser(matched_files_list);
Expand All @@ -96,12 +98,13 @@ module.exports = {
get_data_from_project: function (option, callback) {
var find_query = option.find_query;
var project_path = option.project_path;
var folder_path = option.folder_path;
var grep_option = option.grep_option;
var invert_match = " | grep -v \"/.svn\" | grep -v \"Binary\" | grep -v \"file.list\" | grep -v \"project.json\" | grep -v \".classpath\"";

fs.exists(__workspace.slice(0, -1) + project_path, function(exists){
if(exists) {
var command = exec("grep " + find_query + " " + __workspace.slice(0, -1) + project_path + grep_option + invert_match, function (error, stdout, stderr) {
var command = exec("grep " + find_query + " " + __workspace.slice(0, -1) + project_path+'/'+folder_path + grep_option + invert_match, function (error, stdout, stderr) {
if (error === null) {
var matched_files_list = stdout.split(/\n/);
matched_files_list.pop();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "goorm",
"author": "xenoz0718 <[email protected]> (http://www.goorm.org/)",
"description": "Cloud based Integrated Development Enviroment.",
"version": "1.4.1-r233",
"version": "1.4.1-r234",
"dependencies": {
"colors": ">= 0.6.0-1",
"css-parse": ">= 1.5.2",
Expand Down
19 changes: 14 additions & 5 deletions plugins/org.goorm.plugin.python/plug.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,14 @@ org.goorm.plugin.python.prototype = {
var self=this;
var property = core.property.plugins['org.goorm.plugin.python'];

var classpath = property['plugin.python.source_path'];
var classname = property['plugin.python.main']+'.py';

var cmd1 = "python ./"+classname;
core.module.layout.terminal.send_command("clear;"+ '\r');
core.module.layout.terminal.send_command(cmd1 + '\r');
var workspace = core.preference.workspace_path;
var absolute_path=workspace+core.status.current_project_path+"/"+classpath+classname;

core.module.layout.terminal.send_command("clear;"+'\r');
core.module.layout.terminal.send_command("python "+absolute_path +'\r');
},

debug: function (path) {
Expand Down Expand Up @@ -136,7 +138,7 @@ org.goorm.plugin.python.prototype = {

$(debug_module).off("value_changed");
$(debug_module).on("value_changed",function(e, data){
self.terminal.send_command("p "+data.variable+"="+data.value+"\r", self.prompt);
self.terminal.send_command(data.variable+"="+data.value+"\r", self.prompt);
});

$(debug_module).off("debug_end");
Expand Down Expand Up @@ -172,7 +174,7 @@ org.goorm.plugin.python.prototype = {

var workspace = core.preference.workspace_path;
var projectName = core.status.current_project_path+"/";
var mainPath = property['plugin.python.main'];
var mainPath = property['plugin.python.main'] + '.py';
var source_path = property['plugin.python.source_path'];

// if(this.terminal === null) {
Expand All @@ -182,6 +184,8 @@ org.goorm.plugin.python.prototype = {
// return ;
// }

if(!this.terminal) this.terminal = core.module.layout.workspace.window_manager.open("/", "debug", "terminal", "Terminal").terminal;

switch (cmd.mode) {
case 'init':
self.terminal.flush_command_queue();
Expand Down Expand Up @@ -216,6 +220,11 @@ org.goorm.plugin.python.prototype = {
}
}

$("#goorm_main_toolbar .debug_continue, #goorm_main_toolbar .debug_terminate, #goorm_main_toolbar .debug_step_over, #goorm_main_toolbar .debug_step_in, #goorm_main_toolbar .debug_step_out").addClass('debug_not_active');
$("#goorm_main_toolbar .debug").removeClass("debug_not_active");
$("#Debug .menu-debug-continue, #Debug .menu-debug-terminate, #Debug .menu-debug-step-over, #Debug .menu-debug-step-in, #Debug .menu-debug-step-out").addClass('debug_not_active');
$("#Debug .menu-debug-start").removeClass('debug_not_active');

break;
case 'step_over':
self.set_breakpoints();
Expand Down
2 changes: 1 addition & 1 deletion plugins/org.goorm.plugin.python/preference.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"plugin.python.main" : "index",
"plugin.python.source_path" : ""
"plugin.python.source_path" : "./"
}
Loading

0 comments on commit e6ad139

Please sign in to comment.