Permalink
Browse files

add some simple memcache-like aliases for compatibility sake

  • Loading branch information...
1 parent 0a49262 commit 294395d335d366876bc3f05f331e9458ec70411f Dylan Stamat committed Jul 3, 2008
Showing with 11 additions and 97 deletions.
  1. +0 −5 Manifest.txt
  2. +2 −7 PostInstall.txt
  3. +2 −2 ext/rails/ehcache_store.rb
  4. +7 −0 lib/ehcache/cache.rb
  5. BIN pkg/ehcache-0.0.1.gem
  6. +0 −83 website/index.txt
View
@@ -35,8 +35,3 @@ tasks/website.rake
test/test_ehcache.rb
test/test_ehcachejr.rb
test/test_helper.rb
-website/index.html
-website/index.txt
-website/javascripts/rounded_corners_lite.inc.js
-website/stylesheets/screen.css
-website/template.html.erb
View
@@ -1,7 +1,2 @@
-
-For more information on ehcache, see http://ehcache.rubyforge.org
-
-NOTE: Change this information in PostInstall.txt
-You can also delete it if you don't want it.
-
-
+For more information on this gem, and Ehcache proper, see:
+http://github.com/dylanz/ehcache/tree/master/README.txt
@@ -22,15 +22,15 @@ def write(key, value, options = nil)
@data.set(key, value, options)
true
rescue Ehcache::EhcacheError => e
- logger.error("MemCacheError (#{e}): #{e.message}")
+ logger.error("EhcacheError (#{e}): #{e.message}")
false
end
def delete(key, options = nil)
super
@data.delete(key)
rescue Exception => e
- logger.error("MemCacheError (#{e}): #{e.message}")
+ logger.error("EhcacheError (#{e}): #{e.message}")
false
end
View
@@ -19,13 +19,19 @@ def put(key, value, options = {})
end
alias_method :set, :put
+ # another alias for put
+ def []=(key, value)
+ put(key, value)
+ end
+
# get an element value from cache by key
def get(key)
element = @proxy.get(key)
element ? element.get_value : nil
rescue NativeException => e
raise EhcacheError, e.cause
end
+ alias_method :[], :get
# get an element from cache by key
def element(key)
@@ -43,6 +49,7 @@ def remove(key)
rescue NativeException => e
raise EhcacheError, e.cause
end
+ alias_method :delete, :remove
# remove all elements from the cache
def remove_all
View
Binary file not shown.
View
@@ -1,83 +0,0 @@
-h1. ehcache
-
-h1. → 'ehcache'
-
-
-h2. What
-
-
-h2. Installing
-
-<pre syntax="ruby">sudo gem install ehcache</pre>
-
-h2. The basics
-
-
-h2. Demonstration of usage
-
-
-
-h2. Forum
-
-"http://groups.google.com/group/ehcache":http://groups.google.com/group/ehcache
-
-TODO - create Google Group - ehcache
-
-h2. How to submit patches
-
-Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
-
-TODO - pick SVN or Git instructions
-
-The trunk repository is <code>svn://rubyforge.org/var/svn/ehcache/trunk</code> for anonymous access.
-
-OOOORRRR
-
-You can fetch the source from either:
-
-<% if rubyforge_project_id %>
-
-* rubyforge: "http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>":http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>
-
-<pre>git clone git://rubyforge.org/ehcache.git</pre>
-
-<% else %>
-
-* rubyforge: MISSING IN ACTION
-
-TODO - You can not created a RubyForge project, OR have not run <code>rubyforge config</code>
-yet to refresh your local rubyforge data with this projects' id information.
-
-When you do this, this message will magically disappear!
-
-Or you can hack website/index.txt and make it all go away!!
-
-<% end %>
-
-* github: "http://github.com/GITHUB_USERNAME/ehcache/tree/master":http://github.com/GITHUB_USERNAME/ehcache/tree/master
-
-<pre>git clone git://github.com/GITHUB_USERNAME/ehcache.git</pre>
-
-
-TODO - add "github_username: username" to ~/.rubyforge/user-config.yml and newgem will reuse it for future projects.
-
-
-* gitorious: "git://gitorious.org/ehcache/mainline.git":git://gitorious.org/ehcache/mainline.git
-
-<pre>git clone git://gitorious.org/ehcache/mainline.git</pre>
-
-h3. Build and test instructions
-
-<pre>cd ehcache
-rake test
-rake install_gem</pre>
-
-
-h2. License
-
-This code is free to use under the terms of the MIT license.
-
-h2. Contact
-
-Comments are welcome. Send an email to "FIXME full name":mailto:FIXME email via the "forum":http://groups.google.com/group/ehcache
-

0 comments on commit 294395d

Please sign in to comment.