[#37248] [Feature:1.9] Enumerator#inspect — "Yusuke ENDOH" <mame@...>

遠藤です。

12 messages 2008/12/02

[#37337] [Feature #841] Object#self — "rubikitch ." <redmine@...>

Feature #841: Object#self

13 messages 2008/12/09

[#37513] Current status of 1.9.1 RC1's issues — "Yugui (Yuki Sonoda)" <yugui@...>

Hi, folks

14 messages 2008/12/20
[#37516] Re: Current status of 1.9.1 RC1's issues — Masatoshi SEKI <m_seki@...> 2008/12/20

咳といいます。

[#37576] [BUG:trunk] encoding for stdio's — "Yugui (Yuki Sonoda)" <yugui@...>

Yuguiです。

11 messages 2008/12/24

[ruby-dev:37462] optparse with regexp

From: rubikitch@...
Date: 2008-12-16 09:47:50 UTC
List: ruby-dev #37462
るびきちです。

optparseでオプション引数にマッチすべき正規表現を指定した場合の挙動が変わっています。

#!/usr/local/bin/ruby
require 'optparse'
opts = {}
ARGV.options do |o|
  o.on("-T [level]", /^[0-4]$/) {|x| opts[:T] = x }
  o.parse!
end
puts "opts=#{opts.inspect}"


$ ruby187p72 -v optparse-regexp.rb -T1
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
opts={:T=>"1"}
$ ruby18 -v optparse-regexp.rb -T1
ruby 1.8.7 (2008-12-16 revision 20784) [i686-linux]
opts={:T=>["1"]}
$ ruby19 -v optparse-regexp.rb -T1
ruby 1.9.1 (2008-12-16 revision 20782) [i686-linux]
opts={:T=>["1"]}

--
rubikitch
Blog: http://d.hatena.ne.jp/rubikitch/
Site: http://www.rubyist.net/~rubikitch/

In This Thread

Prev Next