From 30e678a6fbcd8ca214f7285839ff96a23f600ebe Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 7 May 2010 02:31:53 +0000 Subject: [PATCH] * instruby.rb (install-man): install mdocs directly without temporary files. [ruby-dev:41204] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ instruby.rb | 11 ++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0fe6a6d29..26be72ecfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri May 7 11:31:50 2010 Nobuyoshi Nakada + + * instruby.rb (install-man): install mdocs directly without + temporary files. [ruby-dev:41204] + Fri May 7 09:16:16 2010 Nobuyoshi Nakada * ext/tk/extconf.rb (get_tclConfig_dirs): glob with EXEEXT. diff --git a/instruby.rb b/instruby.rb index d8464558c0..973d60996b 100755 --- a/instruby.rb +++ b/instruby.rb @@ -15,7 +15,6 @@ require 'fileutils' require 'shellwords' require 'optparse' require 'optparse/shellwords' -require 'tempfile' STDOUT.sync = true File.umask(0) @@ -448,13 +447,11 @@ install?(:local, :comm, :man) do if $mantype == "doc" install mdoc, destfile, :mode => $data_mode else - w = nil - Tempfile.open(base) do |f| - w = f - open(mdoc) {|r| Mdoc2Man.mdoc2man(r, w)} + class << (w = []) + alias print push end - install w.path, destfile, :mode => $data_mode - w.close! + open(mdoc) {|r| Mdoc2Man.mdoc2man(r, w)} + open_for_install(destfile, $data_mode) {w.join("")} end end end