Created
February 1, 2010 06:06
-
-
Save nayutaya/291484 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 「memcacheで日本語キーが使用できない不具合」を修正するモンキーパッチ | |
# 対象はappengine-apis-0.0.12 | |
module AppEngine | |
class Memcache | |
def memcache_key(obj) | |
key = obj | |
key = java.lang.String.new(key.to_s) if key | |
key | |
end | |
class KeyMap | |
def <<(key) | |
@orig_keys << key | |
string_key = if key | |
key.to_s | |
else | |
key | |
end | |
@map[string_key] = key | |
if string_key | |
java.lang.String.new(string_key) | |
else | |
string_key | |
end | |
end | |
def java_keys | |
@map.keys.collect do |key| | |
if key | |
java.lang.String.new(key) | |
else | |
key | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment