[#10193] String.ord — David Flanagan <david@...>

Hi,

41 messages 2007/02/05
[#10197] Re: String.ord — Yukihiro Matsumoto <matz@...> 2007/02/06

Hi,

[#10198] Re: String.ord — David Flanagan <david@...> 2007/02/06

Yukihiro Matsumoto wrote:

[#10199] Re: String.ord — Daniel Berger <djberg96@...> 2007/02/06

David Flanagan wrote:

[#10200] Re: String.ord — David Flanagan <david@...> 2007/02/06

Daniel Berger wrote:

[#10208] Re: String.ord — "Nikolai Weibull" <now@...> 2007/02/06

On 2/6/07, David Flanagan <david@davidflanagan.com> wrote:

[#10213] Re: String.ord — David Flanagan <david@...> 2007/02/06

Nikolai Weibull wrote:

[#10215] Re: String.ord — "Nikolai Weibull" <now@...> 2007/02/06

On 2/6/07, David Flanagan <david@davidflanagan.com> wrote:

[#10216] Re: String.ord — David Flanagan <david@...> 2007/02/07

Nikolai Weibull wrote:

[#10288] Socket library should support abstract unix sockets — <noreply@...>

Bugs item #8597, was opened at 2007-02-13 16:10

12 messages 2007/02/13

[#10321] File.basename fails on Windows root paths — <noreply@...>

Bugs item #8676, was opened at 2007-02-15 10:09

11 messages 2007/02/15

[#10323] Trouble with xmlrpc — James Edward Gray II <james@...>

Some of the Ruby code used by TextMate makes use of xmlrpc/

31 messages 2007/02/15
[#10324] Re: Trouble with xmlrpc — "Berger, Daniel" <Daniel.Berger@...> 2007/02/15

> -----Original Message-----

[#10326] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/15

On Feb 15, 2007, at 1:29 PM, Berger, Daniel wrote:

[#10342] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/16

While I am complaining about xmlrpc, we have another issue. It's

[#10343] Re: Trouble with xmlrpc — Alex Young <alex@...> 2007/02/16

James Edward Gray II wrote:

[#10344] Re: Trouble with xmlrpc — James Edward Gray II <james@...> 2007/02/16

On Feb 16, 2007, at 12:08 PM, Alex Young wrote:

[PATCH] Test::Unit::AutoRunner#parse_args bug, attributable to optparse documentation.

From: Mauricio Fernandez <mfp@...>
Date: 2007-02-07 19:55:58 UTC
List: ruby-core #10230
Test::Unit::AutoRunner ignores arguments given after -- (representing files
holding tests to be executed). I found this when trying to use test/spec.

I hesitated between test/unit and optparse when trying to assign the blame,
but the following test indicates that it's a bug in test/unit motivated by
incomplete documentation in optparse.rb:

    $ cat optparse-test.rb 
    require 'optparse'

    foo = false
    opt = OptionParser.new do |o|
      o.on("-f", "--foo"){|foo| }
    end

    args = %w[blergh -f -- dsf sdf sdf dfg re f]
    opt.order!(args){|x| p x}
    puts "Remaining: #{args.inspect}"
    puts "----"
    args = %w[blergh -f -- dsf sdf sdf dfg re f]
    opt.permute!(args)
    p args

    $ ruby185-p12 -v optparse-test.rb 
    ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-linux]
    "blergh"
    Remaining: ["dsf", "sdf", "sdf", "dfg", "re", "f"]
    ----
    ["blergh", "dsf", "sdf", "sdf", "dfg", "re", "f"]

#permute!'s implementation proves that #order! behaves as meant by Nobu, so
Test::Unit::AutoRunner is what needs to be fixed.

The patch:


Index: lib/optparse.rb
===================================================================
--- lib/optparse.rb	(revision 11652)
+++ lib/optparse.rb	(working copy)
@@ -1227,10 +1227,11 @@
   end
 
   #
-  # Parses command line arguments +argv+ in order. When a block is given,
-  # each non-option argument is yielded.
+  # Parses command line arguments +argv+ in order. When a block is given, each
+  # non-option argument occurring before -- is yielded. Note that non-option
+  # arguments after -- will not be passed to the block.
   #
-  # Returns the rest of +argv+ left unparsed.
+  # Returns the rest of +argv+ (arguments after --) left unparsed.
   #
   def order(*argv, &block)
     argv = argv[0].dup if argv.size == 1 and Array === argv[0]
Index: lib/test/unit/autorunner.rb
===================================================================
--- lib/test/unit/autorunner.rb	(revision 11652)
+++ lib/test/unit/autorunner.rb	(working copy)
@@ -87,6 +87,7 @@
       def process_args(args = ARGV)
         begin
           options.order!(args) {|arg| @to_run << arg}
+          @to_run[0,0] = args
         rescue OptionParser::ParseError => e
           puts e
           puts options


-- 
Mauricio Fernandez  -   http://eigenclass.org   -  singular Ruby

In This Thread

Prev Next