updated based on date2 4.0.3.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
562f256c54
commit
c04f4aa0ee
@ -1,3 +1,7 @@
|
|||||||
|
Sun Feb 18 19:33:00 2007 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
|
* lib/date/format.rb: updated based on date2 4.0.3.
|
||||||
|
|
||||||
Sun Feb 18 13:11:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Feb 18 13:11:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in (pid_t, uid_t, gid_t): check if defined.
|
* configure.in (pid_t, uid_t, gid_t): check if defined.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# format.rb: Written by Tadayoshi Funaba 1999-2007
|
# format.rb: Written by Tadayoshi Funaba 1999-2007
|
||||||
# $Id: format.rb,v 2.30 2007-01-07 09:16:24+09 tadf Exp $
|
# $Id: format.rb,v 2.31 2007-02-18 12:08:09+09 tadf Exp $
|
||||||
|
|
||||||
require 'rational'
|
require 'rational'
|
||||||
|
|
||||||
@ -95,23 +95,24 @@ class Date
|
|||||||
end
|
end
|
||||||
|
|
||||||
class Bag # :nodoc:
|
class Bag # :nodoc:
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@_dict = {}
|
@elem = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
def method_missing(t, *args, &block)
|
def method_missing(t, *args, &block)
|
||||||
if /=$/ =~ t
|
t = t.to_s
|
||||||
t = t.to_s.chomp('=').to_sym
|
set = t.chomp!('=')
|
||||||
@_dict[t] = args[0]
|
t = t.intern
|
||||||
|
if set
|
||||||
|
@elem[t] = args[0]
|
||||||
else
|
else
|
||||||
if @_dict.key?(t)
|
@elem[t]
|
||||||
@_dict[t]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_hash
|
def to_hash
|
||||||
@_dict.reject{|k,v| /^_/ =~ k}
|
@elem.reject{|k, v| /\A_/ =~ k.to_s || v.nil?}
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user