cloud_cache 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cloud_cache.rb CHANGED
@@ -94,10 +94,10 @@ class CloudCache < ActiveSupport::Cache::Store
94
94
  @http_conn = Rightscale::HttpConnection.new()
95
95
  end
96
96
 
97
- req_params = { :request => req,
98
- :server => @host,
99
- :port => @port,
100
- :protocol => @protocol }
97
+ req_params = {:request => req,
98
+ :server => @host,
99
+ :port => @port,
100
+ :protocol => @protocol}
101
101
  res = @http_conn.request(req_params)
102
102
  else
103
103
  res = Net::HTTP.start(uri.host, uri.port) do |http|
@@ -143,7 +143,7 @@ class CloudCache < ActiveSupport::Cache::Store
143
143
  raw = options[:raw]
144
144
  kj = keys.to_json
145
145
  #puts "keys.to_json = " + kj
146
- extra_headers = {"keys" => kj }
146
+ extra_headers = {"keys" => kj}
147
147
  #puts "get_multi, extra_headers keys = " + extra_headers.keys.to_s
148
148
  #puts "get_multi, extra_headers vals = " + extra_headers.values.to_s
149
149
  body = run_http(:get, "GET", "getmulti", nil, nil, extra_headers)
@@ -201,7 +201,16 @@ class CloudCache < ActiveSupport::Cache::Store
201
201
  return data
202
202
  else
203
203
  #data = Base64.decode64(data)
204
- return Marshal.load((data))
204
+ begin
205
+ return Marshal.load((data))
206
+ rescue ArgumentError => ex
207
+ # Most likely: ArgumentError: marshal data too short
208
+ # Let's assume the ruby version has been updated or something and handle this elegantly, next put should fix it
209
+ puts 'ArgumentError on Marshal.load! ' + ex.message
210
+ puts 'Returning nil, please reput and try again.'
211
+ return nil
212
+ end
213
+
205
214
  end
206
215
  end
207
216
 
data/test/my_class.rb CHANGED
@@ -1,9 +1,9 @@
1
-
2
- class MyClass
3
- attr_accessor :name, :age
4
-
5
- def initialize(name, age)
6
- @name = name
7
- @age = age
8
- end
1
+
2
+ class MyClass
3
+ attr_accessor :name, :age
4
+
5
+ def initialize(name, age)
6
+ @name = name
7
+ @age = age
8
+ end
9
9
  end
data/test/test_runner.rb CHANGED
@@ -1,10 +1,10 @@
1
- # temporary until rubymine supports ruby 1.i
2
-
3
- #require 'test/unit'
4
- #require 'cache_tests'
5
-
6
- #t = CacheTests.new("test_get_multi")
7
- #Test::Unit::UI::Console::TestRunner.run(CacheTests)
8
- #t.setup
9
- #t.test_counters
10
- #t.teardown
1
+ # temporary until rubymine supports ruby 1.i
2
+
3
+ #require 'test/unit'
4
+ #require 'cache_tests'
5
+
6
+ #t = CacheTests.new("test_get_multi")
7
+ #Test::Unit::UI::Console::TestRunner.run(CacheTests)
8
+ #t.setup
9
+ #t.test_counters
10
+ #t.teardown
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 3
8
+ - 1
9
+ version: 1.3.1
5
10
  platform: ruby
6
11
  authors:
7
12
  - Travis Reeder
@@ -9,19 +14,22 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-11-25 00:00:00 -08:00
17
+ date: 2010-09-19 00:00:00 -07:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: http_connection
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
20
25
  requirements:
21
26
  - - ">="
22
27
  - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
23
30
  version: "0"
24
- version:
31
+ type: :runtime
32
+ version_requirements: *id001
25
33
  description: Client library for Quetzall's CloudCache service.
26
34
  email: travis@appoxy.com
27
35
  executables: []
@@ -35,6 +43,9 @@ files:
35
43
  - lib/hmac-sha1.rb
36
44
  - lib/hmac.rb
37
45
  - README.markdown
46
+ - test/cache_tests.rb
47
+ - test/my_class.rb
48
+ - test/test_runner.rb
38
49
  has_rdoc: true
39
50
  homepage: http://github.com/quetzall/cloud_cache/
40
51
  licenses: []
@@ -45,21 +56,25 @@ rdoc_options:
45
56
  require_paths:
46
57
  - lib
47
58
  required_ruby_version: !ruby/object:Gem::Requirement
59
+ none: false
48
60
  requirements:
49
61
  - - ">="
50
62
  - !ruby/object:Gem::Version
63
+ segments:
64
+ - 0
51
65
  version: "0"
52
- version:
53
66
  required_rubygems_version: !ruby/object:Gem::Requirement
67
+ none: false
54
68
  requirements:
55
69
  - - ">="
56
70
  - !ruby/object:Gem::Version
71
+ segments:
72
+ - 0
57
73
  version: "0"
58
- version:
59
74
  requirements: []
60
75
 
61
76
  rubyforge_project:
62
- rubygems_version: 1.3.5
77
+ rubygems_version: 1.3.7
63
78
  signing_key:
64
79
  specification_version: 3
65
80
  summary: Client library for Quetzall's CloudCache service.