[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dennou-ruby:003722] Re: numru-units on ruby 2.1



æäãã

äåãããããæãäããããã
ããããèããããèããã ãããRuby 2.1 ããããããããäããçåããããããããæçãããããããã

èçæ

from android phone

2014/04/27 20:52 "Shin-ya Murakami" <murashin@xxxxxxxxxxxxxx>:
åäåãããèçããã

æäçäããã

# æããããããããããããèçãããToãåããããããã

çãèãããããããããåããããããããã

ãããã(ããããæé)ãhttp://ruby.gfd-dennou.org/ml/index-j.htm
ã2014åãããããããããããããçãrubyãããããåãããããã
çéããããããããããããããããéãèãããã

From: Takeshi Horinouchi <horinout@xxxxxxxxxxxxxxxxx>
Date: Thu, 10 Apr 2014 11:12:33 +0900

> åäåããã
>
> ãããã Ruby 2.1 ããåäããããã numru-units ããããåããã
> ããããïåæã "1" ÂåéããåïãRacc ããããèãããããã
> ãããïèæãéèããããããããããèåããããåãããããã...
> ï èçããïæéåãããããããã
>
> ãèãçãéè K ãçãããããä
> (/home/horinout/tmp/ruby2.1/bin/ïã ruby 2.1.1 ããããããã
> ãããããããã (nurmu-unitsãgemããããããïïãããããã
> ããæãèããããããããã
>
> ääåèäããã
>
> â ruby 2.0 ããïåéããïï
>
> $ ruby --version
> ruby 2.0.0p451 (2014-02-24 revision 45167) [i686-linux]
> $ ruby -r numru/units -e "u=NumRu::Units['m/s']; u2=NumRu::Units['s']; puts u*u2"
> m
>
> â ruby 2.0 ããïåéããïï
>
> $ use_ruby 2.1
> ruby 2.1.1p76 (2014-02-24 revision 45161) [i686-linux]
> $ ruby -r numru/units -e "u=NumRu::Units['m/s'];
> u2=NumRu::Units['s']; puts u*u2"
> /opt/ruby2.1/lib/ruby/site_ruby/2.1.0/numru/units.rb:209:in `foldnumber': undefined method `foldnumber' for Error[m/s]:NumRu::Units::ErrorNode (NoMethodError)
> Â Â Â from /opt/ruby2.1/lib/ruby/site_ruby/2.1.0/numru/units.rb:139:in `reduce4'
> Â Â Â from /opt/ruby2.1/lib/ruby/site_ruby/2.1.0/numru/units.rb:2611:in `binop'
> Â Â Â from /opt/ruby2.1/lib/ruby/site_ruby/2.1.0/numru/units.rb:2616:in `*'
> Â Â Â from -e:1:in `<main>'
>
> ãããããæçããããèããããããããããããããããããã
> ããããï
>
> $ ruby -r numru/units -e "u=NumRu::Units['m']; p u.do_parse2,
> u.do_parse2.class"
> Error[m]
> NumRu::Units::ErrorNode
>
> ãããïdo_parse2 ããããã Racc ãæãã parse åçã
> çæã nil ããã ErrorNode ãããããèãããããããã
> åéãããããããã parse ããããããããããããããã...ã
>
> åäå æ
----
Shin-ya Murakami
email: murashin@xxxxxxxxxxxxxx
WWW: http://www.gfd-dennou.org/member/murashin/