LVS-JSONService 0.2.2 → 0.2.3
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/.specification +1 -1
- data/JSONService.gemspec +2 -2
- data/VERSION +1 -1
- data/lib/lvs/json_service/base.rb +13 -2
- data/spec/lvs/json_service/base_spec.rb +14 -0
- metadata +2 -2
data/.specification
CHANGED
data/JSONService.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{JSONService}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["LVS"]
|
9
|
-
s.date = %q{2009-06-
|
9
|
+
s.date = %q{2009-06-26}
|
10
10
|
s.email = %q{info@lvs.co.uk}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
@@ -17,6 +17,7 @@ module LVS
|
|
17
17
|
@service_prefix = ""
|
18
18
|
@field_prefix = ""
|
19
19
|
@encrypted = false
|
20
|
+
@ignore_missing = false
|
20
21
|
@auth_cert = ""
|
21
22
|
@auth_key = ""
|
22
23
|
@auth_key_pass = ""
|
@@ -62,6 +63,14 @@ module LVS
|
|
62
63
|
value.gsub!(/^\//, '')
|
63
64
|
@site = (agp + '/' + value)
|
64
65
|
end
|
66
|
+
|
67
|
+
def ignore_missing=(value)
|
68
|
+
@ignore_missing = value
|
69
|
+
end
|
70
|
+
|
71
|
+
def ignore_missing
|
72
|
+
@ignore_missing
|
73
|
+
end
|
65
74
|
|
66
75
|
def debug(message)
|
67
76
|
LVS::JsonService::Logger.debug " \033[1;4;32mLVS::JsonService\033[0m #{message}"
|
@@ -178,8 +187,10 @@ module LVS
|
|
178
187
|
end
|
179
188
|
|
180
189
|
def method_missing(*args)
|
181
|
-
self.class.
|
182
|
-
|
190
|
+
unless self.class.ignore_missing
|
191
|
+
self.class.debug("Method #{args[0]} called on #{self.class} but is non-existant, returned default FALSE")
|
192
|
+
super
|
193
|
+
end
|
183
194
|
end
|
184
195
|
end
|
185
196
|
|
@@ -4,4 +4,18 @@ describe LVS::JsonService::Base do
|
|
4
4
|
it "should include Request" do
|
5
5
|
LVS::JsonService::Base.ancestors.should include(LVS::JsonService::Request)
|
6
6
|
end
|
7
|
+
|
8
|
+
it "should ignore calls to missing methods if ignore_missing is true" do
|
9
|
+
class IgnoreMissingExample < LVS::JsonService::Base
|
10
|
+
self.ignore_missing = true
|
11
|
+
end
|
12
|
+
obj = IgnoreMissingExample.new
|
13
|
+
obj.do_voodoo.should eql(nil)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should raise an exception on missing methods if ignore_missing is not set" do
|
17
|
+
class RaiseOnMissingExample < LVS::JsonService::Base; end
|
18
|
+
obj = RaiseOnMissingExample.new
|
19
|
+
lambda {obj.do_voodoo}.should raise_error(NoMethodError)
|
20
|
+
end
|
7
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: LVS-JSONService
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LVS
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-26 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|