watirgrid 1.0.3 → 1.0.4.pre

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ begin
9
9
  gem.email = "tim.koops@gmail.com"
10
10
  gem.homepage = "http://github.com/90kts/watirgrid"
11
11
  gem.authors = ["Tim Koopmans"]
12
- gem.version = "1.0.3"
12
+ gem.version = "1.0.4.pre"
13
13
  end
14
14
  rescue LoadError
15
15
  puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
data/bin/controller CHANGED
@@ -45,7 +45,7 @@ OptionParser.new do |opts|
45
45
  opts.on_tail("-h", "--help", "Show this message") do
46
46
  puts opts
47
47
  exit
48
- end
48
+ end
49
49
  end.parse!
50
50
 
51
51
  controller = Controller.new(
data/bin/listener ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'controller'
4
+ require 'provider'
5
+ require 'listener'
6
+ require 'optparse'
7
+
8
+ options = {}
9
+ OptionParser.new do |opts|
10
+ opts.banner = "Usage: listener [options]"
11
+ opts.separator ""
12
+ opts.separator "Specific options:"
13
+ opts.on("-c URI", "--controller-uri", String,
14
+ "Specify Controller URI e.g. druby://127.0.0.1:11235 to listen in on") do |h|
15
+ options[:controller_uri] = h || nil
16
+ end
17
+ opts.on_tail("-h", "--help", "Show this message") do
18
+ puts opts
19
+ exit
20
+ end
21
+ end.parse!
22
+
23
+ listener = Listener.new(:controller_uri => options[:controller_uri])
24
+ listener.start
25
+ DRb.thread.join
data/lib/listener.rb ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env ruby
2
+ # listener.rb
3
+ # Controller Listener (for debugging)
4
+
5
+ require 'rinda/ring'
6
+
7
+ class Listener
8
+
9
+ def initialize(params = {})
10
+ @controller_uri = params[:controller_uri]
11
+ logfile = STDOUT
12
+ @log = Logger.new(logfile, 'daily')
13
+ @log.level = Logger::DEBUG
14
+ @log.datetime_format = "%Y-%m-%d %H:%M:%S "
15
+ end
16
+
17
+ def start
18
+ DRb.start_service
19
+ ring_server = DRbObject.new(nil, @controller_uri)
20
+ service = ring_server.read([:WatirGrid, nil, nil, nil, nil, nil, nil])
21
+ observers = []
22
+ observers << ring_server.notify('write',[:WatirGrid, nil, nil, nil, nil, nil, nil], nil)
23
+ observers << ring_server.notify('take', [:WatirGrid, nil, nil, nil, nil, nil, nil], nil)
24
+ observers << ring_server.notify('delete', [:WatirGrid, nil, nil, nil, nil, nil, nil], nil)
25
+ @log.debug("Listener started on : #{@controller_uri}")
26
+ threads = []
27
+ observers.each do |observer|
28
+ threads << Thread.new do
29
+ observer.each do |event|
30
+ @log.debug(event.inspect)
31
+ end
32
+ end
33
+ end
34
+ # abort all threads on an exception
35
+ Thread.abort_on_exception = true
36
+
37
+ # wait for explicit stop via ctrl-c
38
+ DRb.thread.join if __FILE__ == $0
39
+ end
40
+ end
data/lib/provider.rb CHANGED
@@ -156,7 +156,9 @@ class Provider
156
156
  # Start providing watir objects on the ring server
157
157
  def start
158
158
  # create a DRb 'front' object
159
+ @log.debug("About to create a watir_provider")
159
160
  watir_provider = Watir::Provider.new(@browser_type)
161
+ @log.debug("watir_provider is #{watir_provider}")
160
162
  architecture = Config::CONFIG['arch']
161
163
  hostname = ENV['SERVER_NAME'] || %x{hostname}.strip
162
164
 
data/lib/watirgrid.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'controller'
2
2
  require 'provider'
3
+ require 'listener'
3
4
 
4
5
  module Watir
5
6
 
data/watirgrid.gemspec CHANGED
@@ -5,14 +5,14 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{watirgrid}
8
- s.version = "1.0.3"
8
+ s.version = "1.0.4.pre"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tim Koopmans"]
12
- s.date = %q{2011-04-06}
12
+ s.date = %q{2011-04-08}
13
13
  s.description = %q{WatirGrid allows for distributed testing across a grid network using Watir.}
14
14
  s.email = %q{tim.koops@gmail.com}
15
- s.executables = ["controller", "provider"]
15
+ s.executables = ["controller", "listener", "provider"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE",
18
18
  "README.rdoc"
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "README.rdoc",
26
26
  "Rakefile",
27
27
  "bin/controller",
28
+ "bin/listener",
28
29
  "bin/provider",
29
30
  "examples/basic/example_safariwatir.rb",
30
31
  "examples/basic/example_webdriver.rb",
@@ -33,6 +34,7 @@ Gem::Specification.new do |s|
33
34
  "examples/cucumber/step_definitions/example_steps.rb",
34
35
  "lib/controller.rb",
35
36
  "lib/extensions/remote.rb",
37
+ "lib/listener.rb",
36
38
  "lib/provider.rb",
37
39
  "lib/watirgrid.rb",
38
40
  "rdoc/logo.png",
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watirgrid
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
5
- prerelease:
4
+ hash: 961915972
5
+ prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 4
10
+ - pre
11
+ version: 1.0.4.pre
11
12
  platform: ruby
12
13
  authors:
13
14
  - Tim Koopmans
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2011-04-06 00:00:00 -07:00
19
+ date: 2011-04-08 00:00:00 -07:00
19
20
  default_executable:
20
21
  dependencies: []
21
22
 
@@ -23,6 +24,7 @@ description: WatirGrid allows for distributed testing across a grid network usin
23
24
  email: tim.koops@gmail.com
24
25
  executables:
25
26
  - controller
27
+ - listener
26
28
  - provider
27
29
  extensions: []
28
30
 
@@ -37,6 +39,7 @@ files:
37
39
  - README.rdoc
38
40
  - Rakefile
39
41
  - bin/controller
42
+ - bin/listener
40
43
  - bin/provider
41
44
  - examples/basic/example_safariwatir.rb
42
45
  - examples/basic/example_webdriver.rb
@@ -45,6 +48,7 @@ files:
45
48
  - examples/cucumber/step_definitions/example_steps.rb
46
49
  - lib/controller.rb
47
50
  - lib/extensions/remote.rb
51
+ - lib/listener.rb
48
52
  - lib/provider.rb
49
53
  - lib/watirgrid.rb
50
54
  - rdoc/logo.png
@@ -77,12 +81,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
81
  required_rubygems_version: !ruby/object:Gem::Requirement
78
82
  none: false
79
83
  requirements:
80
- - - ">="
84
+ - - ">"
81
85
  - !ruby/object:Gem::Version
82
- hash: 3
86
+ hash: 25
83
87
  segments:
84
- - 0
85
- version: "0"
88
+ - 1
89
+ - 3
90
+ - 1
91
+ version: 1.3.1
86
92
  requirements: []
87
93
 
88
94
  rubyforge_project: