Current status of 1.9.1 RC1's issues

Hi, folks

I’m going to release Ruby 1.9.1 Release Candidate on Dec 25.
But we have 36 issues now.
Ruby Issue Tracking System

I need your help.

== Issues
=== #6 sprintf() of %f on Windows(MSVCRT)
< unak
Is this still reproducible?
If does, do you have a plan to fix this by 1.9.1?

=== #233 Block level with binding
< ko1
I does not think this is a serious problem. Whould you mind if I change
the target version of this issue to 1.9.2?

=== #235 default charset of rdoc
< naruse
Can I regards this issue as fixed?

=== #470 RDoc of File::open is missing
< drbrain
I have a patch for this issue. But #901 must be resolved for the patch.

=== #497 writing NEWS
< everyone
knu and I have written NEWS for 1.9.1. Commit or send a patch for NEWS
if you have something to add.

=== #549 ri -f html mungles constants
< drbrain
I does not think this is a serious problem. Whould you mind if I change
the target version of this issue to 1.9.2?

=== #555 method_missing in Gem module removes some necessary methods
< drbrain
Please commit the patch.

=== #616 instance_eval and Module#to_s
< ko1
Is it hard to fix this issue by 1.9.1?
I want to fix this if posible.

=== #623 rdoc differs from implementation at optparse
< nobu
Which is correct, rdoc or implemenation?

=== #632 StringIO has an odd alias implementation [?]
< ko1
What is happening?

=== #633 dl segfaults on x86_64-linux systems
< everyone
takano32 told me that he reproduced this at x64 too.
Does anyone have an idea about this?

This problem does not block the release of 1.9.1RC because neighter
x86_64 or x64 is a “supported” platform. But I want to fix this if
possible.

=== #634 Time parsing works in 1.8 but not 1.9
< tadf
Is this a spec? Or do you have an idea about it?

=== #657 Thread.new { fork }
< everyone
This seems to be hard to fix. We need help.

=== #693 Thread#set_trace_func seems not to work
Thread.set_trace_func is an unsupported feature. So we decided to remove
it from Ruby 1.9.1.

=== #712 M17N of erb
< seki
irb was multilingualized. Does erb needs M17N?
I think erb should know in which encoding the source is encoded.
What do you think about it?

=== #727 Signal(CLD) seems not to work on OS X
< everyone
I think OSX needs SA_RESTART for some signals. [ruby-dev:37427]
And akr gave me some suggestion. [ruby-dev:37432]
But I don’t know which signal intend to stop the process and which does
not.

=== #730 Infinite recursion on ‘super’ in dynamically generated modules
< ko1
Is this hard to fix?

=== #732 $! in at_exit
< ko1
Is this hard to fix?

=== #755 select in windows errantly accepts too many fd’s
< unak
Is this still reproducible?

=== #803 eval with binding
< ko1
This issue points two bugs of YARV.
We decided to fix the first if possible and regards the later as a known
bug.

Is the first one hard to fix?

=== #827 Fix document for Gem::Installer#write_spec
Please commit your patch in to the trunk and ruby_1_9_1. < drbrain

=== #832 Encoding in which Array#pack returns when a string-related
format and a byte seq format are mixed
Matz said that he would decide which encoding Array#pack should return
in this situation.
How do you think now? < matz

=== #847 debug.rb reports extraneous information
set_trace_func’s bug.
Is this hard to fix? < ko1
Should we fix this by modifying debug.rb?

=== #848 debug.rb doesn’t have access to the source file under test
until it has run
ditto.

=== #854 Rake::FileList#egrep does not work
< Jim W.

okkez reported that the task ‘a’ does not work when there is a rb file
with Shift_JIS text.

Rakefile

coding: utf-8

desc ‘aaa’
task :a do
p FileList[‘*.rb’].egrep(/require/)
end

You should open files in ASCII-8BIT when you don’t know in which
encoding they are encoded.

=== #865 some mistakes in Rake RDoc
< Jim W.
Please apply the patch okkez sent.

=== #866 gem(1) gemrc(5)
< Jim W.

I wrote unix manpages for gem(1) and gemrc(5). I want to bundle these
with Ruby 1.9.1.

These manpages are based on
http://www.rubygems.org/read/chapter/12#page52. So I asked Jim W.
about the license of the page.
How about this? Is it possible to distribute the manapges under Ruby’s
license and under GPL?

=== #876 nil before Loaded suite
< zenspider

Please fix this and merge miniunit into Ruby again.

=== #885 curious output at Thread.new{fork{}}
< ko1
What’s happening?

=== #888 zlib 1.2.3 does not work with Rubygems 1.3.1 (in Ruby 1.9.1) on
Windows
Is this windows specific?

=== #895 MiniTest::Assertions#refute_instance_of should use
Object#instance_of? instead Module#===
< zenspider.
This was fixed by r20798 and r20800. But I think the fix needs your
permission.
Can I merge the commits into ruby_1_9_1?

=== #896 MiniTest::Assertions#assert_match arguments order is different
from Test::Unit::Assertions::assert_match
Is this a spec or a bug? < zenspider

=== #897 Kenel#describe should be private in minitest/spec
< zenspider
I think 99.describe should not be allowed.

=== #898 Test::Unit::Assertions#assert_nothing_raised does not increment
number of assertions
What’s happening? Is this a bug of test/unit?

=== #901 RDoc does not handle multiple method description for a C
function properly
< drbrain
This problem is blocking #470.

=== #902 1.9.1 preview 1 does not build on mac OSX 10.5.5
kouji and I could not reproduce the failure.

Regards,

e$B31$H$$$$$^$9!#e(B

On 2008/12/20, at 22:55, Yugui (Yuki S.) wrote:

=== #712 M17N of erb
< seki
irb was multilingualized. Does erb needs M17N?
I think erb should know in which encoding the source is encoded.
What do you think about it?

irbe$B$K$J$i$C$F$3$s$JIw$K$7$h$&$H;W$&$s$G$9$,!"$"$C$F$k$G$7$g$&$+e(B?
internale$B$@$1$r;XDj$9$k$3$H$b$G$-$k$s$G$9$M!#e(B

Index: erb

— erb (revision 20892)
+++ erb (working copy)
@@ -72,6 +72,10 @@
end
raise “invalid trim mode #{arg.dump}” unless arg =~ /
^[0-2]$/
trim_mode = arg.to_i

  •      when '=E'
    
  •        extern, intern = ARGV.req_arg.split(':')
    
  •        Encoding.default_external = extern unless extern.nil? ||
    

extern.empty?

  •        Encoding.default_internal = intern unless intern.nil? ||
    

intern.empty?
when ‘-P’
disable_percent = true
when ‘–help’
@@ -89,9 +93,10 @@
-n print ruby script with line number
-v enable verbose mode
-d set $DEBUG to true

  • -r [library] load a library
  • -S [safe_level] set $SAFE (0…4)
  • -T [trim_mode] specify trim_mode (0…2, -)
  • -r library load a library
  • -E ex[:in] pecify the default external and internal character
    encodings
  • -S safe_level set $SAFE (0…4)
  • -T trim_mode specify trim_mode (0…2, -)
    -P ignore lines which start with “%”

Yuguie$B$G$9e(B

On 12/21/08 2:19 AM, Masatoshi SEKI wrote:

  • -r library load a library
  • -E ex[:in] pecify the default external and internal character
    encodings
  • -S safe_level set $SAFE (0…4)
  • -T trim_mode specify trim_mode (0…2, -)
    -P ignore lines which start with “%”

default_external,
default_internale$B$b@_Dj$9$kJ}K!$,$"$l$P4r$7$$$H$O$*$b$$e(B
e$B$^$9!#e(B

e$B$1$l$I$b!"$^$:e(BERBe$B$Ke(Bscript
encodinge$B$rCN$i$;$kJ}K!$,$"$k$+$I$&$+$J$s$G$9$he(B
e$B$M!#e(BERB.newe$B$N>l9g$Oe(BERBe$B$KEO$9J8;zNs$rE,@Z$K=hM}$7$F$*$1$PNI$$$H$7$F!"e(Berb
e$B%3%^%s%I$N>l9g$O$I$&$7$?$iNI$$$G$7$g$&$+!#e(B

<%# -- coding: UTF-8 -- %>

e$B$H$+!"$3$s$J5-K!$r<u$1IU$1$?$j$7$^$9$+e(B?e$B!!$=$&$9$k$H:#EY$Oe(BERB.newe$B$KEO$5$le(B
e$B$?J8;zNs$KL7=b$9$ke(Bmagic
commente$B$,4^$^$l$F$$$?>l9g$,LdBj$K$J$j$^$9$h$M!#e(B

e$B$=$l$H$b!"e(Berbe$B%3%^%s%I$K2?$+?7$7$$%*%W%7%g%s$rF3F~$9$kJ}$,E,@Z$G$7$g$&$+!#e(B

I’ll try a couple of the bugs out…

== Issues
=== #6 sprintf() of %f on Windows(MSVCRT)
< unak
Is this still reproducible?

Yep.

  1. Failure:
    test_float(TestSprintf) [test_sprintf.rb:186]:
    <“36893488147419111424”> expected but was
    <“36893488147419111000”>.

If does, do you have a plan to fix this by 1.9.1?

=== #632 StringIO has an odd alias implementation [?]
< ko1
What is happening?
It has the wrong super message, but this is no longer a large problem
[thanks to ruby_parser being updated to circumvent it].

=== #634 Time parsing works in 1.8 but not 1.9
< tadf
Is this a spec? Or do you have an idea about it?

It’s still there, for better or worse.

=== #755 select in windows errantly accepts too many fd’s
< unak
Is this still reproducible?

Yes. Run the test_select_hangs_windows.rb file and it hangs windows,
not linux. Possible fix: add #define FD_SETSIZE 1024 in there.

Regards,

Yugui (Yuki S.) [email protected]

Thanks for doing that stuff :slight_smile:

-=r

e$B31$H$$$$$^$9!#e(B

On 2008/12/21, at 8:20, Yugui (Yuki S.) wrote:

<%# -- coding: UTF-8 -- %>

e$B$H$+!"$3$s$J5-K!$r<u$1IU$1$?$j$7$^$9$+e(B?e$B!!$=$&$9$k$H:#EY$Oe(B
ERB.newe$B$KEO$5$le(B
e$B$?J8;zNs$KL7=b$9$ke(Bmagic commente$B$,4^$^$l$F$$$?>l9g$,Lde(B
e$BBj$K$J$j$^$9$h$M!#e(B

e$B$=$l$H$b!"e(Berbe$B%3%^%s%I$K2?$+?7$7$$%*%W%7%g%s$rF3F~$9$ke(B
e$BJ}$,E,@Z$G$7$g$&$+!#e(B

e$B$3$N5!2q$Ke(Brubye$B$Ne(BM18Ne$B$K$D$$$F3X$Y$?$i$H;W$C$F$^$9!#e(B

magic commente$B$r4^$`e(BRubye$B%9%/%j%W%H$r=PNO$9$k$h$&$Je(Berb
e$B$N%9%/%j%W%H$r=q$/e(B
e$B$H$-$J$I$K$a$s$I$/$5$=$&$J$N$G!“e(Bmagic commente$B0J30$NJ}K!e(B
e$B$G2r7h$G$-$?e(B
e$B$i$h$$$J$”$H9M$($F$^$9!#e(B

script encodinge$B$H$O!"e(B

  • evale$B$5$l$ke(BStringe$B$K$h$C$F7h$^$k$N$+!"e(B
  • e$B$=$l$H$be(Bevale$B$9$k%3%s%F%-%9%H$N>uBV$K$h$C$F7h$^$k$N$+!“e(B
    e$B$,$o$+$C$F$^$;$s!#e(B(e$B;d$,M}2r$7$F$J$$!”$N0Ue(B)

default_external, default_internale$B$,;X<($G$-$l$P!"$=$N8e$KFI$`e(B
$<.reade$B$Oe(B
e$B$=$N;X<($7$?e(Bencodinge$B$H$7$F=hM}$5$l$k$N$G$7$g$&$+e(B?
e$B$b$7$=$&$G$"$l$P!"e(B-Ee$B$N%%W%7%g%s$G<B<AE$Ke(Bscript
encodinge$B$rCN$i$;$?$3$H$Ke(B
e$B$J$j$^$9$+e(B?

e$B$"$k$$$O!"e(Berbe$B%3%^%s%I$K?7$7$$%%W%7%g%s$rF3F~$7!"e(B
$<.reade$B$7$?J8;zNs$re(B
e$B$=$N%
%W%7%g%s$G;XDj$7$?e(Bencodinge$B$K$9$k$3$H$GC#@.$G$-$ke(B
e$B$G$7$g$&$+!#e(B

In article [email protected],
“Yugui (Yuki S.)” [email protected] writes:

=== #727 Signal(CLD) seems not to work on OS X
< everyone
I think OSX needs SA_RESTART for some signals. [ruby-dev:37427]
And akr gave me some suggestion. [ruby-dev:37432]
But I don’t know which signal intend to stop the process and which does not.

if trap(sig, “EXIT”), sig intend to exit the process.
if trap(sig, “IGNORE”), sig intend to not exit the process.
etc.

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B
deve$B$@$+$iF|K\8l$G!#e(B

In message “[ruby-dev:37513] Current status of 1.9.1 RC1’s issues”
on Dec.20,2008 22:55:22, [email protected] wrote:
| === #6 sprintf() of %f on Windows(MSVCRT)
| < unak
| Is this still reproducible?
| If does, do you have a plan to fix this by 1.9.1?

[ruby-dev:37381]e$B$K=q$$$?$h$&$K!"$J$+$@$5$s$NJV;v$rBT$C$F$^$9!#e(B

| === #755 select in windows errantly accepts too many fd’s
| < unak
| Is this still reproducible?

[ruby-dev:37453]e$B$K=q$$$?$h$&$K!"$5$5$@$5$s$NJV;v$rBT$C$F$^$9!#e(B

e$B$=$l$G$O!#e(B

On 12/23/08 8:08 AM, Eric H. wrote:

=== #497 writing NEWS
< everyone
knu and I have written NEWS for 1.9.1. Commit or send a patch for NEWS
if you have something to add.

I have attached a patch for RDoc and RubyGems:

http://redmine.ruby-lang.org/issues/show/497#note-4

Is the patch for trunk? trunk/NEWS contains changes between 1.9.1 and
1.9.2. branches/ruby_1_9_1/NEWS contains changes between 1.8.7 and
1.9.1. [ruby-core:20500]

Rake and RubyGems are one of the most important part of 1.9 feature. So
would you like to review branches/ruby_1_9_1/NEWS?

Regards,

On Dec 22, 2008, at 15:08 PM, Eric H. wrote:

On Dec 20, 2008, at 05:55 AM, Yugui (Yuki S.) wrote:

=== #901 RDoc does not handle multiple method description for a C
function properly
< drbrain
This problem is blocking #470.

I am looking into this problem now.

Applied to trunk r20932. Will you apply the patch from #470 now?

On Dec 20, 2008, at 05:55 AM, Yugui (Yuki S.) wrote:

I’m going to release Ruby 1.9.1 Release Candidate on Dec 25.
But we have 36 issues now.
Ruby Issue Tracking System

I need your help.

== Issues
=== #235 default charset of rdoc
< naruse
Can I regards this issue as fixed?

Currently the default charset for RDoc HTML output is UTF-8. I don’t
think any conversion is performed.

=== #470 RDoc of File::open is missing
< drbrain
I have a patch for this issue. But #901 must be resolved for the
patch.

RDoc itself seems to work correctly now. I removed .ext/rdoc before
make install:

$ ruby19 -v
ruby 1.9.1 (2008-12-23 patchlevel-5000 trunk 20922) [i386-darwin9.6.0]
$ ri19 File.open
--------------------------------------------------------------- IO::open
IO.open(fd, mode_string=“r” [, opt] ) => io
IO.open(fd, mode_string=“r” [, opt] ) {|io| block } => obj
[…]

=== #497 writing NEWS
< everyone
knu and I have written NEWS for 1.9.1. Commit or send a patch for NEWS
if you have something to add.

I have attached a patch for RDoc and RubyGems:

http://redmine.ruby-lang.org/issues/show/497#note-4

=== #549 ri -f html mungles constants
< drbrain
I does not think this is a serious problem. Whould you mind if I
change
the target version of this issue to 1.9.2?

I think it would be very disruptive to fix this for 1.9.1. I would
rather fix this in RDoc and import a newer version of RDoc at a future
date.

=== #555 method_missing in Gem module removes some necessary methods
< drbrain
Please commit the patch.

Applied to trunk r20923

=== #827 Fix document for Gem::Installer#write_spec
Please commit your patch in to the trunk and ruby_1_9_1. < drbrain

Applied to trunk r20924. I will let you merge.

=== #901 RDoc does not handle multiple method description for a C
function properly
< drbrain
This problem is blocking #470.

I am looking into this problem now.

On Dec 22, 2008, at 16:04 PM, Yugui (Yuki S.) wrote:

Is the patch for trunk? trunk/NEWS contains changes between 1.9.1 and
1.9.2. branches/ruby_1_9_1/NEWS contains changes between 1.8.7 and
1.9.1. [ruby-core:20500]

Rake and RubyGems are one of the most important part of 1.9 feature.
So
would you like to review branches/ruby_1_9_1/NEWS?

Sorry, I have attached a new patch to #497 with updates for RDoc
only. The RubyGems information in NEWS is sufficient.

On 12/23/08 3:40 PM, Eric H. wrote:

I checked in a fix for this to trunk in r20937, can it be committed to
the 1.9.1 branch?

Thanks. Please commit it to the ruby_1_9_1.

On Dec 20, 2008, at 05:55 AM, Yugui (Yuki S.) wrote:

I’m going to release Ruby 1.9.1 Release Candidate on Dec 25.
But we have 36 issues now.
Ruby Issue Tracking System

I need your help.

Hi, I have found an additional issue, gem_prelude.rb and full RubyGems
do not have matching behavior when a gem is missing:

begin
gem ‘no_such_gem’
rescue Gem::LoadError p :success!
rescue LoadError
Gem::QuickLoader.load_full_rubygems_library
begin
gem ‘no_such_gem’
rescue Gem::LoadError
p :fail!
end
end

I checked in a fix for this to trunk in r20937, can it be committed to
the 1.9.1 branch?

On 12/21/08 11:22 PM, Masatoshi SEKI wrote:

script encodinge$B$H$O!"e(B

  • evale$B$5$l$ke(BStringe$B$K$h$C$F7h$^$k$N$+!"e(B

ERB.resulte$B$N>l9g$O$=$l$GNI$$$H;W$$$^$9!#e(BERBe$B$KEO$7$?J8;zNs$OI>2A$5$l$kA0e(B
e$B$K@5$7$$%(%s%3!<%G%#%s%0$K$J$C$F$$$k$Y$-$G!"$=$l$O%W%m%0%i%^$N@UG$$G$9!#e(B
ERB.rune$B$N>l9g$bI>2A$5$l$kJ8;zNs$HI8=`=PNO$N%(%s%3!<%G%#%s%0$,@5$7$/$"$ke(B
e$B$Y$-!"$H$$$&$3$H$G$$$$$G$7$g$&!#e(B

e$BG:$^$7$$$N$Oe(Berbe$B%3%^%s%I$G<B9T$5$l$k$3$H$r4|BT$5$l$?e(Berbe$B%U%!%$%k$G$9!#e(B
e$B$3$3$G!“4V0c$C$?%(%s%3!<%G%#%s%0$G%U%!%$%k$r2r<a$9$k$H@N!9$N!Ve(B’e$BI=e(B’e$B$,%P%Ce(B
e$B%/%9%i%C%7%e$K!WLdBj$K;w$?$b$N$r0z$-5/$3$7$+$M$^$;$s$7!”$"$k$$$Oe(B
Kernel#evale$B$,<:GT$9$k$G$7$g$&!#$G$9$+$i!“e(Berbe$B$O$=$N%U%!%$%k$,$I$N%(%s%3!<e(B
e$B%G%#%s%0$G=q$+$l$F$$$k$N$+CN$kI,MW$,$”$j$^$9!#e(B

e$B$=$N0UL#$G!"e(B

  • e$B$=$l$H$be(Bevale$B$9$k%3%s%F%-%9%H$N>uBV$K$h$C$F7h$^$k$N$+!"e(B

e$B$3$l$O$"$j$^$;$se(Bscript
encodinge$B$O%9%/%j%W%H$r=q$$$?;~E@$GDj$^$k$b$N$Ge(B
e$B$"$C$F!"$"$H$O=hM}7O$,$I$&$d$C$F$=$N%(%s%3!<%G%#%s%0$rCN$k$+$H$$$&LdBj$G$9!#e(B

rubye$BK\BN$N>l9g!"e(Bdefault_external, default_internale$B$Oe(B

  • commandline option
  • e$B%m%1!<%ke(B
    e$B$G7h$^$j$^$9!#4D6-JQ?t$K:81&$5$l$?$j!"%*%W%7%g%s$N;XDj$r5AL3$E$1$?$j5.=Ee(B
    e$B$Je(Bshebange$B0z?t$r>CHq$7$?$j$9$k$3$H$J$/e(Berbe$B%U%!%$%k$,e(Bportablee$B$G$"$k$?$a$Ke(B
    e$B$O!">/$J$/$H$be(Bmagic commente$B$K;w$?;EAH$_$OI,MW$@$H;W$$$^$9!#e(B

e$B$G$9$N$G!"e(B

default_external, default_internale$B$,;X<($G$-$l$P!"$=$N8e$KFI$`e(B$<.reade$B$Oe(B
e$B$=$N;X<($7$?e(Bencodinge$B$H$7$F=hM}$5$l$k$N$G$7$g$&$+e(B?

e$B$3$l$Oe(Byese$B$G$9$,e(B

e$B$b$7$=$&$G$"$l$P!"e(B-Ee$B$N%%W%7%g%s$G<B<AE$Ke(Bscript encodinge$B$rCN$i$;$?$3$H$Ke(B
e$B$J$j$^$9$+e(B?

e$B$3$l$OBEEv$J<jCJ$G$O$J$$$H;W$$$^$9!#e(B

magic commente$B$r4^$`e(BRubye$B%9%/%j%W%H$r=PNO$9$k$h$&$Je(Berbe$B$N%9%/%j%W%H$r=q$/e(B
e$B$H$-$J$I$K$a$s$I$/$5$=$&$J$N$G!“e(Bmagic commente$B0J30$NJ}K!$G2r7h$G$-$?e(B
e$B$i$h$$$J$”$H9M$($F$^$9!#e(B

e$B$3$l$O$J$k$[$I$H;W$&$N$G$9$,!"e(B
e$B!!e(B<%# -- coding: UTF-8 -- %>

e$B$3$l$J$iCO$N%F%-%9%H$Ne(Bmagic
commente$B$H$O6hJL$,IU$/$N$G$O$J$$$G$7$g$&$+!#e(B

e$B$3$l$H$OJL$K!“e(Berbe$B$N>l9g$O!”%9%/%j%W%H$r4^$^$J$$e(Bplaine$B$J%F%-%9%H$rF~NO$H$7e(B
e$B$F2r<a$9$k$3$H$,2DG=$G$"$k$h$&$K%3%^%s%I%i%$%s%%W%7%g%s$Ge(Bscript
encodinge$B$rM?$($F$d$k$H$$$&DI2C$NA
Br;h$O$"$j$($k$H;W$$$^$9!#e(B
e$B$?$@!"e(B

  • e$B$=$l$,%f!<%9%1!<%9$H$7$F$I$NDxEY$"$j$($k$N$+e(B
  • rubye$BK\BN$Oe(Bscript
    encodinge$B;XDj%*%W%7%g%s$re(B(e$B8_49@-$N$?$a$Ne(B-Ke$B$r=|$-e(B)e$BDs6!e(B
    e$B$7$F$$$J$$$3$H$X$N7s$M9g$$e(B
    e$B$O;d$G$OH=CG$,IU$-$^$;$s$G$7$?!#e(B

e$B$^$?!"$b$&e(B1e$B$D$NLdBj$,$"$j$^$9!#e(B
erbe$B$,=PNO$9$k%F%-%9%H$O!"$I$N%(%s%3!<%G%#%s%0$G$"$k$Y$-$G$7$g$&$+!#e(B
e$BCO$N%F%-%9%H$N%(%s%3!<%G%#%s%0e(B(script
encoding)e$B$G$7$g$&$+!#$=$l$H$b!“e(B
default
externale$B$G$7$g$&$+!#$=$l$H$b!”%3%^%s%I%i%$%s%*%W%7%g%s$"$k$$$O2?e(B
e$B$i$+$N%G%#%l%/%F%#%V$GM?$($i$l$kBh;0$N%(%s%3!<%G%#%s%0$G$7$g$&$+!#e(B

e$B<B:]%f!<%9%1!<%9$H$7$F$O%9%/%j%W%H%(%s%3!<%G%#%s%0$H$OJL$N%(%s%3!<%G%#%se(B
e$B%0$N=PNO$rF@$?$$>l9g$O$"$k$H;W$$$^$9!#$=$l$O!"I,$:$7$b0MB8$9$ke(B
default_external(e$B=hM}ESCf$GA[Dj$5$l$k30It%j%=!<%9$N%(%s%3!<%G%#%s%0e(B)e$B$H$Oe(B
e$B0lCW$7$J$$$+$b$7$l$^$;$s!#e(B

e$B$9$k$H!"=PNO%(%s%3!<%G%#%s%0$N;XDj%%W%7%g%s$H$$$&%G%6%$%sABr$,Ib$+$S>ee(B
e$B$,$j$^$9!#0lJ}!"$3$l$rDs6!$7$J$$$G>o$K%9%/%j%W%H%(%s%3!<%G%#%s%0$G=PNO$7e(B
e$B$F$"$H$Oe(Biconv(1)e$B$J$je(Bnkf(1)e$B$J$jDL$;!"$H$$$&A*Br$b$"$jF@$k$H;W$$$^$9!#e(B

e$B$I$A$i$K$;$h!"e(BRUBYOPTe$B$Ge(B-Ee$B$,;XDj$5$l$F$$$k>l9g$KHw$($F!"e(Bdefault_external
e$B$K1F6A$5$l$J$$$h$&$K2?$i$+$NDI2C<BAu$OI,MW$G$7$g$&!#e(B

e$B$H$$$&$"$?$j$G!"e(B

  • -E, -Ue$B%*%W%7%g%s$rDI2C$9$k$+e(B(e$B;d$O$9$Y$-$H;W$&e(B)
    • e$B$3$NJU$Oe(Birbe$B$HF1$8$Ge(B
  • -Ke$B$OI|3h$9$k$+e(B?
    • irbe$B$G$O$7$J$+$C$?$,!"e(Berbe$B$O$I$&$9$k$+e(B
  • magic commente$B$rDs6!$9$k$+e(B(e$B;d$O$9$Y$-$H;W$&e(B)
    • e$B$=$N9=J8e(B
  • script encodinge$B;XDj%*%W%7%g%s$OI,MW$+e(B
    • magic commente$B$H>WFM$7$?$i$I$&$9$ke(B?
  • e$B=PNO%(%s%3!<%G%#%s%0$Oe(B?
    • script encoding (e$B;d$N0U8+$O$3$l$+$Je(B)
    • default external
    • e$B$=$l0J30e(B

e$B$K$D$$$F%a%s%F%J$N0U8+$r;G$$$?$$$H;W$$$^$7$?!#e(B

e$B31$H$$$$$^$9!#e(B

e$B$“$j$,$H$&$4$6$$$^$9!#e(B
bin/erbe$B$O;H$C$?$3$H$,$J$$$N$G!”%f!<%64s$j$N0U8+$OHs>o$K;29M$Ke(B
e$B$J$j$^$9!#e(B

magic commente$B$NI,MW@-$OM}2r$G$-$^$7$?!#e(B

e$B$3$N$h$&$JLdBj$Oe(Berubye$B$G$O$I$N$h$&$K07$C$F$$$k$N$G$7$g$&$+e(B?

On 2008/12/24, at 18:51, Yugui (Yuki S.) wrote:

  • commandline option
  • e$B%m%1!<%ke(B
    e$B$G7h$^$j$^$9!#4D6-JQ?t$K:81&$5$l$?$j!“%*%W%7%g%s$N;XDj$r5Ae(B
    e$BL3$E$1$?$j5.=Ee(B
    e$B$Je(Bshebange$B0z?t$r>CHq$7$?$j$9$k$3$H$J$/e(Berbe$B%U%!%$%k$,e(B
    portablee$B$G$”$k$?$a$Ke(B
    e$B$O!">/$J$/$H$be(Bmagic commente$B$K;w$?;EAH$_$OI,MW$@$H;W$$e(B
    e$B$^$9!#e(B

znze$B$5$s$NF|5-e(B (http://znz.s1.xrea.com/t/?date=20080108)
e$B$GCN$C$?$N$G$9$,!"e(B
evale$B$be(Bmagic commente$B$r2r<a$9$k$N$G$9$M!#e(B

e$B$&!<$!#e(BERB.resulte$B$O$I$&$7$?$b$N$+!#e(BERBe$B$be(Berbe$B$be(B magic commente$B$rF1MM$K=hM}$9$ke(B e$B$Y$-$J$ie(BERBe$B$KEO$5$l$?%9%/%j%W%H$N:G=i$N%3%a%s%H$re(B evale$B$9$ke(BRubye$B%9%/%j%W%H$Ke(B e$B;D$7$F$"$2$l$PF0$-$=$&$J5$$,$9$k!#e(B e$B$3$N$"$?$j$,$i$C$HJQ$($?$ie(BtDiarye$B$de(BRoRe$B$K1F6A$9$k$@e(B e$B$m$&$+!E!#e(B e$B$8$c$"!"e(Bdef_methode$B7O$O$I$&$J$k$s$@$h!E!"$H$$$&$N$bG:$$J$"!#e(B

e$B$O$J$$$G$7$g$&$+!#e(B
e$B$“$”!#$=$&$+$b$7$l$^$;$s!#e(B
e$B$=$l$,:G=i$N9T$K$"$C$?$H$-$KFCJLFCJL$J=hM}$r$9$l$P$h$$$N$G$9$M!#e(B

e$B$$$^$N$H$3$m!";d$N0U8+$O<!$NDL$j$G$9!#e(B

e$B$H$$$&$"$?$j$G!"e(B

  • -E, -Ue$B%*%W%7%g%s$rDI2C$9$k$+e(B(e$B;d$O$9$Y$-$H;W$&e(B)
  • e$B$3$NJU$Oe(Birbe$B$HF1$8$Ge(B

e$BDI2C$9$k!#e(B

  • -Ke$B$OI|3h$9$k$+e(B?
  • irbe$B$G$O$7$J$+$C$?$,!"e(Berbe$B$O$I$&$9$k$+e(B

e$BI|3h$7$J$$e(B

  • magic commente$B$rDs6!$9$k$+e(B(e$B;d$O$9$Y$-$H;W$&e(B)
  • e$B$=$N9=J8e(B

e$B:G=i$N9T$Ne(B<%# … %>e$B$N%3%a%s%H$r3h$+$9!"$N$+$7$i$s!#e(B

  • script encodinge$B;XDj%*%W%7%g%s$OI,MW$+e(B
  • magic commente$B$H>WFM$7$?$i$I$&$9$ke(B?

e$B;XDj%*%W%7%g%s$rMQ0U$7$J$$!#e(B

  • e$B=PNO%(%s%3!<%G%#%s%0$Oe(B?
  • script encoding (e$B;d$N0U8+$O$3$l$+$Je(B)
  • default external
  • e$B$=$l0J30e(B

script encodinge$B$+$J$"!#e(B
e$B$3$C$A$O<BAu$N%$%a!<%8$,$o$-$^$;$s!#e(B

Yuguiです。

On 12/26/08 7:06 PM, Yugui (Yuki S.) wrote:

で、全部合わせて添付のパッチのようになりました。どうでしょうか。
<%# -- coding: ENCODING-NAME --%>

咳さんから特に反対がなければパッチをコミットして1.9.1に含めたいと思いま
すが、いかがでしょうか。

あ、ついでに、bin/erbのオプション処理のパッチも書いてみたので添付しま
す。今は-s val形式と–long val形式を受け付けますが、
-sval 形式と–long=val形式も受け付けるようにしてみました。

Yuguiです。

é ‚ã„ãŸåˆ¤æ–­ã‚’ã‚‚ã¨ã«ã–ã£ã¨å®Ÿè£…ã—ã¦ã¿ã¾ã—ãŸã€‚

On 12/25/08 2:23 AM, Masatoshi SEKI wrote:

znzさんの日記 (http://znz.s1.xrea.com/t/?date=20080108) で知ったのですが、
evalもmagic commentを解釈するのですね。

すっかり忘れてましたが、そうですね。そして、evalは渡された文字列のエン
コーディングよりmagic commentを優先するので、適当にmagic commentが付いた
文字列を生成できればeval結果はmagic commentで解釈されるわけです。

で、

うーむ。ERB.resultはどうしたものか。ERBもerbもmagic commentを同様に処理する
べきならERBに渡されたスクリプトの最初のコメントをevalするRubyスクリプトに
残してあげれば動きそうな気がする。

magic commentã‚’ä»˜åŠ ã™ã‚‹ã‚³ãƒ¼ãƒ‰ã¯å®Ÿã¯æ—¢ã«æˆç€¬ã•ã‚“ãŒè¿½åŠ ã—ã¦ãã ã•ã£ã¦ã„ãŸ
のでした。

で、全部合わせて添付のパッチのようになりました。どうでしょうか。
<%# -- coding: ENCODING-NAME --%>

å†’é ­ã®ã‚’è§£é‡ˆã—ã¾ã™ã€‚

On 12/28/08 10:08 PM, Masatoshi SEKI wrote:

それともERBも考慮するのでしたっけ?

ERBã‚‚magic commentを考慮します。ERB.newã‚’å‘¼ã³å‡ºã—ãŸå ´åˆã¯magic commentと
渡された文字列のエンコーディングの衝突が考えられますが、これはevalの仕様
に倣ってmagic comment優先としました。

ライブラリ作者としては、ERB.new.runよりもERB.new.resultを、
そしてERB.new.resultよりもメソッド化を、使ってほしい(そう
いう風に誘導したい)と願っているのですが、
メソッド化するときのscript encodingってどうなるんだろうとか、
私がよく理解できていないので躊躇してます。

ãƒ¡ã‚½ãƒƒãƒ‰åŒ–ã—ãŸå ´åˆã¯ã€ä»–ã®ãƒ•ã‚¡ã‚¤ãƒ«ã§ãƒ¡ã‚½ãƒƒãƒ‰ã‚’è¿½åŠ ã—ãŸå ´åˆã«å€£ã£ã¦ã€erb
テンプレートのscript encodingを使うと良いと思います。

現在のdef_methodはこんな風になってますが
今回の修正後もそれらしく動くでしょうか。

メソッド化(とモジュール化、クラス化)を考えていなかったので、その点を修正
して添付のパッチのようになりました。

e$B31$H$$$$$^$9!#e(B

On 2008/12/28, at 15:02, Yugui (Yuki S.) wrote:

Yuguie$B$G$9!#e(B

On 12/26/08 7:06 PM, Yugui (Yuki S.) wrote:

e$B$G!"A4It9g$o$;$FE:IU$N%Q%C%A$N$h$&$K$J$j$^$7$?!#$I$&$G$7$ge(B
e$B$&$+!#e(B
<%# -- coding: ENCODING-NAME --%>

e$B31$5$s$+$iFC$KH?BP$,$J$1$l$P%Q%C%A$r%3%_%C%H$7$Fe(B1.9.1
e$B$K4^$a$?$$$H;W$$$^e(B
e$B$9$,!"$$$+$,$G$7$g$&$+!#e(B

e$BJV;v$,CY$/$F$9$_$^$;$s!#e(B
e$B$A$g$C$H$@$1K;$7$/$F$^$@$A$c$s$HFI$a$F$$$^$;$s!#e(B
bin/erbe$B$NJ}$O;d$bF1MM$J=$@5$r9M$($F$$$^$7$?!#e(B
Yuguie$B$5$s$N=$@5$K;?@.$7$^$9!#e(B

lib/erb.rbe$B$K<j$,F~$C$F$$$^$9$,!"e(B
bin/erbe$B$@$1e(Bmagic comemente$B$r9MN8$9$k$N$G$7$?$C$1!)e(B
e$B$=$l$H$be(BERBe$B$b9MN8$9$k$N$G$7$?$C$1!)e(B

e$B%i%$%V%i%j:n<T$H$7$F$O!"e(BERB.new.rune$B$h$j$be(B
ERB.new.resulte$B$r!“e(B
e$B$=$7$Fe(BERB.new.resulte$B$h$j$b%a%=%C%I2=$r!”;H$C$F$[$7$$!J$=$&e(B
e$B$$$&Iw$KM6F3$7$?$$!K$H4j$C$F$$$k$N$G$9$,!"e(B
e$B%a%=%C%I2=$9$k$H$-$Ne(Bscript encodinge$B$C$F$I$&$J$k$s$@$m$&e(B
e$B$H$+!"e(B
e$B;d$,$h$/M}2r$G$-$F$$$J$$$N$Gm4m0$7$F$^$9!#e(B

e$B8=:_$Ne(Bdef_methode$B$O$3$s$JIw$K$J$C$F$^$9$,e(B
e$B:#2s$N=$@58e$b$=$l$i$7$/F0$/$G$7$g$&$+!#e(B

def def_method(mod, methodname, fname=’(ERB)’) # :nodoc:
mod.module_eval(“def #{methodname}\n” + self.src + “\nend\n”,
fname, -1)
end

e$BBg>fIW$=$&$J$i!"$3$l$Ge(BOKe$B$G$9!#e(B

e$B$"!"$D$$$G$K!"e(Bbin/erbe$B$N%*%W%7%g%s=hM}$N%Q%C%A$b=q$$$Fe(B
e$B$$?$N$GE:IU$7$^e(B
e$B$9!#:#$Oe(B-s vale$B7A<0$He(B–long vale$B7A<0$r<u$1IU$1$^$9$,!"e(B
-sval e$B7A<0$He(B–long=vale$B7A<0$b<u$1IU$1$k$h$&$K$7$F$
$^$7$?!#e(B

e$B$3$C$A$N=$@5$ON;2r$7$^$7$?!#e(B

e$B31$H$$$$$^$9!#e(B

Yuguie$B$5$s!"$"$j$,$H$&$4$6$$$^$9!#e(B

On 2008/12/29, at 13:51, Yugui (Yuki S.) wrote:

On 12/28/08 10:08 PM, Masatoshi SEKI wrote:

e$B$=$l$H$be(BERBe$B$b9MN8$9$k$N$G$7$?$C$1!)e(B

ERBe$B$be(Bmagic commente$B$r9MN8$7$^$9!#e(BERB.newe$B$r8F$S=Pe(B
e$B$7$?>l9g$Oe(Bmagic commente$B$He(B
e$BEO$5$l$?J8;zNs$N%(%s%3!<%G%#%s%0$N>WFM$,9M$($i$l$^$9$,!"$3$l$Oe(B
evale$B$N;EMMe(B
e$B$KJo$C$Fe(Bmagic commente$BM%@h$H$7$^$7$?!#e(B

e$BN;2r$G$9!#e(B

e$B8=:_$Ne(Bdef_methode$B$O$3$s$JIw$K$J$C$F$^$9$,e(B
e$B:#2s$N=$@58e$b$=$l$i$7$/F0$/$G$7$g$&$+!#e(B

e$B%a%=%C%I2=e(B(e$B$H%b%8%e!<%k2=!"%/%i%92=e(B)e$B$r9M$($F$$e(B
e$B$J$+$C$?$N$G!"$=$NE@$r=$@5e(B
e$B$7$FE:IU$N%Q%C%A$N$h$&$K$J$j$^$7$?!#e(B

e$B3NG’$7$^$7$?!#e(B

e$B$3$N$^$^e(Bcheckine$B$7$F$$$?$@$$$Fe(BOKe$B$G$9!#e(B

e$B5$$K$J$C$?E@$O<!$NDL$j$G$9!#e(B(e$B$I$&$G$b$h$$$3$H$P$+$j$G$9e(B)

  • bin/erb.rbe$B$G$9$,!":#$J$ie(Boptparsee$B$r;H$&J}$,NI$$$N$Ge(B
    e$B$7$g$&$+!#e(B
    e$B$=$l$H$b$3$N$^$^$N<BAu$GBg>fIW$G$9$+e(B?

e$B;d$,e(Berb.rbe$B$r=q$$$?:"$Oe(Boptparsee$B0JA0$@$C$?$+!“C1$Ke(B
e$BCN$i$J$+$C$?$N$+e(B
e$B%3%^%s%I%*%W%7%g%s$N=hM}$r<+A0$G=q$$$F$7$^$$$^$7$?!#e(B
e$BFC$K$3$@$o$j$,$”$k$o$1$G$O$J$$$N$G!"2~B$$7$d$9$$J}$K$7$F$$$?$@$$$Fe(B
e$B$+$^$$$^$;$s!#e(B

  • e$BB?CM$NBeF~e(B

1.9e$B$G$O$=$&=q$/$N$,%$%G%#%%`$J$N$+$b$7$l$^$;$s$,!"B?CM$re(B
returne$B$7$Fe(B
e$B$=$l$r<u$1<h$k>l9g$K!Ve(B
e$B!W$GL@<(E*$KJ,2re(B(?)e$B$9$kJ}e(B
e$B$,$h$$$N$G$9$+e(B?

e$B<!$NJQ99$,5$$K$J$j$^$7$?!#e(B

  • @src, @enc = *compiler.compile(str)

e$B$3$l$OC1$K<!$N$h$&$K=q$/$N$O%$%1$F$J$$$N$G$7$g$&$+e(B?

  @src, @enc = compiler.compile(str)