playerconnect-wsdsl 0.2.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/params_verification.rb +12 -4
- data/playerconnect-wsdsl.gemspec +2 -2
- metadata +2 -2
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ Jeweler::Tasks.new do |gem|
|
|
11
11
|
gem.description = %Q{A Ruby DSL describing Web Services without implementation details.}
|
12
12
|
gem.email = "sdod"
|
13
13
|
gem.authors = ["Team SDOD"]
|
14
|
-
gem.version = "0.
|
14
|
+
gem.version = "0.3.0"
|
15
15
|
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
16
16
|
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
17
17
|
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/params_verification.rb
CHANGED
@@ -140,20 +140,28 @@ module ParamsVerification
|
|
140
140
|
# Checks presence
|
141
141
|
if !(namespaced_params || params).keys.include?(param_name)
|
142
142
|
raise MissingParam, "'#{rule.name}' is missing - passed params: #{params.inspect}."
|
143
|
+
end
|
144
|
+
|
143
145
|
# checks null
|
144
|
-
|
146
|
+
if param_value.nil? && !rule.options[:null]
|
145
147
|
raise InvalidParamValue, "Value for parameter '#{param_name}' is missing - passed params: #{params.inspect}."
|
148
|
+
end
|
149
|
+
|
146
150
|
# checks type
|
147
|
-
|
151
|
+
if rule.options[:type]
|
148
152
|
verify_cast(param_name, param_value, rule.options[:type])
|
149
|
-
|
153
|
+
end
|
154
|
+
|
155
|
+
if rule.options[:options] || rule.options[:in]
|
150
156
|
choices = rule.options[:options] || rule.options[:in]
|
151
157
|
if rule.options[:type]
|
152
158
|
# Force the cast so we can compare properly
|
153
159
|
param_value = params[param_name] = type_cast_value(rule.options[:type], param_value)
|
154
160
|
end
|
155
161
|
raise InvalidParamValue, "Value for parameter '#{param_name}' (#{param_value}) is not in the allowed set of values." unless choices.include?(param_value)
|
156
|
-
|
162
|
+
end
|
163
|
+
|
164
|
+
if rule.options[:minvalue]
|
157
165
|
min = rule.options[:minvalue]
|
158
166
|
raise InvalidParamValue, "Value for parameter '#{param_name}' is lower than the min accepted value (#{min})." if param_value.to_i >= min
|
159
167
|
end
|
data/playerconnect-wsdsl.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{playerconnect-wsdsl}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Team SDOD}]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-09-19}
|
13
13
|
s.description = %q{A Ruby DSL describing Web Services without implementation details.}
|
14
14
|
s.email = %q{sdod}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playerconnect-wsdsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-09-19 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: A Ruby DSL describing Web Services without implementation details.
|
15
15
|
email: sdod
|