Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rakefile: Less brutal shutdown tasks for Hub and RCs
git-svn-id: https://svn.openqa.org/svn/selenium-grid/trunk@362 22590ab4-ef3b-0410-9bef-a9f5a1089f47
- Loading branch information
ph7
committed
Aug 21, 2008
1 parent
e28b4ab
commit 9d05140
Showing
5 changed files
with
98 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class File | ||
|
||
def self.native_path(path) | ||
expanded_path = File.expand_path(path) | ||
expanded_path.gsub!('/', '\\') if PLATFORM['win32'] | ||
expanded_path | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module Java | ||
|
||
class Classpath | ||
require 'pathname' | ||
|
||
def initialize(root_dir) | ||
@root = root_dir | ||
@locations = [] | ||
self | ||
end | ||
|
||
def <<(paths) | ||
@locations = (@locations << Dir[@root + '/' + paths]).flatten | ||
self | ||
end | ||
|
||
def definition | ||
@locations.map {|path| File.native_path(path)}.join(self.separator) | ||
|
||
end | ||
|
||
def separator | ||
PLATFORM['win32'] ? ";" : ":" | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module Java | ||
|
||
class VM | ||
|
||
def run(classname, options) | ||
command = [ "java" ] | ||
command << "-cp \"#{options[:classpath]}\"" | ||
command << classname | ||
command << jvm_properties(options[:properties]) | ||
command << options[:args].join(' ') if options[:args] | ||
command << ">\"#{options[:log_file]}\" 2>&1" if options[:log_file] | ||
|
||
if options[:background ] | ||
if PLATFORM['win32'] | ||
command.unshift("start") | ||
else | ||
command << "&" | ||
end | ||
end | ||
|
||
sh command.join(' ') | ||
end | ||
|
||
def jvm_properties(property_hash) | ||
return "" unless property_hash | ||
property_hash.inject([]) {|memo, (name, value)| memo << "-D#{name}=#{value}" }.join(' ') | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters