robot_remote_server 2.5.4.1 → 2.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,7 @@
1
- v2.5.4.1. Update README with correct info
2
-
3
- v2.5.4. Bump version to match Robot Framework
4
-
5
- v0.0.1. Initial copy of robotremoteserver.rb from Robot Framework's source code
1
+ v2.5.5. Implement better argument and documentation handling. Require YARD gem.
2
+
3
+ v2.5.4.1. Update README with correct info
4
+
5
+ v2.5.4. Bump version to match Robot Framework
6
+
7
+ v0.0.1. Initial copy of robotremoteserver.rb from Robot Framework's source code
data/LICENSE CHANGED
@@ -1,202 +1,202 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright [yyyy] [name of copyright owner]
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
data/Manifest CHANGED
@@ -1,9 +1,7 @@
1
- CHANGELOG
2
- Gemfile
3
- Gemfile.lock
4
- LICENSE
5
- Manifest
6
- README.rdoc
7
- Rakefile
8
- lib/robot_remote_server.rb
9
- robot_remote_server.gemspec
1
+ CHANGELOG
2
+ LICENSE
3
+ Manifest
4
+ README.rdoc
5
+ Rakefile
6
+ lib/robot_remote_server.rb
7
+ robot_remote_server.gemspec
data/README.rdoc CHANGED
@@ -1,28 +1,53 @@
1
- = Robot Remote Server for the Robot Framework in Ruby
2
-
3
- This is a Ruby gem for the Ruby implementation of RobotRemoteServer that comes with RobotFramework.
4
-
5
- == Overview
6
-
7
- Per its official documentation, "Robot Framework is a generic keyword-driven test automation framework." Natively, it supports testing libraries in Python and Java. However, Robot Framework also provides a "Remote Library" which allows for two things (again, per the official documentation):
8
-
9
- * It is possible to have test libraries running on different machines than where Robot Framework itself is executed. This allows interesting possibilities for distributed testing.
10
- * Test libraries can be implemented using any language that supports XML-RPC protocol. Robot Framework currently contains generic remote servers for Python/Jython and Ruby, and the plan is to implement generic servers for other languages like Java and Perl in the future.
11
-
12
- == Installation
13
-
14
- The simplest method of installation is to install the gem directly from Rubygems.org:
15
-
16
- gem install robot_remote_server
17
-
18
- If at some point this project is taken on by Robot Framework and they supply their own gem, that gem will be taken down from Rubygems.org. In that event, if you still want the code for this project hosted on Github, follow the following instructions.
19
-
20
- If you want to build the gem manually with the <tt>gem</tt> command:
21
-
22
- gem build robot_remote_server
23
- gem install robot_remote_server-{version}.gem
24
-
25
- If you want a simpler interface, install the <tt>echoe</tt> gem (or just run this projects Gemfile with <tt>bundle install</tt>) and execute the following:
26
-
27
- rake build
28
- rake install
1
+ = Robot Remote Server for the Robot Framework in Ruby
2
+
3
+ This is a Ruby gem for the Ruby implementation of RobotRemoteServer that comes with Robot Framework.
4
+
5
+ This gem is compatible with Robot Framework versions 2.1 and later. For earlier versions, you will need to include the Remote Library explicitly, but it should be compatible in that scenario as well.
6
+
7
+ == Overview
8
+
9
+ Per its official documentation, "Robot Framework is a generic keyword-driven test automation framework." Natively, it supports testing libraries in Python and Java. However, Robot Framework also provides a "Remote Library" which allows for two things (again, per the official documentation):
10
+
11
+ * It is possible to have test libraries running on different machines than where Robot Framework itself is executed. This allows interesting possibilities for distributed testing.
12
+ * Test libraries can be implemented using any language that supports XML-RPC protocol. Robot Framework currently contains generic remote servers for Python/Jython and Ruby, and the plan is to implement generic servers for other languages like Java and Perl in the future.
13
+
14
+ == Installation
15
+
16
+ The simplest method of installation is to install the gem directly from Rubygems.org:
17
+
18
+ gem install robot_remote_server
19
+
20
+
21
+ If you want to hack on the remote server directly and then build your own gem, you can do so with the <tt>gem</tt> command:
22
+
23
+ gem build robot_remote_server
24
+ gem install robot_remote_server-{version}.gem
25
+
26
+ Or by installing this project's dependencies and using the following rake tasks:
27
+
28
+ rake build
29
+ rake install
30
+
31
+ == Usage
32
+
33
+ For information on the Remote Library interface in Robot Framework, read the following from the official Robot Framework wiki: http://code.google.com/p/robotframework/wiki/RemoteLibrary
34
+
35
+ This gem provides a remote server implemented in Ruby, which allows you to write your own testing library (i.e. your own keywords) using Ruby and Ruby libraries.
36
+
37
+ In your test library, you need to include the gem:
38
+
39
+ require 'robot_remote_server'
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:
47
+
48
+ if __FILE__ == $0
49
+ require 'robot_remote_server'
50
+ RobotRemoteServer.new(ExampleTestLibrary.new, *ARGV)
51
+ end
52
+
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.
data/Rakefile CHANGED
@@ -1,11 +1,12 @@
1
- require 'rubygems'
2
- require 'rake'
3
- require 'echoe'
4
-
5
- Echoe.new('robot_remote_server') do |p|
6
- p.description = "Remote server for Robot Framework in Ruby"
7
- p.url = "http://github.com/semperos/robot-remote-server"
8
- p.author = "Daniel Gregoire"
9
- p.ignore_pattern = ["tmp/*", "script/*"]
10
- p.development_dependencies = []
11
- end
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('robot_remote_server') do |p|
6
+ p.description = "Remote server for Robot Framework in Ruby"
7
+ p.url = "http://github.com/semperos/robot-remote-server"
8
+ p.author = "Daniel Gregoire"
9
+ p.ignore_pattern = ["tmp/*", "script/*"]
10
+ p.runtime_dependencies = ['yard >=0.6.3']
11
+ p.need_tar_gz = false
12
+ end
@@ -1,108 +1,123 @@
1
- # Copyright 2008-2009 Nokia Siemens Networks Oyj
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require 'xmlrpc/server'
17
- require 'xmlrpc/utils'
18
- require 'stringio'
19
-
20
-
21
- class RobotRemoteServer < XMLRPC::Server
22
-
23
- def initialize(library, host='localhost', port=8270)
24
- @library = library
25
- super(port, host) # TODO: Disable logging to stdout
26
- add_handler('get_keyword_names') { get_keyword_names }
27
- add_handler('run_keyword') { |name,args| run_keyword(name, args) }
28
- add_handler('get_keyword_arguments') { |name| get_keyword_arguments(name) }
29
- add_handler('get_keyword_documentation') { |name| get_keyword_documentation(name) }
30
- add_handler('stop_remote_server') { shutdown }
31
- puts "Robot Framework remote library started at #{host}:#{port}"
32
- serve
33
- end
34
-
35
- def get_keyword_names
36
- # Implicit methods can't be used as keywords
37
- @library.methods - Object.new.methods
38
- end
39
-
40
- def run_keyword(name, args)
41
- intercept_stdout()
42
- result = {:status=>'PASS', :return=>'', :output=>'',
43
- :error=>'', :traceback=>''}
44
- begin
45
- return_value = @library.send(name, *args)
46
- result[:return] = handle_return_value(return_value)
47
- rescue Exception => exception
48
- result[:status] = 'FAIL'
49
- result[:error] = exception.message
50
- result[:traceback] = "Traceback:\n" + exception.backtrace.join("\n")
51
- end
52
- result[:output] = restore_stdout
53
- return result
54
- end
55
-
56
- def get_keyword_arguments(name)
57
- # This algorithm doesn't return correct number of maximum arguments when
58
- # args have default values. It seems that there's no easy way to get that
59
- # information in Ruby, see e.g. http://www.ruby-forum.com/topic/147614.
60
- # Additionally, it would be much better to return real argument names
61
- # because that information could be used to create library documentation.
62
- arity = @library.method(name).arity
63
- if arity >= 0
64
- return ['arg'] * arity
65
- else
66
- return ['arg'] * (arity.abs - 1) + ['*args']
67
- end
68
- end
69
-
70
- def get_keyword_documentation(name)
71
- # Is there a way to implement this? Would mainly allow creating a library
72
- # documentation, but if real argument names are not got that's probably
73
- # not so relevant.
74
- ''
75
- end
76
-
77
- private
78
-
79
- def handle_return_value(ret)
80
- if [String, Integer, Fixnum, Float, TrueClass, FalseClass].include?(ret.class)
81
- return ret
82
- elsif ret.class == Array
83
- return ret.collect { |item| handle_return_value(item) }
84
- elsif ret.class == Hash
85
- new_ret = {}
86
- ret.each_pair { |key,value|
87
- new_ret[key.to_s] = handle_return_value(value)
88
- }
89
- return new_ret
90
- else
91
- return ret.to_s
92
- end
93
- end
94
-
95
- def intercept_stdout
96
- $original_stdout = $stdout.dup
97
- @output = ''
98
- $stdout = StringIO.new(@output)
99
- end
100
-
101
- def restore_stdout
102
- $save_for_close = $stdout
103
- $stdout = $original_stdout
104
- $save_for_close.close
105
- return @output
106
- end
107
-
108
- end
1
+ # Copyright 2008-2009 Nokia Siemens Networks Oyj
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
16
+ require 'xmlrpc/server'
17
+ require 'xmlrpc/utils'
18
+ require 'stringio'
19
+
20
+ # Necessary to parse out documentation and args
21
+ require 'yard'
22
+
23
+
24
+ class RobotRemoteServer < XMLRPC::Server
25
+
26
+ def initialize(library, host='localhost', port=8270, yardoc_file = '.yardoc')
27
+ @library = library
28
+ # Get YARD registry loaded into memory
29
+ @reg = YARD::Registry
30
+ @reg.load(yardoc_file)
31
+ @reg.load_all
32
+ # End yard setup
33
+ super(port, host) # TODO: Disable logging to stdout
34
+ add_handler('get_keyword_names') { get_keyword_names }
35
+ add_handler('run_keyword') { |name,args| run_keyword(name, args) }
36
+ add_handler('get_keyword_arguments') { |name| get_keyword_arguments(name) }
37
+ add_handler('get_keyword_documentation') { |name| get_keyword_documentation(name) }
38
+ add_handler('stop_remote_server') { shutdown }
39
+ puts "Robot Framework remote library started at #{host}:#{port}"
40
+ serve
41
+ end
42
+
43
+ def get_keyword_names
44
+ # Implicit methods can't be used as keywords
45
+ @library.methods - Object.new.methods
46
+ end
47
+
48
+ def run_keyword(name, args)
49
+ intercept_stdout()
50
+ result = {:status=>'PASS', :return=>'', :output=>'',
51
+ :error=>'', :traceback=>''}
52
+ begin
53
+ return_value = @library.send(name, *args)
54
+ result[:return] = handle_return_value(return_value)
55
+ rescue Exception => exception
56
+ result[:status] = 'FAIL'
57
+ result[:error] = exception.message
58
+ result[:traceback] = "Traceback:\n" + exception.backtrace.join("\n")
59
+ end
60
+ result[:output] = restore_stdout
61
+ return result
62
+ end
63
+
64
+ def get_keyword_arguments(name)
65
+ # This algorithm doesn't return correct number of maximum arguments when
66
+ # args have default values. It seems that there's no easy way to get that
67
+ # information in Ruby, see e.g. http://www.ruby-forum.com/topic/147614.
68
+ # Additionally, it would be much better to return real argument names
69
+ # because that information could be used to create library documentation.
70
+ parent_class = @library.method(name).owner.to_s
71
+ codeobj = @reg.resolve(P(parent_class), "#" + name)
72
+ params = codeobj.parameters
73
+ params_docs = []
74
+ params.each do |param|
75
+ if param[1].nil? # YARD sets the keyword arg to nil if absent
76
+ params_docs << param[0]
77
+ else
78
+ params_docs << param[0] + "=" + param[1]
79
+ end
80
+ end
81
+ return params_docs
82
+ end
83
+
84
+ def get_keyword_documentation(name)
85
+ # Is there a way to implement this? Would mainly allow creating a library
86
+ # documentation, but if real argument names are not got that's probably
87
+ # not so relevant.
88
+ parent_class = @library.method(name).owner.to_s
89
+ return @reg.resolve(P(parent_class), "#" + name).docstring
90
+ end
91
+
92
+ private
93
+
94
+ def handle_return_value(ret)
95
+ if [String, Integer, Fixnum, Float, TrueClass, FalseClass].include?(ret.class)
96
+ return ret
97
+ elsif ret.class == Array
98
+ return ret.collect { |item| handle_return_value(item) }
99
+ elsif ret.class == Hash
100
+ new_ret = {}
101
+ ret.each_pair { |key,value|
102
+ new_ret[key.to_s] = handle_return_value(value)
103
+ }
104
+ return new_ret
105
+ else
106
+ return ret.to_s
107
+ end
108
+ end
109
+
110
+ def intercept_stdout
111
+ $original_stdout = $stdout.dup
112
+ @output = ''
113
+ $stdout = StringIO.new(@output)
114
+ end
115
+
116
+ def restore_stdout
117
+ $save_for_close = $stdout
118
+ $stdout = $original_stdout
119
+ $save_for_close.close
120
+ return @output
121
+ end
122
+
123
+ end
@@ -1,30 +1,33 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{robot_remote_server}
5
- s.version = "2.5.4.1"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Daniel Gregoire"]
9
- s.date = %q{2010-12-04}
10
- s.description = %q{Remote server for Robot Framework in Ruby}
11
- s.email = %q{}
12
- s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc", "lib/robot_remote_server.rb"]
13
- s.files = ["CHANGELOG", "Gemfile", "Gemfile.lock", "LICENSE", "Manifest", "README.rdoc", "Rakefile", "lib/robot_remote_server.rb", "robot_remote_server.gemspec"]
14
- s.homepage = %q{http://github.com/semperos/robot-remote-server}
15
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Robot_remote_server", "--main", "README.rdoc"]
16
- s.require_paths = ["lib"]
17
- s.rubyforge_project = %q{robot_remote_server}
18
- s.rubygems_version = %q{1.3.7}
19
- s.summary = %q{Remote server for Robot Framework in Ruby}
20
-
21
- if s.respond_to? :specification_version then
22
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
- s.specification_version = 3
24
-
25
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
- else
27
- end
28
- else
29
- end
30
- end
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{robot_remote_server}
5
+ s.version = "2.5.5"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Daniel Gregoire"]
9
+ s.date = %q{2010-12-14}
10
+ s.description = %q{Remote server for Robot Framework in Ruby}
11
+ s.email = %q{}
12
+ s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc", "lib/robot_remote_server.rb"]
13
+ s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.rdoc", "Rakefile", "lib/robot_remote_server.rb", "robot_remote_server.gemspec"]
14
+ s.homepage = %q{http://github.com/semperos/robot-remote-server}
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Robot_remote_server", "--main", "README.rdoc"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = %q{robot_remote_server}
18
+ s.rubygems_version = %q{1.3.7}
19
+ s.summary = %q{Remote server for Robot Framework in Ruby}
20
+
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 3
24
+
25
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
+ s.add_runtime_dependency(%q<yard>, [">= 0.6.3"])
27
+ else
28
+ s.add_dependency(%q<yard>, [">= 0.6.3"])
29
+ end
30
+ else
31
+ s.add_dependency(%q<yard>, [">= 0.6.3"])
32
+ end
33
+ end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robot_remote_server
3
3
  version: !ruby/object:Gem::Version
4
- hash: 85
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 5
9
- - 4
10
- - 1
11
- version: 2.5.4.1
9
+ - 5
10
+ version: 2.5.5
12
11
  platform: ruby
13
12
  authors:
14
13
  - Daniel Gregoire
@@ -16,10 +15,25 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2010-12-04 00:00:00 -05:00
18
+ date: 2010-12-14 00:00:00 -05:00
20
19
  default_executable:
21
- dependencies: []
22
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: yard
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 1
30
+ segments:
31
+ - 0
32
+ - 6
33
+ - 3
34
+ version: 0.6.3
35
+ type: :runtime
36
+ version_requirements: *id001
23
37
  description: Remote server for Robot Framework in Ruby
24
38
  email: ""
25
39
  executables: []
@@ -33,8 +47,6 @@ extra_rdoc_files:
33
47
  - lib/robot_remote_server.rb
34
48
  files:
35
49
  - CHANGELOG
36
- - Gemfile
37
- - Gemfile.lock
38
50
  - LICENSE
39
51
  - Manifest
40
52
  - README.rdoc
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source :rubygems
2
-
3
- gem "echoe"
data/Gemfile.lock DELETED
@@ -1,16 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- echoe (4.3.1)
5
- gemcutter
6
- rubyforge
7
- gemcutter (0.6.1)
8
- json_pure (1.4.6)
9
- rubyforge (2.0.4)
10
- json_pure (>= 1.1.7)
11
-
12
- PLATFORMS
13
- ruby
14
-
15
- DEPENDENCIES
16
- echoe