rubysl-xmlrpc 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +14 -6
- data/.travis.yml +5 -6
- data/lib/rubysl/xmlrpc.rb +1 -0
- data/lib/rubysl/xmlrpc/version.rb +1 -1
- data/lib/rubysl/xmlrpc/xmlrpc.rb +301 -0
- data/lib/xmlrpc.rb +1 -0
- data/lib/xmlrpc/.document +1 -0
- data/lib/xmlrpc/README.rdoc +300 -0
- data/lib/xmlrpc/base64.rb +27 -46
- data/lib/xmlrpc/client.rb +320 -343
- data/lib/xmlrpc/config.rb +18 -16
- data/lib/xmlrpc/create.rb +108 -112
- data/lib/xmlrpc/datetime.rb +59 -72
- data/lib/xmlrpc/httpserver.rb +38 -43
- data/lib/xmlrpc/marshal.rb +6 -16
- data/lib/xmlrpc/parser.rb +267 -242
- data/lib/xmlrpc/server.rb +297 -372
- data/lib/xmlrpc/utils.rb +40 -34
- data/rubysl-xmlrpc.gemspec +0 -1
- metadata +16 -24
data/lib/xmlrpc/utils.rb
CHANGED
@@ -1,32 +1,41 @@
|
|
1
1
|
#
|
2
|
-
# Defines ParserWriterChooseMixin, which makes it possible to choose a
|
3
|
-
# different XML writer and/or XML parser then the default one.
|
4
|
-
# The Mixin is used in client.rb (class Client) and server.rb (class
|
5
|
-
# BasicServer)
|
6
|
-
#
|
7
2
|
# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
|
8
3
|
#
|
9
|
-
# $Id
|
4
|
+
# $Id$
|
10
5
|
#
|
6
|
+
module XMLRPC # :nodoc:
|
11
7
|
|
12
|
-
module XMLRPC
|
13
8
|
|
14
|
-
#
|
15
9
|
# This module enables a user-class to be marshalled
|
16
10
|
# by XML-RPC for Ruby into a Hash, with one additional
|
17
|
-
# key/value pair
|
18
|
-
#
|
11
|
+
# key/value pair <code>___class___ => ClassName</code>
|
12
|
+
#
|
19
13
|
module Marshallable
|
20
14
|
end
|
21
15
|
|
22
16
|
|
17
|
+
# Defines ParserWriterChooseMixin, which makes it possible to choose a
|
18
|
+
# different XMLWriter and/or XMLParser then the default one.
|
19
|
+
#
|
20
|
+
# The Mixin is used in client.rb (class XMLRPC::Client)
|
21
|
+
# and server.rb (class XMLRPC::BasicServer)
|
23
22
|
module ParserWriterChooseMixin
|
24
23
|
|
24
|
+
# Sets the XMLWriter to use for generating XML output.
|
25
|
+
#
|
26
|
+
# Should be an instance of a class from module XMLRPC::XMLWriter.
|
27
|
+
#
|
28
|
+
# If this method is not called, then XMLRPC::Config::DEFAULT_WRITER is used.
|
25
29
|
def set_writer(writer)
|
26
30
|
@create = Create.new(writer)
|
27
31
|
self
|
28
32
|
end
|
29
33
|
|
34
|
+
# Sets the XMLParser to use for parsing XML documents.
|
35
|
+
#
|
36
|
+
# Should be an instance of a class from module XMLRPC::XMLParser.
|
37
|
+
#
|
38
|
+
# If this method is not called, then XMLRPC::Config::DEFAULT_PARSER is used.
|
30
39
|
def set_parser(parser)
|
31
40
|
@parser = parser
|
32
41
|
self
|
@@ -37,7 +46,7 @@ module XMLRPC
|
|
37
46
|
def create
|
38
47
|
# if set_writer was not already called then call it now
|
39
48
|
if @create.nil? then
|
40
|
-
|
49
|
+
set_writer(Config::DEFAULT_WRITER.new)
|
41
50
|
end
|
42
51
|
@create
|
43
52
|
end
|
@@ -45,7 +54,7 @@ module XMLRPC
|
|
45
54
|
def parser
|
46
55
|
# if set_parser was not already called then call it now
|
47
56
|
if @parser.nil? then
|
48
|
-
|
57
|
+
set_parser(Config::DEFAULT_PARSER.new)
|
49
58
|
end
|
50
59
|
@parser
|
51
60
|
end
|
@@ -55,11 +64,8 @@ module XMLRPC
|
|
55
64
|
|
56
65
|
module Service
|
57
66
|
|
58
|
-
#
|
59
|
-
#
|
60
|
-
# by BasicServer#add_handler
|
61
|
-
#
|
62
|
-
|
67
|
+
# Base class for XMLRPC::Service::Interface definitions, used
|
68
|
+
# by XMLRPC::BasicServer#add_handler
|
63
69
|
class BasicInterface
|
64
70
|
attr_reader :prefix, :methods
|
65
71
|
|
@@ -72,9 +78,9 @@ module XMLRPC
|
|
72
78
|
mname = nil
|
73
79
|
sig = [sig] if sig.kind_of? String
|
74
80
|
|
75
|
-
sig = sig.collect do |s|
|
81
|
+
sig = sig.collect do |s|
|
76
82
|
name, si = parse_sig(s)
|
77
|
-
raise "Wrong signatures!" if mname != nil and name != mname
|
83
|
+
raise "Wrong signatures!" if mname != nil and name != mname
|
78
84
|
mname = name
|
79
85
|
si
|
80
86
|
end
|
@@ -82,13 +88,13 @@ module XMLRPC
|
|
82
88
|
@methods << [mname, meth_name || mname, sig, help]
|
83
89
|
end
|
84
90
|
|
85
|
-
private
|
86
|
-
|
91
|
+
private
|
92
|
+
|
87
93
|
def parse_sig(sig)
|
88
94
|
# sig is a String
|
89
95
|
if sig =~ /^\s*(\w+)\s+([^(]+)(\(([^)]*)\))?\s*$/
|
90
96
|
params = [$1]
|
91
|
-
name = $2.strip
|
97
|
+
name = $2.strip
|
92
98
|
$4.split(",").each {|i| params << i.strip} if $4 != nil
|
93
99
|
return name, params
|
94
100
|
else
|
@@ -99,8 +105,8 @@ module XMLRPC
|
|
99
105
|
end # class BasicInterface
|
100
106
|
|
101
107
|
#
|
102
|
-
#
|
103
|
-
# by BasicServer#add_handler
|
108
|
+
# Class which wraps a XMLRPC::Service::Interface definition, used
|
109
|
+
# by XMLRPC::BasicServer#add_handler
|
104
110
|
#
|
105
111
|
class Interface < BasicInterface
|
106
112
|
def initialize(prefix, &p)
|
@@ -109,14 +115,14 @@ module XMLRPC
|
|
109
115
|
instance_eval(&p)
|
110
116
|
end
|
111
117
|
|
112
|
-
def get_methods(obj, delim=".")
|
118
|
+
def get_methods(obj, delim=".")
|
113
119
|
prefix = @prefix + delim
|
114
|
-
@methods.collect { |name, meth, sig, help|
|
115
|
-
[prefix + name, obj.method(meth).to_proc, sig, help]
|
120
|
+
@methods.collect { |name, meth, sig, help|
|
121
|
+
[prefix + name.to_s, obj.method(meth).to_proc, sig, help]
|
116
122
|
}
|
117
123
|
end
|
118
124
|
|
119
|
-
private
|
125
|
+
private
|
120
126
|
|
121
127
|
def meth(*a)
|
122
128
|
add_method(*a)
|
@@ -132,7 +138,7 @@ module XMLRPC
|
|
132
138
|
def get_methods(obj, delim=".")
|
133
139
|
prefix = @prefix + delim
|
134
140
|
obj.class.public_instance_methods(false).collect { |name|
|
135
|
-
[prefix + name, obj.method(name).to_proc, nil, nil]
|
141
|
+
[prefix + name.to_s, obj.method(name).to_proc, nil, nil]
|
136
142
|
}
|
137
143
|
end
|
138
144
|
end
|
@@ -141,16 +147,16 @@ module XMLRPC
|
|
141
147
|
end # module Service
|
142
148
|
|
143
149
|
|
144
|
-
#
|
145
|
-
#
|
150
|
+
#
|
151
|
+
# Short-form to create a XMLRPC::Service::Interface
|
146
152
|
#
|
147
153
|
def self.interface(prefix, &p)
|
148
|
-
Service::Interface.new(prefix, &p)
|
154
|
+
Service::Interface.new(prefix, &p)
|
149
155
|
end
|
150
156
|
|
151
|
-
#
|
157
|
+
# Short-cut for creating a XMLRPC::Service::PublicInstanceMethodsInterface
|
152
158
|
def self.iPIMethods(prefix)
|
153
|
-
Service::PublicInstanceMethodsInterface.new(prefix)
|
159
|
+
Service::PublicInstanceMethodsInterface.new(prefix)
|
154
160
|
end
|
155
161
|
|
156
162
|
|
data/rubysl-xmlrpc.gemspec
CHANGED
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubysl-xmlrpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Shirai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
+
prerelease: false
|
14
15
|
name: bundler
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
@@ -18,13 +19,13 @@ dependencies:
|
|
18
19
|
- !ruby/object:Gem::Version
|
19
20
|
version: '1.3'
|
20
21
|
type: :development
|
21
|
-
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
+
prerelease: false
|
28
29
|
name: rake
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
30
31
|
requirements:
|
@@ -32,13 +33,13 @@ dependencies:
|
|
32
33
|
- !ruby/object:Gem::Version
|
33
34
|
version: '10.0'
|
34
35
|
type: :development
|
35
|
-
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
+
prerelease: false
|
42
43
|
name: mspec
|
43
44
|
requirement: !ruby/object:Gem::Requirement
|
44
45
|
requirements:
|
@@ -46,26 +47,11 @@ dependencies:
|
|
46
47
|
- !ruby/object:Gem::Version
|
47
48
|
version: '1.5'
|
48
49
|
type: :development
|
49
|
-
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.5'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubysl-prettyprint
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ~>
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.0'
|
69
55
|
description: Ruby standard library xmlrpc.
|
70
56
|
email:
|
71
57
|
- brixen@gmail.com
|
@@ -81,6 +67,10 @@ files:
|
|
81
67
|
- Rakefile
|
82
68
|
- lib/rubysl/xmlrpc.rb
|
83
69
|
- lib/rubysl/xmlrpc/version.rb
|
70
|
+
- lib/rubysl/xmlrpc/xmlrpc.rb
|
71
|
+
- lib/xmlrpc.rb
|
72
|
+
- lib/xmlrpc/.document
|
73
|
+
- lib/xmlrpc/README.rdoc
|
84
74
|
- lib/xmlrpc/README.txt
|
85
75
|
- lib/xmlrpc/base64.rb
|
86
76
|
- lib/xmlrpc/client.rb
|
@@ -103,17 +93,19 @@ require_paths:
|
|
103
93
|
- lib
|
104
94
|
required_ruby_version: !ruby/object:Gem::Requirement
|
105
95
|
requirements:
|
106
|
-
- - '>='
|
96
|
+
- - ! '>='
|
107
97
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
98
|
+
version: !binary |-
|
99
|
+
MA==
|
109
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
101
|
requirements:
|
111
|
-
- - '>='
|
102
|
+
- - ! '>='
|
112
103
|
- !ruby/object:Gem::Version
|
113
|
-
version:
|
104
|
+
version: !binary |-
|
105
|
+
MA==
|
114
106
|
requirements: []
|
115
107
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.0.
|
108
|
+
rubygems_version: 2.0.6
|
117
109
|
signing_key:
|
118
110
|
specification_version: 4
|
119
111
|
summary: Ruby standard library xmlrpc.
|