spqr 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +9 -0
- data/VERSION +1 -1
- data/examples/{examples/codegen → codegen}/EchoAgent.rb +7 -13
- data/lib/spqr/manageable.rb +5 -2
- data/ruby-spqr.spec.in +4 -1
- data/test/example-apps.rb +35 -0
- data/test/test_spqr_listarg.rb +24 -0
- metadata +23 -11
- data/examples/agent-app.rb +0 -10
data/CHANGES
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
version 0.2.4
|
2
|
+
|
3
|
+
* Workaround for a crash in qmfengine when running on 32-bit machines
|
4
|
+
|
5
|
+
version 0.2.3
|
6
|
+
|
7
|
+
* Fixed a crash that occurred sometimes when attempting to return a
|
8
|
+
value from a failing method.
|
9
|
+
|
1
10
|
version 0.2.2
|
2
11
|
|
3
12
|
* Methods on manageable objects now can call fail(status, message) to
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
@@ -1,17 +1,14 @@
|
|
1
|
-
require 'spqr/spqr'
|
2
|
-
|
3
1
|
module Examples
|
4
2
|
module Codegen
|
5
3
|
class EchoAgent
|
6
|
-
include
|
4
|
+
include SPQR::Manageable
|
7
5
|
|
8
|
-
|
9
|
-
|
6
|
+
spqr_package 'examples.codegen'
|
7
|
+
spqr_class 'EchoAgent'
|
10
8
|
# Find method (NB: you must implement this)
|
11
9
|
def EchoAgent.find_by_id(objid)
|
12
10
|
EchoAgent.new
|
13
11
|
end
|
14
|
-
|
15
12
|
# Find-all method (NB: you must implement this)
|
16
13
|
def EchoAgent.find_all
|
17
14
|
[EchoAgent.new]
|
@@ -21,17 +18,14 @@ module Examples
|
|
21
18
|
# echo returns its argument
|
22
19
|
# * arg (lstr/IO)
|
23
20
|
#
|
24
|
-
def echo(
|
21
|
+
def echo(args)
|
25
22
|
# Print values of in/out parameters
|
26
|
-
log.debug "
|
23
|
+
log.debug "arg => #{args["arg"]}" #
|
27
24
|
# Assign values to in/out parameters
|
28
|
-
arg
|
29
|
-
# Return value
|
30
|
-
log.debug "echo: returning #{arg.inspect}"
|
31
|
-
return arg
|
25
|
+
args["arg"] = args["arg"]
|
32
26
|
end
|
33
27
|
|
34
|
-
|
28
|
+
spqr_expose :echo do |args|
|
35
29
|
args.declare :arg, :lstr, :inout, {}
|
36
30
|
end
|
37
31
|
end
|
data/lib/spqr/manageable.rb
CHANGED
@@ -255,7 +255,8 @@ module SPQR
|
|
255
255
|
result = object_id
|
256
256
|
end
|
257
257
|
|
258
|
-
|
258
|
+
# XXX: this foolishly assumes that we are running on a 64-bit machine or a 32-bit machine
|
259
|
+
result & (0.size == 8 ? 0x7fffffff : 0x3fffffff)
|
259
260
|
end
|
260
261
|
|
261
262
|
def qmf_id
|
@@ -287,7 +288,9 @@ module SPQR
|
|
287
288
|
def other.class_id
|
288
289
|
package_list = spqr_meta.package.to_s.split(".")
|
289
290
|
cls = spqr_meta.classname.to_s or self.name.to_s
|
290
|
-
|
291
|
+
|
292
|
+
# XXX: this foolishly assumes that we are running on a 64-bit machine or a 32-bit machine
|
293
|
+
((package_list.map {|pkg| pkg.capitalize} << cls).join("::")).hash & (0.size == 8 ? 0x7fffffff : 0x3fffffff)
|
291
294
|
end
|
292
295
|
end
|
293
296
|
|
data/ruby-spqr.spec.in
CHANGED
@@ -68,7 +68,10 @@ rm -rf %{buildroot}
|
|
68
68
|
|
69
69
|
%changelog
|
70
70
|
|
71
|
-
* Mon Apr
|
71
|
+
* Mon Apr 12 2010 <willb@redhat> - 0.2.4-1
|
72
|
+
- updated to version 0.2.4-1
|
73
|
+
|
74
|
+
* Mon Apr 5 2010 <willb@redhat> - 0.2.3-1
|
72
75
|
- updated to version 0.2.3-1
|
73
76
|
|
74
77
|
* Thu Mar 4 2010 <willb@redhat> - 0.2.2-2
|
data/test/example-apps.rb
CHANGED
@@ -198,3 +198,38 @@ class Failbot
|
|
198
198
|
qmf_package_name :example
|
199
199
|
qmf_class_name :Failbot
|
200
200
|
end
|
201
|
+
|
202
|
+
class QmfListArg
|
203
|
+
include ::SPQR::Manageable
|
204
|
+
|
205
|
+
|
206
|
+
def qmf_oid
|
207
|
+
1234
|
208
|
+
end
|
209
|
+
|
210
|
+
def spqr_object_id
|
211
|
+
1234
|
212
|
+
end
|
213
|
+
|
214
|
+
def QmfListArg.find_by_id(oid)
|
215
|
+
@objs ||= [QmfListArg.new]
|
216
|
+
@objs[0]
|
217
|
+
end
|
218
|
+
|
219
|
+
def QmfListArg.find_all
|
220
|
+
@objs ||= [QmfListArg.new]
|
221
|
+
@objs
|
222
|
+
end
|
223
|
+
|
224
|
+
def double(ls)
|
225
|
+
ls.map {|x| 2 * x}
|
226
|
+
end
|
227
|
+
|
228
|
+
expose :double do |args|
|
229
|
+
args.declare :input, :list, :in
|
230
|
+
args.declare :ls, :list, :out
|
231
|
+
end
|
232
|
+
|
233
|
+
qmf_class_name :QmfListArg
|
234
|
+
qmf_package_name :example
|
235
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'helper'
|
2
|
+
require 'set'
|
3
|
+
require 'example-apps'
|
4
|
+
|
5
|
+
class TestListArg < Test::Unit::TestCase
|
6
|
+
include QmfTestHelpers
|
7
|
+
|
8
|
+
def setup
|
9
|
+
@child_pid = nil
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_property_identities
|
13
|
+
app_setup QmfListArg
|
14
|
+
|
15
|
+
somenats = (0..16).to_a
|
16
|
+
|
17
|
+
obj = $console.object(:class=>"QmfListArg")
|
18
|
+
|
19
|
+
ls = obj.double(somenats).ls
|
20
|
+
|
21
|
+
assert_equal ls.size, somenats.size
|
22
|
+
somenats.zip(ls).each {|n,n2| assert_equal(n*2, n2) }
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spqr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 4
|
9
|
+
version: 0.2.4
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- William Benton
|
@@ -9,19 +14,23 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-12 00:00:00 -05:00
|
13
18
|
default_executable: spqr-gen.rb
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: rspec
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 2
|
30
|
+
- 9
|
23
31
|
version: 1.2.9
|
24
|
-
|
32
|
+
type: :development
|
33
|
+
version_requirements: *id001
|
25
34
|
description: SPQR makes it very simple to expose methods on Ruby objects over QMF. You must install ruby-qmf in order to use SPQR.
|
26
35
|
email: willb@redhat.com
|
27
36
|
executables:
|
@@ -65,6 +74,7 @@ files:
|
|
65
74
|
- test/test_spqr_dummyprop.rb
|
66
75
|
- test/test_spqr_hello.rb
|
67
76
|
- test/test_spqr_integerprop.rb
|
77
|
+
- test/test_spqr_listarg.rb
|
68
78
|
has_rdoc: true
|
69
79
|
homepage: http://git.fedorahosted.org/git/grid/spqr.git
|
70
80
|
licenses: []
|
@@ -78,18 +88,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
88
|
requirements:
|
79
89
|
- - ">="
|
80
90
|
- !ruby/object:Gem::Version
|
91
|
+
segments:
|
92
|
+
- 0
|
81
93
|
version: "0"
|
82
|
-
version:
|
83
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
95
|
requirements:
|
85
96
|
- - ">="
|
86
97
|
- !ruby/object:Gem::Version
|
98
|
+
segments:
|
99
|
+
- 0
|
87
100
|
version: "0"
|
88
|
-
version:
|
89
101
|
requirements: []
|
90
102
|
|
91
103
|
rubyforge_project:
|
92
|
-
rubygems_version: 1.3.
|
104
|
+
rubygems_version: 1.3.6
|
93
105
|
signing_key:
|
94
106
|
specification_version: 3
|
95
107
|
summary: "SPQR: {Schema Processor|Straightforward Publishing} for QMF agents in Ruby"
|
@@ -98,6 +110,7 @@ test_files:
|
|
98
110
|
- spec/spec_helper.rb
|
99
111
|
- test/example-apps.rb
|
100
112
|
- test/test_spqr_dummyprop.rb
|
113
|
+
- test/test_spqr_listarg.rb
|
101
114
|
- test/generic-agent.rb
|
102
115
|
- test/helper.rb
|
103
116
|
- test/test_failbot.rb
|
@@ -105,7 +118,6 @@ test_files:
|
|
105
118
|
- test/test_spqr_clicker.rb
|
106
119
|
- test/test_spqr_integerprop.rb
|
107
120
|
- test/test_spqr_hello.rb
|
108
|
-
- examples/agent-app.rb
|
109
|
-
- examples/examples/codegen/EchoAgent.rb
|
110
121
|
- examples/hello.rb
|
122
|
+
- examples/codegen/EchoAgent.rb
|
111
123
|
- examples/logservice.rb
|