[前][次][番号順一覧][スレッド一覧]

ruby-reference-manual:3299

From: "dice (Dice _)" <tetradice@g...>
Date: Sat, 15 Sep 2012 22:44:55 +0900
Subject: [ruby-reference-manual:3299] [るりまプロジェクト - Bug #7026] BitClust::SetupCommand#checkout が Windows で動作しない


Issue #7026 has been updated by dice (Dice _).


Windows XPでは私が知る限り、Linuxのwhichに相当するコマンドがありません。
そのため、Rubyスクリプト内からsystemメソッドを実行して、svn helpが成功するかどうかによって

正常終了かどうかを判断するのがよいのではないかと思います。 

   system "svn help > NUL 2> NUL" #=> trueならsvnインストール済み、falseならインストールされていない

----------------------------------------
Bug #7026: BitClust::SetupCommand#checkout が Windows で動作しない
https://bugs.ruby-lang.org/issues/7026#change-29326

Author: sho-h (Sho Hashimoto)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
reporter: 
ruby_version: 


FIXME の部分についてになりますが、Windows で svn まわりで失敗するようでした。やはり which コマンドがないみたいです。

以下みたいに分岐する感じでしょうか。Windows な方どうでしょう?特にないようなら一旦以下をコミットしようかと思います。

  --- subcommand.rb	(revision 5388)
  +++ subcommand.rb	(working copy)
  @@ -522,8 +522,13 @@
       end
   
       def checkout(rubydoc_dir)
  -      # FIXME Is this working on Windows?
  -      unless system("which svn > /dev/null")
  +      case RUBY_PLATFORM
  +      when /mswin(?!ce)|mingw|cygwin|bccwin/
  +        cmd = "where $PATH:svn.exe > NUL"
  +      else
  +        cmd = "which svn > /dev/null"
  +      end
  +      unless system(cmd)
           warn "svn command is not found. Please install Subversion."
           exit 1
         end




-- 
http://bugs.ruby-lang.org/

--
ML: ruby-reference-manual@m...
Info: http://QuickML.com/

[前][次][番号順一覧][スレッド一覧]

      3297 2012-09-15 11:45 [sho-h@n...          ] [るりまプロジェクト - Bug #7026][Open] BitClust::SetupCommand#checkout が Windows で動作しない
   @  3298 2012-09-15 12:23 ┣[okkez000@g...       ]                                       
->    3299 2012-09-15 15:44 ┣[tetradice@g...      ] [るりまプロジェクト - Bug #7026] BitClust::SetupCommand#checkout が Windows で動作しない
      3300 2012-09-15 16:52 ┣[sho-h@n...          ] [るりまプロジェクト - Bug #7026] BitClust::SetupCommand#checkout が Windows で動作しない
      3301 2012-09-15 18:43 ┗[sho-h@n...          ] [るりまプロジェクト - Bug #7026][Closed] BitClust::SetupCommand#checkout が Windows で動作しない