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

ruby-changes:41197

From: sorah <ko1@a...>
Date: Thu, 24 Dec 2015 15:35:16 +0900 (JST)
Subject: [ruby-changes:41197] sorah:r53269 (trunk): * tool/vcs.rb (IO.popen): Enable on Ruby 1.9 where chdir option is not

sorah	2015-12-24 15:35:04 +0900 (Thu, 24 Dec 2015)

  New Revision: 53269

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

  Log:
    * tool/vcs.rb (IO.popen): Enable on Ruby 1.9 where chdir option is not
      supported on IO.popen
    
    * tool/vcs.rb (IO.popen): Fix NoMethodError. I guess r49705 was not
      tested... :/

  Modified files:
    trunk/ChangeLog
    trunk/tool/vcs.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53268)
+++ ChangeLog	(revision 53269)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Dec 24 14:44:08 2015  sorah (Shota Fukumori)  <her@s...>
+
+	* tool/vcs.rb (IO.popen): Enable on Ruby 1.9 where chdir option is not
+	  supported on IO.popen
+
+	* tool/vcs.rb (IO.popen): Fix NoMethodError. I guess r49705 was not
+	  tested... :/
+
 Thu Dec 24 14:57:03 2015  Koichi Sasada  <ko1@a...>
 
 	* NEWS: rename
Index: tool/vcs.rb
===================================================================
--- tool/vcs.rb	(revision 53268)
+++ tool/vcs.rb	(revision 53269)
@@ -15,7 +15,7 @@ def IO.pread(*args) https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L15
   popen(*args) {|f|f.read}
 end
 
-if RUBY_VERSION < "1.9"
+if RUBY_VERSION < "2.0"
   class IO
     @orig_popen = method(:popen)
 
@@ -23,7 +23,7 @@ if RUBY_VERSION < "1.9" https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L23
       def self.popen(command, *rest, &block)
         if Hash === (opts = rest[-1])
           dir = opts.delete(:chdir)
-          rest pop if opts.empty?
+          rest.pop if opts.empty?
         end
         if block
           @orig_popen.call("-", *rest) do |f|
@@ -48,7 +48,7 @@ if RUBY_VERSION < "1.9" https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L48
       def self.popen(command, *rest, &block)
         if Hash === (opts = rest[-1])
           dir = opts.delete(:chdir)
-          rest pop if opts.empty?
+          rest.pop if opts.empty?
         end
         command = command.shelljoin if Array === command
         Dir.chdir(dir || ".") do

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

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