Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update README

  • Loading branch information...
commit e1e68dbe56ad44d7360c3ec2b7910eecaae56043 1 parent e30f2a5
@flyerhzm flyerhzm authored
Showing with 59 additions and 7 deletions.
  1. +20 −0 MIT-LICENSE
  2. +38 −6 README.md
  3. +1 −1  jruby_memcached.gemspec
View
20 MIT-LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2012 Richard Huang (flyerhzm@gmail.com)
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
44 README.md
@@ -1,7 +1,39 @@
-jruby-memcached
-===============
+# jruby-memcached
-we used memcached gem before, but now we are migrating to jruby, but
-memcached didn't support jruby platform, and we can't find any
-ruby/jruby gem that compatible with memcached, have to write it by
-ourselves.
+A jruby memcached gem which is compatible with evan's [memcached][0] gem
+
+## Usage
+
+Now, in Ruby, require the library and instantiate a Memcached object at
+a global level:
+
+ require 'memcached'
+ $cache = Memcached.new("localhost:11211")
+
+Now you can set things and get things:
+
+ value = 'hello'
+ $cache.set 'test', value
+ $cache.get 'test' #=> "hello"
+
+You can set with an expiration timeout:
+
+ value = 'hello'
+ $cache.set 'test', value, 1
+ sleep(2)
+ $cache.get 'test' #=> raises Memcached::NotFound
+
+You can get multiple values at once:
+
+ value = 'hello'
+ $cache.set 'test', value
+ $cache.set 'test2', value
+ $cache.get ['test', 'test2', 'missing']
+ #=> {"test" => "hello", "test2" => "hello"}
+
+## Benchmarks
+
+see [benchmark][1]
+
+[0]:"https://github.com/evan/memcached"
+[1]:"https://github.com/aurorafeint/jruby-memcached/blob/master/benchmark.rb"
View
2  jruby_memcached.gemspec
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
s.version = Memcached::VERSION
s.authors = ["Richard Huang"]
s.email = ["flyerhzm@gmail.com"]
- s.homepage = ""
+ s.homepage = "https://github.com/aurorafeint/jruby-memcached"
s.summary = %q{jruby compatible memcached client}
s.description = %q{jruby memcacached client which is compatible with memcached gem}
Please sign in to comment.
Something went wrong with that request. Please try again.