wsdsl 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/params_verification.rb +1 -1
- data/lib/wsdsl.rb +10 -6
- data/spec/wsdsl_spec.rb +6 -0
- data/wsdsl.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/lib/params_verification.rb
CHANGED
@@ -166,7 +166,7 @@ module ParamsVerification
|
|
166
166
|
|
167
167
|
def self.unexpected_params?(params, param_names)
|
168
168
|
# Raise an exception unless no unexpected params were found
|
169
|
-
unexpected_keys = (params.keys
|
169
|
+
unexpected_keys = (params.keys - param_names)
|
170
170
|
unless unexpected_keys.empty?
|
171
171
|
raise UnexpectedParam, "Request included unexpected parameter(s): #{unexpected_keys.join(', ')}"
|
172
172
|
end
|
data/lib/wsdsl.rb
CHANGED
@@ -18,7 +18,7 @@ require File.expand_path('ws_list', File.dirname(__FILE__))
|
|
18
18
|
#
|
19
19
|
# WSDSL
|
20
20
|
# |
|
21
|
-
# |__ service options (name, url, SSL, auth required formats, verbs, controller name, action, version)
|
21
|
+
# |__ service options (name, url, SSL, auth required formats, verbs, controller name, action, version, extra)
|
22
22
|
# |__ defined_params (instance of WSDSL::Params)
|
23
23
|
# | | | |_ Optional param rules
|
24
24
|
# | | |_ Required param rules
|
@@ -32,14 +32,11 @@ require File.expand_path('ws_list', File.dirname(__FILE__))
|
|
32
32
|
# | | | |_ overal) description
|
33
33
|
# | | |_ examples (array of examples as strings)
|
34
34
|
# | |_ params documentation (Hash with the key being the param name and the value being the param documentation)
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
35
|
# |_ response (instance of Documentation.new)
|
39
36
|
# |_ elements (array of instances of WSDSL::Documentation::ElementDoc, each element has a name and a list of attributes)
|
40
37
|
# |_ attributes (Hash with the key being the attribute name and the value being the attribute's documentation)
|
41
38
|
#
|
42
|
-
# @since 0.
|
39
|
+
# @since 0.0.3
|
43
40
|
# @api public
|
44
41
|
class WSDSL
|
45
42
|
|
@@ -108,7 +105,13 @@ class WSDSL
|
|
108
105
|
# @return [Boolean]
|
109
106
|
# @api public
|
110
107
|
attr_reader :auth_required
|
111
|
-
|
108
|
+
|
109
|
+
# Extra placeholder to store data in based on developer's discretion.
|
110
|
+
#
|
111
|
+
# @return [Hash] A hash storing extra data based.
|
112
|
+
# @api public
|
113
|
+
# @since 0.1
|
114
|
+
attr_reader :extra
|
112
115
|
|
113
116
|
# Service constructor which is usually used via {Kernel#describe_service}
|
114
117
|
#
|
@@ -128,6 +131,7 @@ class WSDSL
|
|
128
131
|
@version = '0.1'
|
129
132
|
@ssl = false
|
130
133
|
@auth_required = true
|
134
|
+
@extra = {}
|
131
135
|
end
|
132
136
|
|
133
137
|
# Offers a way to dispatch the service at runtime
|
data/spec/wsdsl_spec.rb
CHANGED
@@ -69,6 +69,12 @@ describe WSDSL do
|
|
69
69
|
service.action.should == 'show'
|
70
70
|
end
|
71
71
|
|
72
|
+
it "should support some extra attributes" do
|
73
|
+
service = WSDSL.new("players/:id.xml")
|
74
|
+
service.extra[:custom_name] = 'fooBar'
|
75
|
+
service.extra[:custom_name].should == 'fooBar'
|
76
|
+
end
|
77
|
+
|
72
78
|
describe WSDSL::Params do
|
73
79
|
|
74
80
|
before(:all) do
|
data/wsdsl.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{wsdsl}
|
8
|
-
s.version = "0.0
|
8
|
+
s.version = "0.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Matt Aimonetti"]
|
12
|
-
s.date = %q{2011-03-
|
12
|
+
s.date = %q{2011-03-14}
|
13
13
|
s.description = %q{A Ruby DSL describing Web Services without implementation details.}
|
14
14
|
s.email = %q{mattaimonetti@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
|
9
|
-
version: 0.0.3
|
9
|
+
version: 0.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Matt Aimonetti
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-03-
|
17
|
+
date: 2011-03-14 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|