LVS-JSONService 0.3.3 → 0.3.4

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.
@@ -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.3.3
4
+ version: 0.3.4
5
5
  require_paths:
6
6
  - lib
7
7
  platform: ruby
@@ -1,8 +1,8 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  Gem::Specification.new do |s|
4
- s.name = %q{JSONService}
5
- s.version = "0.3.3"
4
+ s.name = %q{LVS-JSONService}
5
+ s.version = "0.3.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["LVS", "andyjeffries"]
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.files = [
16
16
  ".gitignore",
17
17
  ".specification",
18
- "JSONService.gemspec",
18
+ "LVS-JSONService.gemspec",
19
19
  "LICENSE",
20
20
  "README.rdoc",
21
21
  "Rakefile",
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
@@ -162,13 +162,23 @@ module LVS
162
162
  !value.nil?
163
163
  end
164
164
 
165
+ def value_for_key(key)
166
+ value = @data[key]
167
+ if value.blank?
168
+ value = @data[key.capitalize]
169
+ end
170
+ value
171
+ end
172
+
165
173
  def method_missing(name, *args)
166
174
  name = name.to_s
167
175
  if name == "respond_to?" # don't know why this hack is necessary, but it is at the moment...
168
176
  return respond_to?(args[0])
169
177
  end
170
178
  key = name_to_key(name)
179
+ puts "Name #{name} is key #{key}"
171
180
  value = @data[key]
181
+ value = value_for_key(key)
172
182
  if name =~ /=$/
173
183
  @data[key] = ManuallySetData.new(args[0])
174
184
  value = @data[key]
@@ -15,6 +15,7 @@ module LVS
15
15
  uri = URI.parse(service)
16
16
 
17
17
  req = Net::HTTP::Post.new(uri.path)
18
+ args[:requestId] = Digest::SHA1.hexdigest((rand(4294967295)+Time.now.usec).to_s)
18
19
  req.form_data = { "object_request" => args.to_json }
19
20
 
20
21
  options[:encrypted] ||= require_ssl?
@@ -60,7 +61,7 @@ module LVS
60
61
  end
61
62
 
62
63
  if response.is_a?(Net::HTTPNotFound)
63
- raise LVS::JsonService::NotFoundError.new("404 Found for the service", 404, service, args)
64
+ raise LVS::JsonService::NotFoundError.new("404 Found for the service #{service}", 404, service, args)
64
65
  end
65
66
 
66
67
  if response.is_a?(Net::HTTPNotModified)
@@ -9,7 +9,7 @@ class TestServiceForJsonMethodsCall < LVS::JsonService::Base
9
9
  fake_service :details,
10
10
  '{"id":1, "status":"OK", "count":2, "startDate":1240498565709, "hasOwner":1,
11
11
  "bets":[{"betAmount":123}, {"betAmount":456}],
12
- "startDate":1240498565709, "with123":1}'
12
+ "startDate":1240498565709, "with123":1, "ECredit":1}'
13
13
  end
14
14
 
15
15
  describe LVS::JsonService::Base do
@@ -54,4 +54,8 @@ describe LVS::JsonService::Base do
54
54
  obj.longMethodName.should eql(1)
55
55
  obj.long_method_name.should eql(1)
56
56
  end
57
+
58
+ it "should recognise keys that start with two capital letters" do
59
+ TestServiceForJsonMethodsCall.details.e_credit.should eql(1)
60
+ end
57
61
  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.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - LVS
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-08-06 00:00:00 -07:00
13
+ date: 2009-08-06 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
@@ -26,7 +26,7 @@ extra_rdoc_files:
26
26
  files:
27
27
  - .gitignore
28
28
  - .specification
29
- - JSONService.gemspec
29
+ - LVS-JSONService.gemspec
30
30
  - LICENSE
31
31
  - README.rdoc
32
32
  - Rakefile
@@ -48,9 +48,10 @@ files:
48
48
  - spec/lvs/json_service/setting_fields_spec.rb
49
49
  - spec/spec.opts
50
50
  - spec/spec_helper.rb
51
- has_rdoc: false
51
+ has_rdoc: true
52
52
  homepage: http://github.com/lvs/JSONService
53
- licenses:
53
+ licenses: []
54
+
54
55
  post_install_message:
55
56
  rdoc_options:
56
57
  - --charset=UTF-8