зеркало из https://github.com/github/ruby.git
* instruby.rb: not rewrite installed scripts when dry-run mode.
* lib/ostruct.rb (OpenStruct::initialize): should symbolize keys instead of values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
7da58dad33
Коммит
c52339881c
|
@ -1,3 +1,10 @@
|
|||
Tue Nov 19 05:07:39 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* instruby.rb: not rewrite installed scripts when dry-run mode.
|
||||
|
||||
* lib/ostruct.rb (OpenStruct::initialize): should symbolize keys
|
||||
instead of values.
|
||||
|
||||
Tue Nov 19 02:24:10 2002 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* instruby.rb: Rewrite installed scripts' shebang lines.
|
||||
|
|
|
@ -114,7 +114,7 @@ for src in Dir["bin/*"]
|
|||
|
||||
f.print shebang.sub(/ruby/, ruby_install_name), *body
|
||||
f.truncate(f.pos)
|
||||
}
|
||||
} unless $dryrun
|
||||
end
|
||||
|
||||
Dir.glob("lib/**/*{.rb,help-message}") do |f|
|
||||
|
|
|
@ -13,7 +13,7 @@ class OpenStruct
|
|||
@table = {}
|
||||
if hash
|
||||
for k,v in hash
|
||||
@table[k] = v.to_sym
|
||||
@table[k.to_sym] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -27,7 +27,7 @@ class OpenStruct
|
|||
end
|
||||
mname.chop!
|
||||
@table[mname.intern] = args[0]
|
||||
elsif args.length == 0
|
||||
elsif len == 0
|
||||
@table[mid]
|
||||
else
|
||||
raise NoMethodError, "undefined method `#{mname}' for #{self}", caller(1)
|
||||
|
@ -41,12 +41,8 @@ class OpenStruct
|
|||
def inspect
|
||||
str = "<#{self.class}"
|
||||
for k,v in @table
|
||||
str += " "
|
||||
str += k.to_s
|
||||
str += "="
|
||||
str += v.inspect
|
||||
str << " #{k}=#{v.inspect}"
|
||||
end
|
||||
str += ">"
|
||||
str
|
||||
str << ">"
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче