json-rpc-objects 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -1
- data/Gemfile.lock +1 -3
- data/VERSION +1 -1
- data/json-rpc-objects.gemspec +2 -5
- data/lib/json-rpc-objects/v11/wd/service-description.rb +9 -8
- data/lib/json-rpc-objects/v11/wd/tests/test.rb +1 -1
- metadata +12 -27
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -12,8 +12,7 @@ GEM
|
|
12
12
|
rake (0.8.7)
|
13
13
|
types (0.1.0)
|
14
14
|
multitype-introspection (>= 0.1.0)
|
15
|
-
|
16
|
-
yajl-ruby (0.7.8)
|
15
|
+
yajl-ruby (0.7.9)
|
17
16
|
|
18
17
|
PLATFORMS
|
19
18
|
ruby
|
@@ -25,5 +24,4 @@ DEPENDENCIES
|
|
25
24
|
jeweler (~> 1.5.2)
|
26
25
|
multitype-introspection (>= 0.1.0)
|
27
26
|
types (>= 0.1.0)
|
28
|
-
version (>= 0.9.2)
|
29
27
|
yajl-ruby (>= 0.7.8)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/json-rpc-objects.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{json-rpc-objects}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Martin Kozák"]
|
12
|
-
s.date = %q{2011-01-
|
12
|
+
s.date = %q{2011-01-18}
|
13
13
|
s.email = %q{martinkozak@martinkozak.net}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE.txt",
|
@@ -77,7 +77,6 @@ Gem::Specification.new do |s|
|
|
77
77
|
s.add_runtime_dependency(%q<multitype-introspection>, [">= 0.1.0"])
|
78
78
|
s.add_runtime_dependency(%q<hash-utils>, [">= 0.3.0"])
|
79
79
|
s.add_runtime_dependency(%q<types>, [">= 0.1.0"])
|
80
|
-
s.add_runtime_dependency(%q<version>, [">= 0.9.2"])
|
81
80
|
s.add_runtime_dependency(%q<addressable>, [">= 2.2.2"])
|
82
81
|
s.add_runtime_dependency(%q<yajl-ruby>, [">= 0.7.8"])
|
83
82
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
@@ -86,7 +85,6 @@ Gem::Specification.new do |s|
|
|
86
85
|
s.add_dependency(%q<multitype-introspection>, [">= 0.1.0"])
|
87
86
|
s.add_dependency(%q<hash-utils>, [">= 0.3.0"])
|
88
87
|
s.add_dependency(%q<types>, [">= 0.1.0"])
|
89
|
-
s.add_dependency(%q<version>, [">= 0.9.2"])
|
90
88
|
s.add_dependency(%q<addressable>, [">= 2.2.2"])
|
91
89
|
s.add_dependency(%q<yajl-ruby>, [">= 0.7.8"])
|
92
90
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
@@ -96,7 +94,6 @@ Gem::Specification.new do |s|
|
|
96
94
|
s.add_dependency(%q<multitype-introspection>, [">= 0.1.0"])
|
97
95
|
s.add_dependency(%q<hash-utils>, [">= 0.3.0"])
|
98
96
|
s.add_dependency(%q<types>, [">= 0.1.0"])
|
99
|
-
s.add_dependency(%q<version>, [">= 0.9.2"])
|
100
97
|
s.add_dependency(%q<addressable>, [">= 2.2.2"])
|
101
98
|
s.add_dependency(%q<yajl-ruby>, [">= 0.7.8"])
|
102
99
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require "version"
|
3
2
|
require "addressable/uri"
|
4
3
|
require "json-rpc-objects/v11/wd/service-procedure-description"
|
5
4
|
require "json-rpc-objects/generic"
|
@@ -41,6 +40,12 @@ module JsonRpcObjects
|
|
41
40
|
#
|
42
41
|
|
43
42
|
PROCEDURE_DESCRIPTION_CLASS = JsonRpcObjects::V11::WD::ServiceProcedureDescription
|
43
|
+
|
44
|
+
##
|
45
|
+
# Holds version number matcher.
|
46
|
+
#
|
47
|
+
|
48
|
+
VERSION_MATCHER = /^\d+\.\d+/
|
44
49
|
|
45
50
|
##
|
46
51
|
# Holds service name.
|
@@ -121,8 +126,8 @@ module JsonRpcObjects
|
|
121
126
|
if not @name.kind_of? Symbol
|
122
127
|
raise Exception::new("Service name must be Symbol or convertable to Symbol.")
|
123
128
|
end
|
124
|
-
|
125
|
-
if not (@version.nil?) and
|
129
|
+
|
130
|
+
if not (@version.nil?) and not @version.match(self.class::VERSION_MATCHER)
|
126
131
|
raise Exception::new("Version must be at least in <major>.<minor> format and must contain numbers only.")
|
127
132
|
end
|
128
133
|
|
@@ -152,7 +157,7 @@ module JsonRpcObjects
|
|
152
157
|
}
|
153
158
|
|
154
159
|
if not @version.nil?
|
155
|
-
data[:version] = @version
|
160
|
+
data[:version] = @version
|
156
161
|
end
|
157
162
|
|
158
163
|
if not @summary.nil?
|
@@ -228,10 +233,6 @@ module JsonRpcObjects
|
|
228
233
|
@id = Addressable::URI::parse(@id.to_s)
|
229
234
|
end
|
230
235
|
|
231
|
-
if (not @version.nil?) and (not @version.kind_of? Version)
|
232
|
-
@version = @version.to_s.to_version
|
233
|
-
end
|
234
|
-
|
235
236
|
if not @summary.nil?
|
236
237
|
@summary = @summary.to_s
|
237
238
|
end
|
@@ -15,7 +15,7 @@ res = JsonRpcObjects::V11::WD::ProcedureReturn::create(true, nil, :id => 12345)
|
|
15
15
|
puts res.to_json
|
16
16
|
|
17
17
|
require "../service-description"
|
18
|
-
sdesc = JsonRpcObjects::V11::WD::ServiceDescription::create(:alfa, 100)
|
18
|
+
sdesc = JsonRpcObjects::V11::WD::ServiceDescription::create(:alfa, 100, :version => "1.2.34")
|
19
19
|
puts sdesc.to_json
|
20
20
|
|
21
21
|
require "../service-procedure-description"
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Martin Koz\xC3\xA1k"
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-18 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -62,24 +62,9 @@ dependencies:
|
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: *id003
|
65
|
-
- !ruby/object:Gem::Dependency
|
66
|
-
name: version
|
67
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
68
|
-
none: false
|
69
|
-
requirements:
|
70
|
-
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
segments:
|
73
|
-
- 0
|
74
|
-
- 9
|
75
|
-
- 2
|
76
|
-
version: 0.9.2
|
77
|
-
type: :runtime
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: *id004
|
80
65
|
- !ruby/object:Gem::Dependency
|
81
66
|
name: addressable
|
82
|
-
requirement: &
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
83
68
|
none: false
|
84
69
|
requirements:
|
85
70
|
- - ">="
|
@@ -91,10 +76,10 @@ dependencies:
|
|
91
76
|
version: 2.2.2
|
92
77
|
type: :runtime
|
93
78
|
prerelease: false
|
94
|
-
version_requirements: *
|
79
|
+
version_requirements: *id004
|
95
80
|
- !ruby/object:Gem::Dependency
|
96
81
|
name: yajl-ruby
|
97
|
-
requirement: &
|
82
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
98
83
|
none: false
|
99
84
|
requirements:
|
100
85
|
- - ">="
|
@@ -106,10 +91,10 @@ dependencies:
|
|
106
91
|
version: 0.7.8
|
107
92
|
type: :runtime
|
108
93
|
prerelease: false
|
109
|
-
version_requirements: *
|
94
|
+
version_requirements: *id005
|
110
95
|
- !ruby/object:Gem::Dependency
|
111
96
|
name: bundler
|
112
|
-
requirement: &
|
97
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
113
98
|
none: false
|
114
99
|
requirements:
|
115
100
|
- - ~>
|
@@ -121,10 +106,10 @@ dependencies:
|
|
121
106
|
version: 1.0.0
|
122
107
|
type: :development
|
123
108
|
prerelease: false
|
124
|
-
version_requirements: *
|
109
|
+
version_requirements: *id006
|
125
110
|
- !ruby/object:Gem::Dependency
|
126
111
|
name: jeweler
|
127
|
-
requirement: &
|
112
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
128
113
|
none: false
|
129
114
|
requirements:
|
130
115
|
- - ~>
|
@@ -136,7 +121,7 @@ dependencies:
|
|
136
121
|
version: 1.5.2
|
137
122
|
type: :development
|
138
123
|
prerelease: false
|
139
|
-
version_requirements: *
|
124
|
+
version_requirements: *id007
|
140
125
|
description:
|
141
126
|
email: martinkozak@martinkozak.net
|
142
127
|
executables: []
|
@@ -207,7 +192,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
207
192
|
requirements:
|
208
193
|
- - ">="
|
209
194
|
- !ruby/object:Gem::Version
|
210
|
-
hash:
|
195
|
+
hash: -3422692750047768793
|
211
196
|
segments:
|
212
197
|
- 0
|
213
198
|
version: "0"
|