Browse Source

Review changes

Richard Nienaber 11 years ago
parent
commit
92132a5258

+ 2 - 3
frameworks/Ruby/grape/helper.py

@@ -8,11 +8,10 @@ Command = namedtuple('Command', ['command', 'wait_for_exit'])
 
 
 def set_database_host(args):
 def set_database_host(args):
   database_host = args.database_host or 'localhost'
   database_host = args.database_host or 'localhost'
-  database_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config/database.yml')
+  database_file = os.path.join(args.troot, 'config', 'database.yml')
   setup_util.replace_text(database_file, "  host:.*", "  host: " + database_host)
   setup_util.replace_text(database_file, "  host:.*", "  host: " + database_host)
 
 
-def run(commands, logfile, errfile):
-  cwd = os.path.expanduser(os.path.basename(os.path.normpath(os.path.dirname(os.path.realpath(__file__)))))
+def run(commands, logfile, errfile, cwd):
   try:
   try:
     for command in commands:      
     for command in commands:      
       if command.wait_for_exit:
       if command.wait_for_exit:

+ 1 - 1
frameworks/Ruby/grape/run_jruby_puma.py

@@ -8,7 +8,7 @@ def start(args, logfile, errfile):
     Command("rvm jruby-1.7.8 do bundle exec puma -b tcp://0.0.0.0:8080 -e production", False)
     Command("rvm jruby-1.7.8 do bundle exec puma -b tcp://0.0.0.0:8080 -e production", False)
   ]
   ]
 
 
-  return helper.run(commands, logfile, errfile)
+  return helper.run(commands, logfile, errfile, args.troot)
 
 
 def stop(logfile, errfile):
 def stop(logfile, errfile):
   return helper.stop('puma', logfile, errfile)
   return helper.stop('puma', logfile, errfile)

+ 1 - 1
frameworks/Ruby/grape/run_mri_puma.py

@@ -8,7 +8,7 @@ def start(args, logfile, errfile):
     Command("rvm ruby-2.0.0-p0 do bundle exec puma -t 8:32 -w 8 --preload -b tcp://0.0.0.0:8080 -e production", False)
     Command("rvm ruby-2.0.0-p0 do bundle exec puma -t 8:32 -w 8 --preload -b tcp://0.0.0.0:8080 -e production", False)
   ]
   ]
 
 
-  return helper.run(commands, logfile, errfile)
+  return helper.run(commands, logfile, errfile, args.troot)
 
 
 def stop(logfile, errfile):
 def stop(logfile, errfile):
   return helper.stop('puma', logfile, errfile)
   return helper.stop('puma', logfile, errfile)

+ 1 - 1
frameworks/Ruby/grape/run_thin.py

@@ -8,7 +8,7 @@ def start(args, logfile, errfile):
     Command("rvm ruby-2.0.0-p0 do bundle exec thin start -C config/thin.yml", False)
     Command("rvm ruby-2.0.0-p0 do bundle exec thin start -C config/thin.yml", False)
   ]
   ]
 
 
-  return helper.run(commands, logfile, errfile)
+  return helper.run(commands, logfile, errfile, args.troot)
 
 
 def stop(logfile, errfile):
 def stop(logfile, errfile):
   helper.run([Command('rm -rf tmp/*', True)], logfile, errfile)  
   helper.run([Command('rm -rf tmp/*', True)], logfile, errfile)  

+ 1 - 1
frameworks/Ruby/grape/run_torqbox.py

@@ -8,7 +8,7 @@ def start(args, logfile, errfile):
     Command("rvm jruby-1.7.8 do bundle exec torqbox -b 0.0.0.0 -E production", False)
     Command("rvm jruby-1.7.8 do bundle exec torqbox -b 0.0.0.0 -E production", False)
   ]
   ]
 
 
-  return helper.run(commands, logfile, errfile)
+  return helper.run(commands, logfile, errfile, args.troot)
 
 
 def stop(logfile, errfile):
 def stop(logfile, errfile):
   return helper.stop('torqbox', logfile, errfile)
   return helper.stop('torqbox', logfile, errfile)

+ 1 - 1
frameworks/Ruby/grape/run_trinidad.py

@@ -8,7 +8,7 @@ def start(args, logfile, errfile):
     Command("rvm jruby-1.7.8 do bundle exec trinidad --config config/trinidad.yml", False)
     Command("rvm jruby-1.7.8 do bundle exec trinidad --config config/trinidad.yml", False)
   ]
   ]
 
 
-  return helper.run(commands, logfile, errfile)
+  return helper.run(commands, logfile, errfile, args.troot)
 
 
 def stop(logfile, errfile):
 def stop(logfile, errfile):
   return helper.stop('trinidad', logfile, errfile)
   return helper.stop('trinidad', logfile, errfile)

+ 1 - 1
frameworks/Ruby/grape/run_unicorn.py

@@ -8,7 +8,7 @@ def start(args, logfile, errfile):
     Command("rvm ruby-2.0.0-p0 do bundle exec unicorn -E production -c config/unicorn.rb", False)
     Command("rvm ruby-2.0.0-p0 do bundle exec unicorn -E production -c config/unicorn.rb", False)
   ]
   ]
 
 
-  return helper.run(commands, logfile, errfile)
+  return helper.run(commands, logfile, errfile, args.troot)
 
 
 def stop(logfile, errfile):
 def stop(logfile, errfile):
   return helper.stop('unicorn', logfile, errfile)
   return helper.stop('unicorn', logfile, errfile)