grid_tools 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/bin/grid_tools CHANGED
@@ -35,27 +35,45 @@ command :start do |c|
35
35
  end
36
36
 
37
37
  if args[0] == "hub"
38
- #if `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/).count < 3
38
+ if GridTools.windows?
39
39
  binaries = File.expand_path(File.dirname(File.expand_path(__FILE__)) + '/../binaries')
40
- cmd = "java -jar #{binaries}/selenium-server-standalone* -browserTimeout 300 -role hub >> ~/hub.log 2>&1 &"
40
+ binaries.gsub!("/", "\\")
41
+ cmd = "start java -jar #{binaries}\\selenium-server-standalone-2.29.0.jar -role hub -browserTimeout 300"
41
42
  system cmd
42
- #pid = `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/)[0]
43
- puts "Started a hub."# [pid: #{pid}]"
44
- #else
45
- # raise "Hub or node already started,"
46
- #end
43
+ puts "Started a hub."
44
+ else
45
+ #if `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/).count < 3
46
+ binaries = File.expand_path(File.dirname(File.expand_path(__FILE__)) + '/../binaries')
47
+ cmd = "java -jar #{binaries}/selenium-server-standalone* -browserTimeout 300 -role hub >> ~/hub.log 2>&1 &"
48
+ system cmd
49
+ pid = `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/)[0]
50
+ puts "Started a hub. [pid: #{pid}]"
51
+ #else
52
+ # raise "Hub or node already started,"
53
+ #end
54
+ end
47
55
  end
48
56
 
49
57
  if args[0] == "node"
50
- #if `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/).count < 3
58
+ if GridTools.windows?
51
59
  binaries = File.expand_path(File.dirname(File.expand_path(__FILE__)) + '/../binaries')
52
- cmd = "java -jar #{binaries}/selenium-server-standalone* -role wd -hub http://#{options[:h]}:4444/grid/register -trustAllSSLCertificates >> ~/node.log 2>&1 &"
60
+ binaries.gsub!("/", "\\")
61
+ cmd = "start java -jar #{binaries}\\selenium-server-standalone-2.29.0.jar -role wd -hub http://#{options[:h]}:4444/grid/register -trustAllSSLCertificates"
53
62
  system cmd
54
- #pid = `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/)[0]
55
- puts "Started a node. "# [pid: #{pid}]"
56
- #else
57
- # raise "Hub or node already started."
58
- #end
63
+ puts "Started a node."
64
+ else
65
+ #if `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/).count < 3
66
+ binaries = File.expand_path(File.dirname(File.expand_path(__FILE__)) + '/../binaries')
67
+ platform = "MAC" if GridTools.mac?
68
+ platform = "LINUX" if GridTools.linux?
69
+ cmd = "java -jar #{binaries}/selenium-server-standalone* -role wd -hub http://#{options[:h]}:4444/grid/register -browser \"browserName=firefox,maxInstances=5,platform=#{platform}\" -browser \"browserName=chrome,maxInstances=5,platform=#{platform}\" -trustAllSSLCertificates >> ~/node.log 2>&1 &"
70
+ system cmd
71
+ pid = `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/)[0]
72
+ puts "Started a node. [pid: #{pid}]"
73
+ #else
74
+ # raise "Hub or node already started."
75
+ #end
76
+ end
59
77
  end
60
78
 
61
79
 
@@ -1,3 +1,3 @@
1
1
  module GridTools
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
data/lib/grid_tools.rb CHANGED
@@ -12,10 +12,10 @@ module GridTools
12
12
  (/darwin/ =~ RUBY_PLATFORM) != nil
13
13
  end
14
14
  def self.unix?
15
- !OS.windows?
15
+ !GridTools.windows?
16
16
  end
17
17
  def self.linux?
18
- OS.unix? and not OS.mac?
18
+ GridTools.unix? and not GridTools.mac?
19
19
  end
20
20
 
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grid_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: