Browse files

Removed more stuff, going to make it a drop in replacement for memcac…

…he-client

New Rakefile

Signed-off-by: Frederic Jean <fred@fredjean.net>

Signed-off-by: Ikai Lan <ikai.lan@gmail.com>
  • Loading branch information...
1 parent d850732 commit 1bb203c0c37b16fec750ed397cd8bbc647c7db15 Abhi Yerra committed with Apr 13, 2009
Showing with 33 additions and 60 deletions.
  1. +1 −0 MIT-LICENSE
  2. +12 −26 Rakefile
  3. +4 −0 VERSION.yml
  4. +16 −17 lib/{j_mem_cache.rb → memcache.rb}
  5. +0 −17 properties/log4j.properties
View
1 MIT-LICENSE
@@ -1,3 +1,4 @@
+Copyright (c) 2008 Abhi Yerra <abhi@traytwo.com>
Copyright (c) 2009 Ikai Lan <ikai.lan@gmail.com>
Copyright (c) 2009 Tiago Bastos <comechao@gmail.com>
Copyright (c) 2009 Frederic Jean <frederic.jean@sun.com>
View
38 Rakefile
@@ -1,27 +1,13 @@
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'spec/rake/spectask'
-
-desc 'Default: run unit tests.'
-task :default => :spec
-
-desc 'Run the specs for the jruby_memcache_client plugin.'
-Spec::Rake::SpecTask.new
-
-desc 'Test the ruby_memcache_client plugin.'
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.libs << 'test'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = true
-end
-
-desc 'Generate documentation for the ruby_memcache_client plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'Ruby-memcache-client'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README')
- rdoc.rdoc_files.include('lib/**/*.rb')
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gemspec|
+ gemspec.name = "jruby-memcache-client"
+ gemspec.summary = "A drop in replacement for Ruby's memcache-client."
+ gemspec.email = "abhi@traytwo.com"
+ gemspec.homepage = "http://github.com/abhiyerra/jruby-memcache-client"
+ gemspec.description = "A drop in replacement for Ruby's memcache-client."
+ gemspec.authors = ["Abhi Yerra", "Ikai Lan"]
+ end
+rescue LoadError
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
View
4 VERSION.yml
@@ -0,0 +1,4 @@
+---
+:minor: 5
+:major: 1
+:patch: 0
View
33 lib/j_mem_cache.rb → lib/memcache.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/java/java_memcached-release_2.0.1.jar'
-class JMemCache
+class MemCache
include_class 'com.danga.MemCached.MemCachedClient'
include_class 'com.danga.MemCached.SockIOPool'
@@ -202,23 +202,22 @@ def stats
end
protected
-
- def make_cache_key(key)
- if namespace.nil? then
- key
- else
- "#{@namespace}:#{key}"
+ def make_cache_key(key)
+ if namespace.nil? then
+ key
+ else
+ "#{@namespace}:#{key}"
+ end
+ end
+
+ def expiration(expiry)
+ java.util.Date.new((Time.now.to_i + expiry) * 1000)
+ end
+
+ def marshal_value(value)
+ marshal_bytes = Marshal.dump(value).to_java_bytes
+ java.lang.String.new(marshal_bytes, MARSHALLING_CHARSET)
end
- end
-
- def expiration(expiry)
- java.util.Date.new((Time.now.to_i + expiry) * 1000)
- end
-
- def marshal_value(value)
- marshal_bytes = Marshal.dump(value).to_java_bytes
- java.lang.String.new(marshal_bytes, MARSHALLING_CHARSET)
- end
class MemCacheError < RuntimeError; end
View
17 properties/log4j.properties
@@ -1,17 +0,0 @@
-# Default Logging Configuration
-
-log4j.rootLogger=INFO, stdout
-
-#to increase logging level
-
-#log4j.logger.org.dcm4cheri=DEBUG
-
-#to decrease logging level
-
-#log4j.logger.org.dcm4cheri=ERROR
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %-5p %x - %m

0 comments on commit 1bb203c

Please sign in to comment.