From: Pierre-Yves Ritschard Date: 2011-01-29T01:44:55+09:00 Subject: [ruby-core:34940] [Ruby 1.9-Bug#4337][Open] rubygems calls chdir directly, actions should be enclosed in a block --mimepart_4d42f285eaa2d_5989595abfa1252 Content-Type: text/plain Content-Transfer-Encoding: Quoted-printable Content-Disposition: inline Bug #4337: rubygems calls chdir directly, actions should be enclosed in a= block http://redmine.ruby-lang.org/issues/show/4337 Author: Pierre-Yves Ritschard Status: Open, Priority: Normal Category: lib ruby -v: ruby 1.9.2p136 When installing gems, windows_stub_script is called in installer.rb which= directly calls Dir.chdir. If this were to be called inside another Dir.chdir call with a block pass= ed to it, it would spew warnings. Instead the proposed patch encloses the actions in a block, removing the = need for saving and restoring a path around the chdir call. ---------------------------------------- http://redmine.ruby-lang.org --mimepart_4d42f285eaa2d_5989595abfa1252 Content-Type: text/x-patch; name=ruby-1.9-clean-chdir.patch Content-Transfer-Encoding: Base64 Content-Disposition: attachment; filename=ruby-1.9-clean-chdir.patch SW5kZXg6IGluc3RhbGxlci5yYgo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0t LSBpbnN0YWxsZXIucmIJKHJldmlzaW9uIDMwNzEwKQorKysgaW5zdGFsbGVy LnJiCSh3b3JraW5nIGNvcHkpCkBAIC00ODEsNyArNDgxLDYgQEAKICAgZGVm IGJ1aWxkX2V4dGVuc2lvbnMKICAgICByZXR1cm4gaWYgQHNwZWMuZXh0ZW5z aW9ucy5lbXB0eT8KICAgICBzYXkgIkJ1aWxkaW5nIG5hdGl2ZSBleHRlbnNp b25zLiAgVGhpcyBjb3VsZCB0YWtlIGEgd2hpbGUuLi4iCi0gICAgc3RhcnRf ZGlyID0gRGlyLnB3ZAogICAgIGRlc3RfcGF0aCA9IEZpbGUuam9pbiBAZ2Vt X2RpciwgQHNwZWMucmVxdWlyZV9wYXRocy5maXJzdAogICAgIHJhbl9yYWtl ID0gZmFsc2UgIyBvbmx5IHJ1biByYWtlIG9uY2UKIApAQCAtNTAzLDEwICs1 MDIsMTEgQEAKICAgICAgICAgICAgICAgICBlbmQKIAogICAgICAgYmVnaW4K LSAgICAgICAgRGlyLmNoZGlyIEZpbGUuam9pbihAZ2VtX2RpciwgRmlsZS5k aXJuYW1lKGV4dGVuc2lvbikpCi0gICAgICAgIHJlc3VsdHMgPSBidWlsZGVy LmJ1aWxkKGV4dGVuc2lvbiwgQGdlbV9kaXIsIGRlc3RfcGF0aCwgcmVzdWx0 cykKKyAgICAgICAgRGlyLmNoZGlyIEZpbGUuam9pbihAZ2VtX2RpciwgRmls ZS5kaXJuYW1lKGV4dGVuc2lvbikpIGRvCisgICAgICAgICAgcmVzdWx0cyA9 IGJ1aWxkZXIuYnVpbGQoZXh0ZW5zaW9uLCBAZ2VtX2RpciwgZGVzdF9wYXRo LCByZXN1bHRzKQogCi0gICAgICAgIHNheSByZXN1bHRzLmpvaW4oIlxuIikg aWYgR2VtLmNvbmZpZ3VyYXRpb24ucmVhbGx5X3ZlcmJvc2UKKyAgICAgICAg ICBzYXkgcmVzdWx0cy5qb2luKCJcbiIpIGlmIEdlbS5jb25maWd1cmF0aW9u LnJlYWxseV92ZXJib3NlCisgICAgICAgIGVuZAogCiAgICAgICByZXNjdWUK ICAgICAgICAgcmVzdWx0cyA9IHJlc3VsdHMuam9pbiAiXG4iCkBAIC01MjMs OCArNTIzLDYgQEAKICAgICAgICAgRU9GCiAKICAgICAgICAgcmFpc2UgRXh0 ZW5zaW9uQnVpbGRFcnJvciwgbWVzc2FnZQotICAgICAgZW5zdXJlCi0gICAg ICAgIERpci5jaGRpciBzdGFydF9kaXIKICAgICAgIGVuZAogICAgIGVuZAog ICBlbmQK --mimepart_4d42f285eaa2d_5989595abfa1252--