* lib/pstore.rb: should return default value if name is not found.
[ruby-core:7304] * lib/pstore.rb: should raise PStore::Error if not in transaction. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1d2a56a60a
commit
4f4ea9db28
10
ChangeLog
10
ChangeLog
@ -1,3 +1,10 @@
|
|||||||
|
Sun Feb 5 14:26:54 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
||||||
|
|
||||||
|
* lib/pstore.rb: should return default value if name is not found.
|
||||||
|
[ruby-core:7304]
|
||||||
|
|
||||||
|
* lib/pstore.rb: should raise PStore::Error if not in transaction.
|
||||||
|
|
||||||
Sat Feb 4 22:51:43 2006 Tanaka Akira <akr@m17n.org>
|
Sat Feb 4 22:51:43 2006 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
* eval.c: apply the FreeBSD getcontext/setcontext workaround
|
* eval.c: apply the FreeBSD getcontext/setcontext workaround
|
||||||
@ -13,9 +20,6 @@ Sat Feb 4 15:52:56 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
|||||||
* numeric.c (fix_to_s): (2**32).to_s(2) fails with exception where
|
* numeric.c (fix_to_s): (2**32).to_s(2) fails with exception where
|
||||||
sizeof(int) == 4 < sizeof(long). [ruby-core:7300]
|
sizeof(int) == 4 < sizeof(long). [ruby-core:7300]
|
||||||
|
|
||||||
I think the function name of rb_int2big is quite misleading.
|
|
||||||
This should be "rb_long2big".
|
|
||||||
|
|
||||||
Sat Feb 4 15:02:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Sat Feb 4 15:02:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* oniguruma.h: merge Oniguruma 4.0.0 [ruby-dev:28290]
|
* oniguruma.h: merge Oniguruma 4.0.0 [ruby-dev:28290]
|
||||||
|
@ -135,14 +135,15 @@ class PStore
|
|||||||
# raise PStore::Error if called at any other time.
|
# raise PStore::Error if called at any other time.
|
||||||
#
|
#
|
||||||
def fetch(name, default=PStore::Error)
|
def fetch(name, default=PStore::Error)
|
||||||
|
in_transaction
|
||||||
unless @table.key? name
|
unless @table.key? name
|
||||||
if default==PStore::Error
|
if default==PStore::Error
|
||||||
raise PStore::Error, format("undefined root name `%s'", name)
|
raise PStore::Error, format("undefined root name `%s'", name)
|
||||||
else
|
else
|
||||||
default
|
return default
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self[name]
|
@table[name]
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
# Stores an individual Ruby object or a hierarchy of Ruby objects in the data
|
# Stores an individual Ruby object or a hierarchy of Ruby objects in the data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user