robot_remote_server 2.5.5.1 → 2.5.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v2.5.5.2. Change extra options to multi-dimensional array, to preserve insertion order.
2
+
1
3
  v2.5.5.1. Implement extra options to pass to YARD for generating more flexible documentation for keywords.
2
4
 
3
5
  v2.5.5. Implement better argument and documentation handling. Require YARD gem.
data/README.rdoc CHANGED
@@ -23,7 +23,7 @@ If you want to hack on the remote server directly and then build your own gem, y
23
23
  gem build robot_remote_server
24
24
  gem install robot_remote_server-{version}.gem
25
25
 
26
- Or by installing this project's dependencies and using the following rake tasks:
26
+ Or by installing the +echoe+ gem and using the following rake tasks:
27
27
 
28
28
  rake build
29
29
  rake install
@@ -38,16 +38,22 @@ In your test library, you need to include the gem:
38
38
 
39
39
  require 'robot_remote_server'
40
40
 
41
- Then you'll have the RobotRemoteServer class available to your code. For example, if your test library was defined in a class called <tt>ExampleTestLibrary</tt>, here's how you'd start the <tt>robot_remote_server</tt> server and feed it your test library from IRB:
42
-
43
- require 'robot_remote_server'
44
- RobotRemoteServer.new(ExampleTestLibrary.new)
45
-
46
- Per the example in Robot Framework itself, you could include that in a file as follows:
41
+ Then you'll have the RobotRemoteServer class available to your code. Per the example in Robot Framework itself, you could include that in a file as follows:
47
42
 
48
43
  if __FILE__ == $0
44
+ require 'rubygems'
49
45
  require 'robot_remote_server'
50
- RobotRemoteServer.new(ExampleTestLibrary.new, *ARGV)
46
+ require 'example_library'
47
+ RobotRemoteServer.new(ExampleLibrary.new,
48
+ host = 'localhost',
49
+ port = 8270,
50
+ yardoc_file = '.yardoc'),
51
+ yardoc_options = [[:docstring, ''], [:file, 'File'], [:source, 'Source Code']])
51
52
  end
52
53
 
53
- Once you have the remote server running with your new test library, you can run your Robot Framework tests and have your test library's keywords available per usual.
54
+ You'll notice a few options are available to you:
55
+
56
+ host:: The domain name or address at which the server will serve content. If you're unsure, use 'localhost'
57
+ port:: You can optionally change the port on which the server runs. It default to 8270, as those are the ASCII character codes for R and F (Robot Framework)
58
+ yardoc_file:: The file-based cache that yardoc generated when you ran it for your testing library. Without this, the remote library cannot access documentation or method signatures from your remote testing library.
59
+ yardoc_options:: A multi-dimensional array of options, which allow you to tweak which parts of the documentation are printed and in what order. The first element of each child array is a symbol representing a method to which YARD::CodeObject::Base will respond. The second value is an "optional" human-readable label to be printed just before the output of the method. If you don't want a lable, provide an empty string '' as the second value.
@@ -30,7 +30,7 @@ class RobotRemoteServer < XMLRPC::Server
30
30
  # @param [Integer] port the port at which this server will serve content
31
31
  # @param [String] yardoc_file the file which YARD expects when loading its Registry
32
32
  # @param [Hash] yardoc_options a hash of YARD::CodeObject::Base.method => human-readable label for docs
33
- def initialize(library, host='localhost', port=8270, yardoc_file = '.yardoc', yardoc_options = {:docstring => ''})
33
+ def initialize(library, host='localhost', port=8270, yardoc_file = '.yardoc', yardoc_options = [[:docstring, '']])
34
34
  @library = library
35
35
  # Get YARD registry loaded into memory
36
36
  @reg = YARD::Registry
@@ -87,11 +87,11 @@ class RobotRemoteServer < XMLRPC::Server
87
87
  def get_keyword_documentation(name)
88
88
  parent_class = @library.method(name).owner.to_s
89
89
  # Allow custom inclusion/exclusion of parts of the documentation
90
- # The key is the method, the value is the human-readable label
90
+ # The first element is the method, the second is the human-readable label
91
91
  doc = ''
92
- @reg_options.each_key do |k|
93
- doc << @reg_options[k] + ":\n" if @reg_options[k] != ''
94
- doc << @reg.resolve(P(parent_class), "#" + name).send(k)
92
+ @reg_options.each do |opt|
93
+ doc << opt[1] + ":\n" if opt[1] != ''
94
+ doc << @reg.resolve(P(parent_class), "#" + name).send(opt[0])
95
95
  doc << "\n\n"
96
96
  end
97
97
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{robot_remote_server}
5
- s.version = "2.5.5.1"
5
+ s.version = "2.5.5.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Daniel Gregoire"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robot_remote_server
3
3
  version: !ruby/object:Gem::Version
4
- hash: 81
4
+ hash: 87
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 5
9
9
  - 5
10
- - 1
11
- version: 2.5.5.1
10
+ - 2
11
+ version: 2.5.5.2
12
12
  platform: ruby
13
13
  authors:
14
14
  - Daniel Gregoire