callcache 0.1.1 → 0.1.2
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/callcache-0.1.2.gem +0 -0
- data/callcache.gemspec +1 -1
- data/lib/call_cache.rb +4 -4
- data/lib/main.rb +3 -2
- metadata +3 -4
- data/callcache-0.1.0.gem +0 -0
- data/callcache-0.1.gem +0 -0
data/callcache-0.1.2.gem
ADDED
File without changes
|
data/callcache.gemspec
CHANGED
data/lib/call_cache.rb
CHANGED
@@ -42,7 +42,7 @@ module CallCache
|
|
42
42
|
|
43
43
|
def CallCache.get_id_for( function_call, *parameters)
|
44
44
|
md5 = Digest::MD5::new
|
45
|
-
md5.update( function_call )
|
45
|
+
md5.update( function_call.gsub('::', '_').gsub('.', '_') )
|
46
46
|
md5.update( Marshal.dump( parameters ) )
|
47
47
|
return md5.hexdigest
|
48
48
|
end
|
@@ -84,14 +84,14 @@ module CallCache
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def CallCache.make_call( function_call, *parameters )
|
87
|
+
|
87
88
|
# call function
|
88
|
-
|
89
89
|
# parse call to handle local methods or static class methods
|
90
90
|
function_call.gsub!( '::', '.' )
|
91
91
|
function_call_split = function_call.split(/\./)
|
92
|
-
|
93
92
|
# make the call
|
94
|
-
|
93
|
+
|
94
|
+
return_val = eval( function_call_split[0..-2].join('::') ).method( function_call_split[-1] ).call( *parameters )
|
95
95
|
|
96
96
|
end
|
97
97
|
end
|
data/lib/main.rb
CHANGED
@@ -17,6 +17,8 @@
|
|
17
17
|
#=============================================================================
|
18
18
|
|
19
19
|
require 'call_cache'
|
20
|
+
require 'uri'
|
21
|
+
require 'net/http'
|
20
22
|
|
21
23
|
def exp_fun( start_num, end_num )
|
22
24
|
ret_val = 1
|
@@ -30,5 +32,4 @@ end
|
|
30
32
|
|
31
33
|
|
32
34
|
p CallCache.call( 'exp_fun', 1, 10000 )
|
33
|
-
|
34
|
-
|
35
|
+
p CallCache.call( 'Net::HTTP.get', URI.parse('http://www.google.com') );
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: callcache
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.1.2
|
7
|
+
date: 2007-03-03 00:00:00 -05:00
|
8
8
|
summary: Ruby library for caching results of a function call
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -29,8 +29,7 @@ post_install_message:
|
|
29
29
|
authors:
|
30
30
|
- Adam Wisniewski
|
31
31
|
files:
|
32
|
-
- callcache-0.1.
|
33
|
-
- callcache-0.1.gem
|
32
|
+
- callcache-0.1.2.gem
|
34
33
|
- callcache.gemspec
|
35
34
|
- lib
|
36
35
|
- nbproject
|
data/callcache-0.1.0.gem
DELETED
Binary file
|
data/callcache-0.1.gem
DELETED
Binary file
|