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.
File without changes
data/callcache.gemspec CHANGED
@@ -3,7 +3,7 @@ require 'date'
3
3
 
4
4
  SPEC = Gem::Specification.new do |s|
5
5
  s.name = "callcache"
6
- s.version = "0.1.1"
6
+ s.version = "0.1.2"
7
7
  s.author = "Adam Wisniewski"
8
8
  s.email = "adamw@tbcn.ca"
9
9
  s.date = s.date = Date.today.to_s
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
- return_val = eval(function_call_split[0..-2].join('::')).method( function_call_split[-1] ).call( *parameters )
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.1
7
- date: 2007-02-25 00:00:00 -05:00
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.0.gem
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