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

ruby-changes:14352

From: yugui <ko1@a...>
Date: Sun, 27 Dec 2009 09:54:22 +0900 (JST)
Subject: [ruby-changes:14352] Ruby:r26182 (trunk): * tool/rbinstall.rb (install?(:local, :comm, :bin, :'bin-comm')):

yugui	2009-12-27 09:44:11 +0900 (Sun, 27 Dec 2009)

  New Revision: 26182

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26182

  Log:
    * tool/rbinstall.rb (install?(:local, :comm, :bin, :'bin-comm')):
      Makes it vim friendly.  __END__ in a heredoc is confusing with 
      the script end for vim.

  Modified files:
    trunk/ChangeLog
    trunk/tool/rbinstall.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26181)
+++ ChangeLog	(revision 26182)
@@ -1,3 +1,9 @@
+Sun Dec 27 09:41:54 2009  Yuki Sonoda (Yugui)  <yugui@y...>
+
+	* tool/rbinstall.rb (install?(:local, :comm, :bin, :'bin-comm')):
+	  Makes it vim friendly.  __END__ in a heredoc is confusing with 
+	  the script end for vim.
+
 Sun Dec 27 09:13:55 2009  Yuki Sonoda (Yugui)  <yugui@y...>
 
 	* sample/occur2.rb: have been broken. fixed for Ruby 1.9 feature.
Index: tool/rbinstall.rb
===================================================================
--- tool/rbinstall.rb	(revision 26181)
+++ tool/rbinstall.rb	(revision 26182)
@@ -424,18 +424,18 @@
     open_for_install(cmd, $script_mode) do
       case $cmdtype
       when "bat"
-        "#{<<EOH}#{shebang}#{body}#{<<EOF}".gsub(/$/, "\r")
-@echo off
-@if not "%~d0" == "~d0" goto WinNT
-#{ruby_bin} -x "#{cmd}" %1 %2 %3 %4 %5 %6 %7 %8 %9
-@goto endofruby
-:WinNT
-"%~dp0#{ruby_install_name}" -x "%~f0" %*
-@goto endofruby
-EOH
-__END__
-:endofruby
-EOF
+        [<<-"EOH".gsub(/^\s+/, ''), shebang, body, <<-"EOF".gsub(/^\s+/, '')].join.gsub(/$/, "\r")
+          @echo off
+          @if not "%~d0" == "~d0" goto WinNT
+          #{ruby_bin} -x "#{cmd}" %1 %2 %3 %4 %5 %6 %7 %8 %9
+          @goto endofruby
+          :WinNT
+          "%~dp0#{ruby_install_name}" -x "%~f0" %*
+          @goto endofruby
+        EOH
+          __END__
+          :endofruby
+        EOF
       when "cmd"
         "#{<<"/EOH"}#{shebang}#{body}"
 @"%~dp0#{ruby_install_name}" -x "%~f0" %*

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

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