diff --git a/ChangeLog b/ChangeLog index 75625c7c38..ade76a5bc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,7 +21,7 @@ Sat May 14 22:45:28 2011 KOSAKI Motohiro Sat May 14 19:52:22 2011 KOSAKI Motohiro * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name): - add for $0 test. + add for $0 test. Sat May 14 19:50:46 2011 KOSAKI Motohiro @@ -50,10 +50,10 @@ Sat May 14 17:42:21 2011 CHIKANAGA Tomoyuki Sat May 14 12:12:54 2011 Martin Bosslet - * test/openssl/test_pkey_dsa.rb: Add basic tests and tests that - ensure new public key PEM encoding behavior and ensure backward - compatibility. - [Ruby 1.9 - Bug #4422] [ruby-core:35328] + * test/openssl/test_pkey_dsa.rb: Add basic tests and tests that + ensure new public key PEM encoding behavior and ensure backward + compatibility. + [Ruby 1.9 - Bug #4422] [ruby-core:35328] * test/openssl/test_pkey_rsa.rb: Remove line with 'puts'. Sat May 14 12:06:49 2011 Eric Hodel @@ -64,8 +64,8 @@ Sat May 14 12:06:49 2011 Eric Hodel Sat May 14 10:32:36 2011 Martin Bosslet * test/openssl/test_pkey_rsa.rb: Add tests that ensure new public key - encoding behavior and also ensure backward compatibility. - [Ruby 1.9 - Bug #4421] [ruby-core:35327] + encoding behavior and also ensure backward compatibility. + [Ruby 1.9 - Bug #4421] [ruby-core:35327] Sat May 14 09:50:10 2011 Eric Hodel @@ -87,7 +87,7 @@ Sat May 14 05:08:32 2011 Martin Bosslet * ext/openssl/ossl_pkey.c * ext/openssl/ossl_pkey.h * test/openssl/pkey/test_pkey_rsa.rb - Reverted premature commit. Sorry for the noise! + Reverted premature commit. Sorry for the noise! Sat May 14 05:02:58 2011 Eric Hodel @@ -97,8 +97,8 @@ Sat May 14 05:02:58 2011 Eric Hodel Sat May 14 04:19:06 2011 Martin Bosslet * NEWS: Describe altered behaviour for RSA and DSA public key - encoding. [Ruby 1.9 - Bug #4421, Bug #4422] - [ruby-core:35327,35328] + encoding. [Ruby 1.9 - Bug #4421, Bug #4422] + [ruby-core:35327,35328] Sat May 14 02:57:52 2011 Eric Hodel @@ -488,7 +488,7 @@ Fri May 6 23:29:47 2011 KOSAKI Motohiro Fri May 6 23:13:43 2011 KOSAKI Motohiro * configure.in: remove nanosleep check. we no longer use it. - r20124 removed last usage. + r20124 removed last usage. Fri May 6 22:35:56 2011 Nobuyoshi Nakada @@ -551,7 +551,7 @@ Thu May 5 15:03:51 2011 CHIKANAGA Tomoyuki * eval.c (frame_func_id): __method__ return different name from methods defined by Module#define_method with a same block. [ruby-core:35386] fixes #4606 - * eval (method_entry_of_iseq): new helper function. search control + * eval.c (method_entry_of_iseq): new helper function. search control frame stack for a method entry which has given iseq. * test/ruby/test_method.rb: add tests for #4696 @@ -573,14 +573,14 @@ Wed May 4 21:11:28 2011 KOSAKI Motohiro Wed May 4 20:22:12 2011 KOSAKI Motohiro * io.c (Init_IO): Added File::CLOEXEC constant. - [ruby-core:22893] [Feature #1291] + [ruby-core:22893] [Feature #1291] * test/ruby/test_io.rb (TestIO#test_o_cloexec): test for File::CLOEXEC. Wed May 4 19:00:59 2011 KOSAKI Motohiro * thread.c (rb_wait_for_single_fd): Fix wrong return value. * test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb - (TestWaitForSingleFD#test_wait_for_closed_pipe): test for it. + (TestWaitForSingleFD#test_wait_for_closed_pipe): test for it. Wed May 4 18:46:39 2011 KOSAKI Motohiro @@ -1201,7 +1201,7 @@ Tue Apr 12 01:33:00 2011 Luis Lavena * configure.in: properly evaluate existence of truncate, ftruncate and ftello for MinGW. [ruby-core:35678] - * win32/win32.c: rename truncate, ftruncate and ftello to avoid + * win32/win32.c: rename truncate, ftruncate and ftello to avoid redefinitions. * win32/win32.h: ditto. @@ -1409,11 +1409,11 @@ Tue Mar 29 05:19:57 2011 Tanaka Akira * ext/socket/raddrinfo.c: parenthesize macro arguments. -Tue Mar 29 00:03:51 2011 Tajima Akio +Tue Mar 29 00:03:51 2011 Tajima Akio * test/webrick/test_filehandler.rb (test_short_filename): - read real short filename by cmd because smb mounted files - have different naming convention. + read real short filename by cmd because smb mounted files + have different naming convention. Mon Mar 28 11:38:08 2011 NARUSE, Yui diff --git a/benchmark/driver.rb b/benchmark/driver.rb index 31c9ac2dc9..c38c4fb3da 100644 --- a/benchmark/driver.rb +++ b/benchmark/driver.rb @@ -48,7 +48,7 @@ class BenchmarkDriver def progress_message *args unless STDOUT.tty? - STDERR.print(*args) + STDERR.print(*args) STDERR.flush end end diff --git a/benchmark/other-lang/eval.rb b/benchmark/other-lang/eval.rb index 3875927389..48a2cea019 100644 --- a/benchmark/other-lang/eval.rb +++ b/benchmark/other-lang/eval.rb @@ -51,14 +51,14 @@ Bench.each{|b| require 'pp' # utime -puts Lang.join("\t") +puts Lang.join("\t") Bench.each_with_index{|b, bi| print b, "\t" puts Result[bi].map{|e| e[0]}.join("\t") } # rtime -puts Lang.join("\t") +puts Lang.join("\t") Bench.each_with_index{|b, bi| print b, "\t" puts Result[bi].map{|e| e[1]}.join("\t") diff --git a/benchmark/report.rb b/benchmark/report.rb index 7aa852fc85..d2dc56b1e1 100644 --- a/benchmark/report.rb +++ b/benchmark/report.rb @@ -25,7 +25,7 @@ end def benchmark cmd rubybin = ENV['RUBY'] || RbConfig.ruby - + IO.popen(rubybin, 'r+'){|io| io.write cmd io.close_write diff --git a/benchmark/run.rb b/benchmark/run.rb index 6ef2943642..0cd2363849 100644 --- a/benchmark/run.rb +++ b/benchmark/run.rb @@ -33,8 +33,8 @@ def bm file bm_name = $1 puts '-----------------------------------------------------------' unless $rubyonly || $matzrubyonly puts "#{bm_name}: " - - + + puts <, #]}, %q{ def m $! end - + begin begin raise "FOO" @@ -205,11 +205,11 @@ assert_equal %q{3}, %q{ assert_equal %q{ok3}, %q{ class E1 < Exception end - + def m yield end - + begin begin begin @@ -239,7 +239,7 @@ assert_equal %q{7}, %q{ $i += 2 break ensure - + end ensure $i += 4 @@ -247,7 +247,7 @@ assert_equal %q{7}, %q{ $i = 0 } end - + def iter yield end @@ -349,7 +349,7 @@ assert_equal %q{12}, %q{ 7+7 end } -assert_equal %q{ok}, %q{ # +assert_equal %q{ok}, %q{ # proc{ begin raise @@ -376,7 +376,7 @@ assert_match /undefined method `foo\'/, %q{#` def inspect bar {} end - + def bar raise ensure diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb index 84ef216421..02062755aa 100644 --- a/bootstraptest/test_flow.rb +++ b/bootstraptest/test_flow.rb @@ -29,7 +29,7 @@ assert_equal %q{ok}, %q{ end end end - + ('a').lines.map{|e| break :ok } diff --git a/bootstraptest/test_jump.rb b/bootstraptest/test_jump.rb index c53d83591e..595aaa7c4b 100644 --- a/bootstraptest/test_jump.rb +++ b/bootstraptest/test_jump.rb @@ -100,7 +100,7 @@ assert_equal %q{ok}, %q{ def m yield end - + m{ begin ensure @@ -190,7 +190,7 @@ assert_equal %q{100}, %q{ $i = 100 end end - + def iter yield end @@ -216,7 +216,7 @@ assert_equal %q{1}, %q{ return 1 end end - + m } assert_equal %q{1}, %q{ @@ -227,7 +227,7 @@ assert_equal %q{1}, %q{ return 1 end end - + m } assert_equal 'ok', %q{ diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb index 8d0db6e478..f015efd6d7 100644 --- a/bootstraptest/test_method.rb +++ b/bootstraptest/test_method.rb @@ -914,7 +914,7 @@ assert_equal %q{[:ok, :ok, :ok, :ok, :ok, :ok, :ng, :ng]}, %q{ o1 = c1.new o2 = c2.new - + test{o1.m} test{o2.mm} test{o1.send :m} @@ -1074,7 +1074,7 @@ assert_equal '[1, 2, [3, 4]]', %q{ def regular(a, b, *c) [a, b, c] end - regular(*[], 1, *[], *[2, 3], *[], 4) + regular(*[], 1, *[], *[2, 3], *[], 4) }, '[ruby-core:19413]' assert_equal '[1, [:foo, 3, 4, :foo]]', %q{ @@ -1093,7 +1093,7 @@ assert_equal '["B", "A"]', %q{ end class B < A - define_method(:m) do + define_method(:m) do ['B', super()] end end diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb index 28a23777a3..66acd5a482 100644 --- a/bootstraptest/test_proc.rb +++ b/bootstraptest/test_proc.rb @@ -2,11 +2,11 @@ assert_equal %q{[1, 2, 3]}, %q{ def getproc &b b end - + def m yield end - + m{ i = 1 m{ @@ -24,14 +24,14 @@ assert_equal %q{7}, %q{ def make_proc(&b) b end - + def make_closure a = 0 make_proc{ a+=1 } end - + cl = make_closure cl.call + cl.call * cl.call } @@ -41,7 +41,7 @@ assert_equal %q{ok}, %q{ :ok end end - + def block C.method(:new).to_proc end @@ -52,7 +52,7 @@ assert_equal %q{[0, 1, :last, 0, 2, :last]}, %q{ def proc &b b end - + pr = [] proc{|i_b| p3 = proc{|j_b| @@ -63,18 +63,18 @@ assert_equal %q{[0, 1, :last, 0, 2, :last]}, %q{ p3.call(1) p3.call(2) }.call(0) - + pr[0].call(:last).concat pr[1].call(:last) } assert_equal %q{12}, %q{ def iter yield end - + def getproc &b b end - + iter{ bvar = 3 getproc{ @@ -87,11 +87,11 @@ assert_equal %q{200}, %q{ def iter yield end - + def getproc &b b end - + loc1 = 0 pr1 = iter{ bl1 = 1 @@ -101,7 +101,7 @@ assert_equal %q{200}, %q{ loc1 + bl1 } } - + pr2 = iter{ bl1 = 1 getproc{ @@ -110,7 +110,7 @@ assert_equal %q{200}, %q{ loc1 + bl1 } } - + pr1.call; pr2.call pr1.call; pr2.call pr1.call; pr2.call @@ -120,21 +120,21 @@ assert_equal %q{[1, 2]}, %q{ def proc(&pr) pr end - + def m a = 1 m2{ a } end - + def m2 b = 2 proc{ [yield, b] } end - + pr = m x = ['a', 1,2,3,4,5,6,7,8,9,0, 1,2,3,4,5,6,7,8,9,0, @@ -147,14 +147,14 @@ assert_equal %q{1}, %q{ def proc(&pr) pr end - + def m a = 1 m2{ a } end - + def m2 b = 2 proc{ diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb index ae1488353e..ef1c622ace 100644 --- a/bootstraptest/test_syntax.rb +++ b/bootstraptest/test_syntax.rb @@ -110,7 +110,7 @@ assert_equal %q{100}, %q{ end return arg end - + test(100) } assert_equal %q{ok}, %q{ @@ -169,7 +169,7 @@ assert_equal %q{[:false, :false, :false, :false, :false, :false, :false, :false, res end end - + def each_test conds = make_perm(['fv', 'tv'], 3) bangs = make_perm(['', '!'], 3) @@ -184,10 +184,10 @@ assert_equal %q{[:false, :false, :false, :false, :false, :false, :false, :false, } } end - + fv = false tv = true - + $ans = [] each_test{|syn, conds, bangs, exprs| c1, c2, c3 = conds @@ -695,7 +695,7 @@ assert_equal 'ok', %q{ while true counter -= 1 break if counter == 0 - next + next redo end :ok @@ -706,7 +706,7 @@ assert_equal 'ok', %q{ while true counter -= 1 break if counter == 0 - next + next "#{ redo }" end :ok diff --git a/doc/rake/jamis.rb b/doc/rake/jamis.rb index c7439d88ea..c7bc84ac5b 100644 --- a/doc/rake/jamis.rb +++ b/doc/rake/jamis.rb @@ -183,7 +183,7 @@ h3, h4, h5, h6 { CSS XHTML_PREAMBLE = %{ - } @@ -510,7 +510,7 @@ FILE_INDEX = XHTML_PREAMBLE + < s) return (UChar* )p; diff --git a/enc/cp949.c b/enc/cp949.c index 009443aed4..3eb46c976a 100644 --- a/enc/cp949.c +++ b/enc/cp949.c @@ -90,7 +90,7 @@ static const signed char trans[][0x100] = { /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F }, { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -108,7 +108,7 @@ static const signed char trans[][0x100] = { /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, - /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F } }; #undef A @@ -179,7 +179,7 @@ cp949_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end p++; break; } - } + } } len = enclen(enc, p, end); if (p + len > s) return (UChar* )p; diff --git a/enc/emacs_mule.c b/enc/emacs_mule.c index f69936ea96..e75e40b168 100644 --- a/enc/emacs_mule.c +++ b/enc/emacs_mule.c @@ -103,7 +103,7 @@ static const signed char trans[][0x100] = { /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, - /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A }, { /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -121,7 +121,7 @@ static const signed char trans[][0x100] = { /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, { /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, diff --git a/enc/euc_jp.c b/enc/euc_jp.c index 6388455b7d..2666e60ae0 100644 --- a/enc/euc_jp.c +++ b/enc/euc_jp.c @@ -71,7 +71,7 @@ static const signed char trans[][0x100] = { /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F }, { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -89,7 +89,7 @@ static const signed char trans[][0x100] = { /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, - /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F }, { /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -107,7 +107,7 @@ static const signed char trans[][0x100] = { /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F }, }; @@ -192,7 +192,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) #if 1 if (enclen(enc, buf, p) != (p - buf)) return ONIGERR_INVALID_CODE_POINT_VALUE; -#endif +#endif return (int)(p - buf); } diff --git a/enc/euc_kr.c b/enc/euc_kr.c index f20a57e69a..af5f7828f0 100644 --- a/enc/euc_kr.c +++ b/enc/euc_kr.c @@ -68,7 +68,7 @@ static const signed char trans[][0x100] = { /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F }, { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -86,7 +86,7 @@ static const signed char trans[][0x100] = { /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, - /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F } }; #undef A diff --git a/enc/euc_tw.c b/enc/euc_tw.c index cf95954bc5..5fed8a893d 100644 --- a/enc/euc_tw.c +++ b/enc/euc_tw.c @@ -68,7 +68,7 @@ static const signed char trans[][0x100] = { /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F }, { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -86,7 +86,7 @@ static const signed char trans[][0x100] = { /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, - /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F }, { /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -104,7 +104,7 @@ static const signed char trans[][0x100] = { /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F }, { /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -122,7 +122,7 @@ static const signed char trans[][0x100] = { /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F } }; #undef A diff --git a/enc/gb18030.c b/enc/gb18030.c index f59d666e6e..36e60af6b5 100644 --- a/enc/gb18030.c +++ b/enc/gb18030.c @@ -82,7 +82,7 @@ static const signed char trans[][0x100] = { /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F }, { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -100,7 +100,7 @@ static const signed char trans[][0x100] = { /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, - /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F }, { /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -118,7 +118,7 @@ static const signed char trans[][0x100] = { /* c */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* d */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* e */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - /* f */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, F + /* f */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, F }, { /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -136,7 +136,7 @@ static const signed char trans[][0x100] = { /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F } }; #undef A diff --git a/enc/gbk.c b/enc/gbk.c index 3efb1bf636..ace7f378af 100644 --- a/enc/gbk.c +++ b/enc/gbk.c @@ -90,7 +90,7 @@ static const signed char trans[][0x100] = { /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F }, { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -108,7 +108,7 @@ static const signed char trans[][0x100] = { /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, - /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F } }; #undef A @@ -179,7 +179,7 @@ gbk_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, p++; break; } - } + } } len = enclen(enc, p, end); if (p + len > s) return (UChar* )p; diff --git a/enc/shift_jis.c b/enc/shift_jis.c index cb07cfe081..d1357b3212 100644 --- a/enc/shift_jis.c +++ b/enc/shift_jis.c @@ -208,7 +208,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) { return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end); - + } #endif @@ -243,7 +243,7 @@ left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, Onig p++; break; } - } + } } len = enclen(enc, p, end); if (p + len > s) return (UChar* )p; diff --git a/enc/unicode.c b/enc/unicode.c index 3ffe2057cb..beb5fa39f0 100644 --- a/enc/unicode.c +++ b/enc/unicode.c @@ -2244,7 +2244,7 @@ onigenc_unicode_mbc_case_fold(OnigEncoding enc, if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0) { if (to->n == 1) { - return ONIGENC_CODE_TO_MBC(enc, to->code[0], fold); + return ONIGENC_CODE_TO_MBC(enc, to->code[0], fold); } #if 0 /* NO NEEDS TO CHECK */ @@ -2350,7 +2350,7 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, for (j = 0; j < CaseUnfold_12[i].to.n; j++) { r = (*f)(CaseUnfold_12[i].to.code[j], (OnigCodePoint* )CaseUnfold_12[i].from, 2, arg); - if (r != 0) return r; + if (r != 0) return r; for (k = 0; k < CaseUnfold_12[i].to.n; k++) { if (k == j) continue; @@ -2369,7 +2369,7 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, for (j = 0; j < CaseUnfold_12_Locale[i].to.n; j++) { r = (*f)(CaseUnfold_12_Locale[i].to.code[j], (OnigCodePoint* )CaseUnfold_12_Locale[i].from, 2, arg); - if (r != 0) return r; + if (r != 0) return r; for (k = 0; k < CaseUnfold_12_Locale[i].to.n; k++) { if (k == j) continue; @@ -2389,7 +2389,7 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, for (j = 0; j < CaseUnfold_13[i].to.n; j++) { r = (*f)(CaseUnfold_13[i].to.code[j], (OnigCodePoint* )CaseUnfold_13[i].from, 3, arg); - if (r != 0) return r; + if (r != 0) return r; for (k = 0; k < CaseUnfold_13[i].to.n; k++) { if (k == j) continue; diff --git a/enc/utf_8.c b/enc/utf_8.c index 0c44a3efeb..83f8701205 100644 --- a/enc/utf_8.c +++ b/enc/utf_8.c @@ -84,7 +84,7 @@ static const signed char trans[][0x100] = { /* c */ F, F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, - /* f */ 5, 6, 6, 6, 7, F, F, F, F, F, F, F, F, F, F, F + /* f */ 5, 6, 6, 6, 7, F, F, F, F, F, F, F, F, F, F, F }, { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -102,7 +102,7 @@ static const signed char trans[][0x100] = { /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F }, { /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -120,7 +120,7 @@ static const signed char trans[][0x100] = { /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F }, { /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -138,7 +138,7 @@ static const signed char trans[][0x100] = { /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F }, { /* S4 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -156,7 +156,7 @@ static const signed char trans[][0x100] = { /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F }, { /* S5 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -174,7 +174,7 @@ static const signed char trans[][0x100] = { /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F }, { /* S6 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -192,7 +192,7 @@ static const signed char trans[][0x100] = { /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F }, { /* S7 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, @@ -210,7 +210,7 @@ static const signed char trans[][0x100] = { /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F }, }; #undef A diff --git a/enum.c b/enum.c index 584b83836b..9ced77714a 100644 --- a/enum.c +++ b/enum.c @@ -1668,7 +1668,7 @@ enum_each_with_index(int argc, VALUE *argv, VALUE obj) * (1..3).reverse_each {|v| p v } * * produces: - * + * * 3 * 2 * 1 diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 83d090280d..7f64288647 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -4645,9 +4645,9 @@ VpMidRound(Real *y, unsigned short f, ssize_t nf) /* so the representation used (in y->frac) is an array of BDIGIT, where each BDIGIT contains a value between 0 and BASE-1, consisting of BASE_FIG decimal places. - + (that numbers of decimal places are typed as ssize_t is somewhat confusing) - + nf is now position (in decimal places) of the digit from the start of the array. ix is the position (in BDIGITS) of the BDIGIT containing the decimal digit, @@ -4666,7 +4666,7 @@ VpMidRound(Real *y, unsigned short f, ssize_t nf) fracf = (v % (shifter * 10) > 0); fracf_1further = ((v % shifter) > 0); - + v /= shifter; div = v / 10; v = v - div*10; @@ -4687,12 +4687,12 @@ VpMidRound(Real *y, unsigned short f, ssize_t nf) break; } } - + /* now fracf = does any positive digit exist under the rounding position? now fracf_1further = does any positive digit exist under one further than the rounding position? now v = the first digit under the rounding position */ - + /* drop digits after pointed digit */ memset(y->frac+ix+1, 0, (y->Prec - (ix+1)) * sizeof(BDIGIT)); diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c index 2d206385bd..9a84c0be83 100644 --- a/ext/date/date_parse.c +++ b/ext/date/date_parse.c @@ -905,7 +905,7 @@ n2i(const char *s, long f, long w) { long e, i; int v; - + e = f + w; v = 0; for (i = f; i < e; i++) { diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c index fac7abb6f2..8917cce57e 100644 --- a/ext/json/generator/generator.c +++ b/ext/json/generator/generator.c @@ -18,9 +18,9 @@ static ID i_to_s, i_to_json, i_new, i_indent, i_space, i_space_before, /* * Copyright 2001-2004 Unicode, Inc. - * + * * Disclaimer - * + * * This source code is provided as is by Unicode, Inc. No claims are * made as to fitness for any particular purpose. No warranties of any * kind are expressed or implied. The recipient agrees to determine @@ -28,9 +28,9 @@ static ID i_to_s, i_to_json, i_new, i_indent, i_space, i_space_before, * purchased on magnetic or optical media from Unicode, Inc., the * sole remedy for any claim will be exchange of defective media * within 90 days of receipt. - * + * * Limitations on Rights to Redistribute This Code - * + * * Unicode, Inc. hereby grants the right to freely use the information * supplied in this file in the creation of products supporting the * Unicode Standard, and to make copies of this file in any form @@ -61,7 +61,7 @@ static const char trailingBytesForUTF8[256] = { * This table contains as many values as there might be trailing bytes * in a UTF-8 sequence. */ -static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, +static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; /* @@ -399,7 +399,7 @@ static FBuffer *fbuffer_dup(FBuffer *fb) return result; } -/* +/* * Document-module: JSON::Ext::Generator * * This is the JSON generator implemented as a C extension. It can be @@ -979,7 +979,7 @@ static VALUE cState_generate(VALUE self, VALUE obj) * * *indent*: a string used to indent levels (default: ''), * * *space*: a string that is put after, a : or , delimiter (default: ''), * * *space_before*: a string that is put before a : pair delimiter (default: ''), - * * *object_nl*: a string that is put at the end of a JSON object (default: ''), + * * *object_nl*: a string that is put at the end of a JSON object (default: ''), * * *array_nl*: a string that is put at the end of a JSON array (default: ''), * * *allow_nan*: true if NaN, Infinity, and -Infinity should be * generated, otherwise an exception is thrown, if these values are diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb index 91cb3c2190..dd9fef8fad 100644 --- a/ext/json/lib/json/common.rb +++ b/ext/json/lib/json/common.rb @@ -185,7 +185,7 @@ module JSON # * *indent*: a string used to indent levels (default: ''), # * *space*: a string that is put after, a : or , delimiter (default: ''), # * *space_before*: a string that is put before a : pair delimiter (default: ''), - # * *object_nl*: a string that is put at the end of a JSON object (default: ''), + # * *object_nl*: a string that is put at the end of a JSON object (default: ''), # * *array_nl*: a string that is put at the end of a JSON array (default: ''), # * *allow_nan*: true if NaN, Infinity, and -Infinity should be # generated, otherwise an exception is thrown, if these values are diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c index 418c1c32f0..85094b7301 100644 --- a/ext/json/parser/parser.c +++ b/ext/json/parser/parser.c @@ -109,14 +109,14 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu *result = NIL_P(object_class) ? rb_hash_new() : rb_class_new_instance(0, 0, object_class); - + #line 114 "parser.c" { cs = JSON_object_start; } #line 159 "parser.rl" - + #line 121 "parser.c" { if ( p == pe ) @@ -404,32 +404,32 @@ case 26: goto st2; goto st26; } - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof9: cs = 9; goto _test_eof; - _test_eof10: cs = 10; goto _test_eof; - _test_eof11: cs = 11; goto _test_eof; - _test_eof12: cs = 12; goto _test_eof; - _test_eof13: cs = 13; goto _test_eof; - _test_eof14: cs = 14; goto _test_eof; - _test_eof15: cs = 15; goto _test_eof; - _test_eof16: cs = 16; goto _test_eof; - _test_eof17: cs = 17; goto _test_eof; - _test_eof18: cs = 18; goto _test_eof; - _test_eof27: cs = 27; goto _test_eof; - _test_eof19: cs = 19; goto _test_eof; - _test_eof20: cs = 20; goto _test_eof; - _test_eof21: cs = 21; goto _test_eof; - _test_eof22: cs = 22; goto _test_eof; - _test_eof23: cs = 23; goto _test_eof; - _test_eof24: cs = 24; goto _test_eof; - _test_eof25: cs = 25; goto _test_eof; - _test_eof26: cs = 26; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof11: cs = 11; goto _test_eof; + _test_eof12: cs = 12; goto _test_eof; + _test_eof13: cs = 13; goto _test_eof; + _test_eof14: cs = 14; goto _test_eof; + _test_eof15: cs = 15; goto _test_eof; + _test_eof16: cs = 16; goto _test_eof; + _test_eof17: cs = 17; goto _test_eof; + _test_eof18: cs = 18; goto _test_eof; + _test_eof27: cs = 27; goto _test_eof; + _test_eof19: cs = 19; goto _test_eof; + _test_eof20: cs = 20; goto _test_eof; + _test_eof21: cs = 21; goto _test_eof; + _test_eof22: cs = 22; goto _test_eof; + _test_eof23: cs = 23; goto _test_eof; + _test_eof24: cs = 24; goto _test_eof; + _test_eof25: cs = 25; goto _test_eof; + _test_eof26: cs = 26; goto _test_eof; _test_eof: {} _out: {} @@ -469,14 +469,14 @@ static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *resul { int cs = EVIL; - + #line 474 "parser.c" { cs = JSON_value_start; } #line 265 "parser.rl" - + #line 481 "parser.c" { if ( p == pe ) @@ -728,26 +728,26 @@ case 20: goto tr28; goto st0; } - _test_eof21: cs = 21; goto _test_eof; - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof9: cs = 9; goto _test_eof; - _test_eof10: cs = 10; goto _test_eof; - _test_eof11: cs = 11; goto _test_eof; - _test_eof12: cs = 12; goto _test_eof; - _test_eof13: cs = 13; goto _test_eof; - _test_eof14: cs = 14; goto _test_eof; - _test_eof15: cs = 15; goto _test_eof; - _test_eof16: cs = 16; goto _test_eof; - _test_eof17: cs = 17; goto _test_eof; - _test_eof18: cs = 18; goto _test_eof; - _test_eof19: cs = 19; goto _test_eof; - _test_eof20: cs = 20; goto _test_eof; + _test_eof21: cs = 21; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof11: cs = 11; goto _test_eof; + _test_eof12: cs = 12; goto _test_eof; + _test_eof13: cs = 13; goto _test_eof; + _test_eof14: cs = 14; goto _test_eof; + _test_eof15: cs = 15; goto _test_eof; + _test_eof16: cs = 16; goto _test_eof; + _test_eof17: cs = 17; goto _test_eof; + _test_eof18: cs = 18; goto _test_eof; + _test_eof19: cs = 19; goto _test_eof; + _test_eof20: cs = 20; goto _test_eof; _test_eof: {} _out: {} @@ -778,7 +778,7 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res { int cs = EVIL; - + #line 783 "parser.c" { cs = JSON_integer_start; @@ -786,7 +786,7 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res #line 289 "parser.rl" json->memo = p; - + #line 791 "parser.c" { if ( p == pe ) @@ -838,10 +838,10 @@ case 4: goto st4; goto tr4; } - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; _test_eof: {} _out: {} @@ -874,7 +874,7 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul { int cs = EVIL; - + #line 879 "parser.c" { cs = JSON_float_start; @@ -882,7 +882,7 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul #line 320 "parser.rl" json->memo = p; - + #line 887 "parser.c" { if ( p == pe ) @@ -995,15 +995,15 @@ case 9: goto st9; goto st0; } - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof10: cs = 10; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof9: cs = 9; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; _test_eof: {} _out: {} @@ -1043,14 +1043,14 @@ static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *resul } *result = NIL_P(array_class) ? rb_ary_new() : rb_class_new_instance(0, 0, array_class); - + #line 1048 "parser.c" { cs = JSON_array_start; } #line 371 "parser.rl" - + #line 1055 "parser.c" { if ( p == pe ) @@ -1248,22 +1248,22 @@ case 16: goto st2; goto st16; } - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof9: cs = 9; goto _test_eof; - _test_eof10: cs = 10; goto _test_eof; - _test_eof11: cs = 11; goto _test_eof; - _test_eof12: cs = 12; goto _test_eof; - _test_eof17: cs = 17; goto _test_eof; - _test_eof13: cs = 13; goto _test_eof; - _test_eof14: cs = 14; goto _test_eof; - _test_eof15: cs = 15; goto _test_eof; - _test_eof16: cs = 16; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof11: cs = 11; goto _test_eof; + _test_eof12: cs = 12; goto _test_eof; + _test_eof17: cs = 17; goto _test_eof; + _test_eof13: cs = 13; goto _test_eof; + _test_eof14: cs = 14; goto _test_eof; + _test_eof15: cs = 15; goto _test_eof; + _test_eof16: cs = 16; goto _test_eof; _test_eof: {} _out: {} @@ -1366,7 +1366,7 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu int cs = EVIL; *result = rb_str_buf_new(0); - + #line 1371 "parser.c" { cs = JSON_string_start; @@ -1374,7 +1374,7 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu #line 479 "parser.rl" json->memo = p; - + #line 1379 "parser.c" { if ( p == pe ) @@ -1482,13 +1482,13 @@ case 7: goto st2; goto st0; } - _test_eof2: cs = 2; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; _test_eof: {} _out: {} @@ -1701,7 +1701,7 @@ static VALUE cParser_parse(VALUE self) VALUE result = Qnil; GET_PARSER; - + #line 1706 "parser.c" { cs = JSON_start; @@ -1710,7 +1710,7 @@ static VALUE cParser_parse(VALUE self) #line 703 "parser.rl" p = json->source; pe = p + json->len; - + #line 1715 "parser.c" { if ( p == pe ) @@ -1830,16 +1830,16 @@ case 9: goto st10; goto st9; } - _test_eof1: cs = 1; goto _test_eof; - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof10: cs = 10; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof9: cs = 9; goto _test_eof; + _test_eof1: cs = 1; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; _test_eof: {} _out: {} diff --git a/ext/nkf/nkf-utf8/nkf.c b/ext/nkf/nkf-utf8/nkf.c index 28e164ab91..fc5b30d921 100644 --- a/ext/nkf/nkf-utf8/nkf.c +++ b/ext/nkf/nkf-utf8/nkf.c @@ -821,7 +821,7 @@ nkf_buf_new(int length) buf->capa = length; buf->len = 0; return buf; -} +} #if 0 static void @@ -5874,7 +5874,7 @@ finished: /* * int options(unsigned char *cp) - * + * * return values: * 0: success * -1: ArgumentError diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c index e50ce544ae..ca811964b5 100644 --- a/ext/openssl/ossl_asn1.c +++ b/ext/openssl/ossl_asn1.c @@ -845,7 +845,7 @@ ossl_asn1_decode0(unsigned char **pp, long length, long *offset, long depth, ossl_asn1_set_infinite_length(asn1data, Qtrue); else ossl_asn1_set_infinite_length(asn1data, Qfalse); - + rb_ary_push(ary, asn1data); length -= len; if(once) break; diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index d750e95ca3..3122c0e4ea 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -108,7 +108,7 @@ struct { OSSL_SSL_METHOD_ENTRY(TLSv1_server), OSSL_SSL_METHOD_ENTRY(TLSv1_client), #if defined(HAVE_SSLV2_METHOD) && defined(HAVE_SSLV2_SERVER_METHOD) && \ - defined(HAVE_SSLV2_CLIENT_METHOD) + defined(HAVE_SSLV2_CLIENT_METHOD) OSSL_SSL_METHOD_ENTRY(SSLv2), OSSL_SSL_METHOD_ENTRY(SSLv2_server), OSSL_SSL_METHOD_ENTRY(SSLv2_client), diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index 74efc996dc..e1632c524b 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -170,7 +170,7 @@ path_sub(int argc, VALUE *argv, VALUE self) /* * Return a pathname which the extension of the basename is substituted by * repl. - * + * * If self has no extension part, repl is appended. */ static VALUE @@ -220,7 +220,7 @@ path_realpath(int argc, VALUE *argv, VALUE self) /* * Returns the real (absolute) pathname of +self+ in the actual filesystem. * The real pathname doesn't contain symlinks or useless dots. - * + * * The last component of the real pathname can be nonexistent. */ static VALUE @@ -239,10 +239,10 @@ path_realdirpath(int argc, VALUE *argv, VALUE self) * pathname.each_line(limit [, open_args]) {|line| block } -> nil * pathname.each_line(sep, limit [, open_args]) {|line| block } -> nil * pathname.each_line(...) -> an_enumerator - * + * * #each_line iterates over the line in the file. It yields a String object * for each line. - * + * * This method is availabel since 1.8.1. */ static VALUE @@ -265,7 +265,7 @@ path_each_line(int argc, VALUE *argv, VALUE self) * call-seq: * pathname.read([length [, offset]]) -> string * pathname.read([length [, offset]], open_args) -> string - * + * * See IO.read. Returns all data from the file, or the first +N+ bytes * if specified. * @@ -284,7 +284,7 @@ path_read(int argc, VALUE *argv, VALUE self) /* * call-seq: * pathname.binread([length [, offset]]) -> string - * + * * See IO.binread. Returns all the bytes from the file, or the first +N+ * if specified. * @@ -305,7 +305,7 @@ path_binread(int argc, VALUE *argv, VALUE self) * pathname.readlines(sep=$/ [, open_args]) -> array * pathname.readlines(limit [, open_args]) -> array * pathname.readlines(sep, limit [, open_args]) -> array - * + * * See IO.readlines. Returns all the lines from the file. * */ @@ -323,7 +323,7 @@ path_readlines(int argc, VALUE *argv, VALUE self) /* * call-seq: * pathname.sysopen([mode, [perm]]) -> fixnum - * + * * See IO.sysopen. * */ @@ -405,7 +405,7 @@ path_lchown(VALUE self, VALUE owner, VALUE group) * call-seq: * pathname.fnmatch(pattern, [flags]) -> string * pathname.fnmatch?(pattern, [flags]) -> string - * + * * See File.fnmatch. Return +true+ if the receiver matches the given * pattern. */ diff --git a/ext/psych/lib/psych/nodes.rb b/ext/psych/lib/psych/nodes.rb index 9e5946daa9..f3b33fe975 100644 --- a/ext/psych/lib/psych/nodes.rb +++ b/ext/psych/lib/psych/nodes.rb @@ -31,7 +31,7 @@ module Psych # doc = Psych::Nodes::Document.new # seq = Psych::Nodes::Sequence.new # scalar = Psych::Nodes::Scalar.new('foo') - # + # # # Build up our tree # stream.children << doc # doc.children << seq diff --git a/ext/pty/lib/expect.rb b/ext/pty/lib/expect.rb index 54cf709ee2..0b238af8be 100644 --- a/ext/pty/lib/expect.rb +++ b/ext/pty/lib/expect.rb @@ -4,7 +4,7 @@ class IO # Reads ios until pattern matches or the timeout is over. It returns # an array with the read buffer, followed by the matches. If a block is given, # the result is yielded to the block and returns nil. The optional timeout parameter defines, - # in seconds, the total time to wait for pattern. If it is over of eof is found, it + # in seconds, the total time to wait for pattern. If it is over of eof is found, it # returns/yields nil. However, the buffer in a timeout session is kept for the next expect call. # The default timeout is 9999999 seconds. def expect(pat,timeout=9999999) diff --git a/ext/socket/option.c b/ext/socket/option.c index 4e7f8735a4..49288a17eb 100644 --- a/ext/socket/option.c +++ b/ext/socket/option.c @@ -529,7 +529,7 @@ inspect_ipv4_add_drop_membership(int level, int optname, VALUE data, VALUE ret) if (RSTRING_LEN(data) == sizeof(struct ip_mreq)) return inspect_ipv4_mreq(level, optname, data, ret); # if defined(HAVE_TYPE_STRUCT_IP_MREQN) - else if (RSTRING_LEN(data) == sizeof(struct ip_mreqn)) + else if (RSTRING_LEN(data) == sizeof(struct ip_mreqn)) return inspect_ipv4_mreqn(level, optname, data, ret); # endif else diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb index 388d6fc1aa..c7bc45f150 100644 --- a/ext/tk/extconf.rb +++ b/ext/tk/extconf.rb @@ -5,7 +5,7 @@ require 'mkmf' TkLib_Config = {} -TkLib_Config['search_versions'] = +TkLib_Config['search_versions'] = # %w[8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6 4.2] # %w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0] %w[8.7 8.6 8.5 8.4 8.0] # to shorten search steps @@ -26,7 +26,7 @@ end $cleanfiles << 'config_list' config_list_file = 'config_list' config_list_file_source = File.join(File.dirname(__FILE__),'config_list.in') -if !File.exist?(config_list_file) || +if !File.exist?(config_list_file) || File.ctime(config_list_file_source) > File.ctime(config_list_file) old_config_list_file = config_list_file_source else @@ -92,7 +92,7 @@ if update_flag else makefile = 'Makefile' - if File.exist?(makefile) && + if File.exist?(makefile) && File.ctime(config_list_file) > File.ctime(makefile) # no need to update Makefile exit @@ -197,7 +197,7 @@ def get_shlib_path_head else [ - '/opt', '/pkg', '/share', + '/opt', '/pkg', '/share', '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local', '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr' ].each{|dir| @@ -268,7 +268,7 @@ def find_macosx_framework end # framework is disabled? - if with_config("tcltk-framework") == false || + if with_config("tcltk-framework") == false || enable_config("tcltk-framework") == false return false end @@ -276,7 +276,7 @@ def find_macosx_framework use_framework ||= (framework_dir = with_config("tcltk-framework")) if framework_dir.kind_of? String TkLib_Config["tcltk-framework"] = framework_dir.strip.chomp('/') - return [File.join(TkLib_Config["tcltk-framework"], 'Tcl.framework'), + return [File.join(TkLib_Config["tcltk-framework"], 'Tcl.framework'), File.join(TkLib_Config["tcltk-framework"], 'Tk.framework')] end @@ -287,7 +287,7 @@ def find_macosx_framework end paths = [ - #"~/Library/Frameworks", + #"~/Library/Frameworks", "/Library/Frameworks", "/Network/Library/Frameworks", "/System/Library/Frameworks" ] @@ -305,7 +305,7 @@ end def collect_tcltk_defs(tcl_defs_str, tk_defs_str) conflicts = [ - 'PACKAGE_NAME', 'PACKAGE_TARNAME', 'PACKAGE_VERSION', + 'PACKAGE_NAME', 'PACKAGE_TARNAME', 'PACKAGE_VERSION', 'PACKAGE_STRING', 'PACKAGE_BUGREPORT' ] @@ -347,7 +347,7 @@ def collect_tcltk_defs(tcl_defs_str, tk_defs_str) defs.delete_if{|name,value| conflicts.include?(name) || - ( (vtcl = tcl_defs.assoc(name)) && (vtk = tk_defs.assoc(name)) && + ( (vtcl = tcl_defs.assoc(name)) && (vtk = tk_defs.assoc(name)) && vtcl != vtk ) } @@ -433,7 +433,7 @@ def get_tclConfig_dirs File.join(base, 'Tk.framework', 'Versions', 'Current') ] - Dir.glob(File.join(base, 'Tcl.framework', + Dir.glob(File.join(base, 'Tcl.framework', 'Versions', '*')).sort.reverse.each{|dir| next if dir =~ /Current/ config_dir << [dir, dir.gsub(/Tcl/, 'Tk')] @@ -446,14 +446,14 @@ def get_tclConfig_dirs config_dir.concat [ RbConfig::CONFIG['libdir'], File.join(RbConfig::CONFIG['exec_prefix'], 'lib'), - File.join(RbConfig::CONFIG['prefix'], 'lib'), - "/usr/local/opt/lib", "/usr/local/pkg/lib", "/usr/local/share/lib", - "/usr/local/lib", "/usr/opt/lib", "/usr/pkg/lib", + File.join(RbConfig::CONFIG['prefix'], 'lib'), + "/usr/local/opt/lib", "/usr/local/pkg/lib", "/usr/local/share/lib", + "/usr/local/lib", "/usr/opt/lib", "/usr/pkg/lib", "/usr/share/lib", "/usr/contrib/lib", "/usr/lib" ] config_dir.concat [ - '/opt', '/pkg', '/share', + '/opt', '/pkg', '/share', '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local', '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr' ].map{|dir| @@ -483,7 +483,7 @@ def get_tclConfig_dirs } paths = [ - #"~/Library/Frameworks", + #"~/Library/Frameworks", "/Library/Frameworks", "/Network/Library/Frameworks", "/System/Library/Frameworks" ] @@ -500,7 +500,7 @@ def get_tclConfig_dirs File.join(base, 'Tk.framework', 'Versions', 'Current') ] - Dir.glob(File.join(base, 'Tcl.framework', + Dir.glob(File.join(base, 'Tcl.framework', 'Versions', '*')).sort.reverse.each{|dir| next if dir =~ /Current/ config_dir << [dir, dir.gsub(/Tcl/, 'Tk')] @@ -702,7 +702,7 @@ def search_tclConfig(*paths) # libdir list or [tcl-libdir|file, tk-libdir|file] end def get_tclConfig(tclConfig_file, tkConfig_file, tclConfig_dir, tkConfig_dir) - use_tclConfig = (tclConfig_file != false) && (tkConfig_file != false) && + use_tclConfig = (tclConfig_file != false) && (tkConfig_file != false) && (tclConfig_dir != false) && (tkConfig_dir != false) unless use_tclConfig @@ -736,11 +736,11 @@ def get_tclConfig(tclConfig_file, tkConfig_file, tclConfig_dir, tkConfig_dir) TkLib_Config["tclConfig-dir"] = tclConfig_dir TkLib_Config["tkConfig-dir"] = tkConfig_dir - print("Search tclConfig.sh", (tclConfig_dir)? " (in #{tclConfig_dir})": "", + print("Search tclConfig.sh", (tclConfig_dir)? " (in #{tclConfig_dir})": "", " and tkConfig.sh", (tkConfig_dir)? " (in #{tkConfig_dir})": "", ".") if tclConfig_dir - tclConfig, tkConfig = - search_tclConfig([ ((tclConfig_file)? tclConfig_file: tclConfig_dir), + tclConfig, tkConfig = + search_tclConfig([ ((tclConfig_file)? tclConfig_file: tclConfig_dir), ((tkConfig_file)? tkConfig_file: tkConfig_dir) ]) else tclConfig, tkConfig = search_tclConfig() @@ -1057,7 +1057,7 @@ def find_tk(tklib, stubs, version, *opt_paths) ret end -def find_tcltk_library(tcllib, tklib, stubs, tclversion, tkversion, +def find_tcltk_library(tcllib, tklib, stubs, tclversion, tkversion, tcl_opt_paths, tk_opt_paths) ret = find_tcl(tcllib, stubs, tclversion, *tcl_opt_paths) unless ret && ret.find{|path, val| val} @@ -1094,7 +1094,7 @@ def find_tcltk_header(tclver, tkver) base_dir.delete_if{|path| path =~ / /} end - if TclConfig_Info['TCL_INCLUDE_SPEC'] && + if TclConfig_Info['TCL_INCLUDE_SPEC'] && have_tcl_h = try_cpp('#include ', TclConfig_Info['TCL_INCLUDE_SPEC']) $INCFLAGS << " " << TclConfig_Info['TCL_INCLUDE_SPEC'] elsif have_tcl_h = have_header('tcl.h') @@ -1106,7 +1106,7 @@ def find_tcltk_header(tclver, tkver) versions = TkLib_Config['search_versions'] end paths = base_dir.dup - versions.each{|ver| + versions.each{|ver| paths.concat(base_dir.map{|dir| [dir + '/tcl' + ver, dir + '/tcl' + ver.delete('.')] }.flatten) @@ -1114,7 +1114,7 @@ def find_tcltk_header(tclver, tkver) have_tcl_h = find_header('tcl.h', *paths) end - if TkConfig_Info['TK_INCLUDE_SPEC'] && + if TkConfig_Info['TK_INCLUDE_SPEC'] && have_tk_h = try_cpp('#include ', TkConfig_Info['TK_INCLUDE_SPEC']) $INCFLAGS << " " << TkConfig_Info['TK_INCLUDE_SPEC'] elsif have_tk_h = have_header('tk.h') @@ -1126,7 +1126,7 @@ def find_tcltk_header(tclver, tkver) versions = TkLib_Config['search_versions'] end paths = base_dir.dup - versions.each{|ver| + versions.each{|ver| paths.concat(base_dir.map{|dir| [dir + '/tk' + ver, dir + '/tk' + ver.delete('.')] }.flatten) @@ -1158,14 +1158,14 @@ def setup_for_macosx_framework(tclver, tkver) TclConfig_Info['TCL_INCLUDE_SPEC'] << File.join(tcl_base, 'Headers') unless tclver - dir = Dir.glob(File.join(tcl_base, 'Versions', '*', 'Headers'), + dir = Dir.glob(File.join(tcl_base, 'Versions', '*', 'Headers'), File::FNM_CASEFOLD).sort.reverse[0] TclConfig_Info['TCL_INCLUDE_SPEC'] << "-I#{dir.quote} " if dir end end if TkLib_Config["tk-framework-header"] - TkConfig_Info['TK_INCLUDE_SPEC'] = + TkConfig_Info['TK_INCLUDE_SPEC'] = "-I#{TkLib_Config["tk-framework-header"].quote} " else TkConfig_Info['TK_INCLUDE_SPEC'] = "" @@ -1179,7 +1179,7 @@ def setup_for_macosx_framework(tclver, tkver) TkConfig_Info['TK_INCLUDE_SPEC'] << File.join(tk_base, 'Headers') unless tkver - dir = Dir.glob(File.join(tk_base, 'Versions', '*', 'Headers'), + dir = Dir.glob(File.join(tk_base, 'Versions', '*', 'Headers'), File::FNM_CASEFOLD).sort.reverse[0] TkConfig_Info['TK_INCLUDE_SPEC'] << "-I#{dir.quote} " if dir end @@ -1288,9 +1288,9 @@ def pthread_check() ** ** NATIVETHREAD SUPPORT CHECK WARNING: ** -** We cannot check the consistency of nativethread support between +** We cannot check the consistency of nativethread support between ** Ruby and the Tcl/Tk library in your environment (are you perhaps -** cross-compiling?). If nativethread support for these 2 packages +** cross-compiling?). If nativethread support for these 2 packages ** is inconsistent you may find you get errors when running Ruby/Tk ** (e.g. hangs or segmentation faults). We strongly recommend ** you to check the consistency manually. @@ -1333,17 +1333,17 @@ EOF ** ** NATIVETHREAD SUPPORT MODE WARNING: ** -** Ruby is compiled with --enable-pthread, but your Tcl/Tk library -** seems to be compiled without nativethread support. Although you can -** create the tcltklib library, this combination may cause errors (e.g. -** hangs or segmentation faults). If you have no reason to keep the -** current nativethread support status, we recommend you reconfigure and +** Ruby is compiled with --enable-pthread, but your Tcl/Tk library +** seems to be compiled without nativethread support. Although you can +** create the tcltklib library, this combination may cause errors (e.g. +** hangs or segmentation faults). If you have no reason to keep the +** current nativethread support status, we recommend you reconfigure and ** recompile the libraries so that both or neither support nativethreads. ** ** If you want change the status of nativethread support, please recompile ** Ruby without "--enable-pthread" configure option (If you use Ruby 1.9.x ** or later, you cannot remove this option, because it requires native- -** thread support.) or recompile Tcl/Tk with "--enable-threads" configure +** thread support.) or recompile Tcl/Tk with "--enable-threads" configure ** option (if your Tcl/Tk is later than or equal to Tcl/Tk 8.1). ** ***************************************************************************** @@ -1434,14 +1434,14 @@ end $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM # Does ruby have nativethread ? -TkLib_Config["ruby_with_thread"] = +TkLib_Config["ruby_with_thread"] = macro_defined?('HAVE_NATIVETHREAD', '#include "ruby.h"') #--------------------------------------------------- # check requirement of Tcl/tk version tcltk_version = with_config("tcltkversion") -tclver, tkver = +tclver, tkver = TkLib_Config["tcltkversion"] = check_tcltk_version(tcltk_version) puts("Specified Tcl/Tk version is #{[tclver, tkver].inspect}") if tclver&&tkver @@ -1464,12 +1464,12 @@ end TkLib_Config["ActiveTcl"] = activeTcl # allow space chars on a libpath -TkLib_Config["space-on-tk-libpath"] = +TkLib_Config["space-on-tk-libpath"] = enable_config("space-on-tk-libpath", ! is_win32?) # enable Tcl/Tk stubs? =begin -if TclConfig_Info['TCL_STUB_LIB_SPEC'] && TkConfig_Info['TK_STUB_LIB_SPEC'] && +if TclConfig_Info['TCL_STUB_LIB_SPEC'] && TkConfig_Info['TK_STUB_LIB_SPEC'] && !TclConfig_Info['TCL_STUB_LIB_SPEC'].strip.empty? && !TkConfig_Info['TK_STUB_LIB_SPEC'].strip.empty? stubs = true @@ -1562,7 +1562,7 @@ use_X = search_X_libraries if (TkLib_Config["tcltk-framework"] || ( find_tcltk_header(tclver, tkver) && - find_tcltk_library(tcllib, tklib, stubs, tclver, tkver, + find_tcltk_library(tcllib, tklib, stubs, tclver, tkver, tcl_ldir_list, tk_ldir_list) ) ) && (stubs || pthread_check()) # create Makefile diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb index efeaf9830a..b125c6e18e 100644 --- a/ext/tk/lib/multi-tk.rb +++ b/ext/tk/lib/multi-tk.rb @@ -774,7 +774,7 @@ class MultiTkIp ensure # interp must be deleted before the thread for interp is dead. - # If not, raise Tcl_Panic on Tcl_AsyncDelete because async handler + # If not, raise Tcl_Panic on Tcl_AsyncDelete because async handler # deleted by the wrong thread. interp.delete end @@ -1933,7 +1933,7 @@ class MultiTkIp end =end def cb_eval(cmd, *args) - self.eval_callback(*args, + self.eval_callback(*args, &_proc_on_safelevel{|*params| TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *params)) }) @@ -2121,7 +2121,7 @@ class MultiTkIp end err } - $SAFE=safe if $SAFE < safe; + $SAFE=safe if $SAFE < safe; begin yield(*args) rescue Exception => e @@ -2300,7 +2300,7 @@ end current[:callback_ip] = backup_ip end else - eval_proc_core(true, + eval_proc_core(true, proc{|safe, *params| Thread.new{cmd.call(safe, *params)}.value }, diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index f00afe9ea0..0fd8cfdb20 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -1306,7 +1306,7 @@ EOS ensure # interp must be deleted before the thread for interp is dead. - # If not, raise Tcl_Panic on Tcl_AsyncDelete because async handler + # If not, raise Tcl_Panic on Tcl_AsyncDelete because async handler # deleted by the wrong thread. interp.delete end @@ -1339,7 +1339,7 @@ EOS INTERP.instance_eval{ # @tk_cmd_tbl = TkUtil.untrust({}) - @tk_cmd_tbl = + @tk_cmd_tbl = TkUtil.untrust(Hash.new{|hash, key| fail IndexError, "unknown command ID '#{key}'" }) diff --git a/ext/tk/lib/tk/autoload.rb b/ext/tk/lib/tk/autoload.rb index 2ebee9ea24..f6ca261da9 100644 --- a/ext/tk/lib/tk/autoload.rb +++ b/ext/tk/lib/tk/autoload.rb @@ -538,8 +538,8 @@ class << Tk @TOPLEVEL_ALIAS_TABLE[target][sym] = obj else # NOT topalias_defined?(sym) - # Nobody controls ALIAS[sym]. - # At leaset, current widget set doesn't control ALIAS[sym]. + # Nobody controls ALIAS[sym]. + # At leaset, current widget set doesn't control ALIAS[sym]. # Keep Object::sym (even if it is not defined) # Keep OWNER[sym]. @TOPLEVEL_ALIAS_TABLE[target][sym] = obj @@ -552,7 +552,7 @@ class << Tk @TOPLEVEL_ALIAS_TABLE[target][sym] = obj replace_topalias(sym, obj) replace_topobj(sym, obj) - + when nil # New definition for sym @TOPLEVEL_ALIAS_OWNER[sym] = target @@ -566,7 +566,7 @@ class << Tk # Keep ALIAS[sym]. # Keep OWNER[sym]. @TOPLEVEL_ALIAS_TABLE[target][sym] = obj - + end end @@ -583,7 +583,7 @@ class << Tk def __set_loaded_toplevel_aliases__(autopath, target, obj, *symbols) # autopath is an autoload file - # Currently, this method doesn't support that autoload loads + # Currently, this method doesn't support that autoload loads # different toplevels between .rb and .so extension. shortpath = (autopath =~ /^(.*)(.rb|.so)$/)? $1: autopath target = target.to_sym diff --git a/ext/tk/lib/tk/fontchooser.rb b/ext/tk/lib/tk/fontchooser.rb index 092ffc04bf..694c58a607 100644 --- a/ext/tk/lib/tk/fontchooser.rb +++ b/ext/tk/lib/tk/fontchooser.rb @@ -86,7 +86,7 @@ class << TkFont::Chooser def configure(option, value=None) if option.kind_of? Hash - tk_call('tk', 'fontchooser', 'configure', + tk_call('tk', 'fontchooser', 'configure', *hash_kv(_symbolkey2str(option))) else opt = option.to_s @@ -141,8 +141,8 @@ class << TkFont::Chooser def set_for(target, title="Font") if target.kind_of? TkFont configs = { - :font=>target.actual_hash, - :command=>proc{|fnt, *args| + :font=>target.actual_hash, + :command=>proc{|fnt, *args| target.configure(TkFont.actual_hash(fnt)) } } @@ -152,14 +152,14 @@ class << TkFont::Chooser fnt = fnt.actual_hash if fnt.kind_of?(TkFont) configs = { :font => fnt, - :command=>proc{|fnt, *args| + :command=>proc{|fnt, *args| target[:font] = TkFont.actual_hash(fnt) } } else configs = { - :font=>target.cget_tkstring(:font), - :command=>proc{|fnt, *args| + :font=>target.cget_tkstring(:font), + :command=>proc{|fnt, *args| target.font = TkFont.actual_hash_displayof(fnt, target) } } diff --git a/ext/tk/lib/tk/menuspec.rb b/ext/tk/lib/tk/menuspec.rb index 9521a157d9..cb3597eec9 100644 --- a/ext/tk/lib/tk/menuspec.rb +++ b/ext/tk/lib/tk/menuspec.rb @@ -27,7 +27,7 @@ # # A menu_info is an array of menu entries: # [ entry_info, entry_info, ... ] -# +# # # underline, accelerator, and configs are optional pearameters. # Hashes are OK instead of Arrays. Then the entry type ('command', diff --git a/ext/tk/lib/tk/ttk_selector.rb b/ext/tk/lib/tk/ttk_selector.rb index 522249e6a9..cc9e9928cb 100644 --- a/ext/tk/lib/tk/ttk_selector.rb +++ b/ext/tk/lib/tk/ttk_selector.rb @@ -62,7 +62,7 @@ module Tk major, minor, type, patchlevel = TclTkLib.get_version # ttk::spinbox is supported on Tcl/Tk8.6b1 or later - if ([major,minor,type,patchlevel] <=> + if ([major,minor,type,patchlevel] <=> [8,6,TclTkLib::RELEASE_TYPE::BETA,1]) >= 0 @TOPLEVEL_ALIAS_TABLE[:Ttk].update( :TkSpinbox => 'tkextlib/tile/tspinbox' diff --git a/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb b/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb index 0bd59511c1..ba87cd3aae 100644 --- a/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb +++ b/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb @@ -3,7 +3,7 @@ # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # # * Part of tcllib extension -# * +# * # require 'tk' diff --git a/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb b/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb index e2a5061112..f4ffb48ece 100644 --- a/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb +++ b/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb @@ -3,7 +3,7 @@ # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # # * Part of tcllib extension -# * +# * # require 'tk' diff --git a/ext/tk/lib/tkextlib/tcllib/chatwidget.rb b/ext/tk/lib/tkextlib/tcllib/chatwidget.rb index 860b9e899b..ddb0340c31 100644 --- a/ext/tk/lib/tkextlib/tcllib/chatwidget.rb +++ b/ext/tk/lib/tkextlib/tcllib/chatwidget.rb @@ -3,7 +3,7 @@ # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # # * Part of tcllib extension -# * chatwidget - Provides a multi-paned view suitable for display of +# * chatwidget - Provides a multi-paned view suitable for display of # chat room or irc channel information # @@ -92,7 +92,7 @@ class Tk::Tcllib::ChatWidget def hook_add(type, *args, &blk) # args -> [prior, cmd], [prior], [cmd] #type -> 'message', 'post', 'names_group', 'names_nick', 'chatstate', 'url' - + if prior = args.shift if !prior.kind_of?(Numeric) cmd = prior diff --git a/ext/tk/lib/tkextlib/tcllib/ip_entry.rb b/ext/tk/lib/tkextlib/tcllib/ip_entry.rb index e5e0f8d42d..4878cc3c23 100644 --- a/ext/tk/lib/tkextlib/tcllib/ip_entry.rb +++ b/ext/tk/lib/tkextlib/tcllib/ip_entry.rb @@ -70,6 +70,6 @@ class Tk::Tcllib::IP_Entry end end -class Tk::Tcllib::IP_Entry6 < Tk::Tcllib::IP_Entry +class Tk::Tcllib::IP_Entry6 < Tk::Tcllib::IP_Entry TkCommandNames = ['::ipentry::ipentry6'.freeze].freeze end diff --git a/ext/tk/lib/tkextlib/tcllib/khim.rb b/ext/tk/lib/tkextlib/tcllib/khim.rb index 00acff91d9..5dc2130b35 100644 --- a/ext/tk/lib/tkextlib/tcllib/khim.rb +++ b/ext/tk/lib/tkextlib/tcllib/khim.rb @@ -43,11 +43,11 @@ class Tk::Tcllib::KHIM def self.set_config(*args) if args.length == 1 - # cmd_string generated by + # cmd_string generated by #Tk.ip_eval_without_enc(cmd_string) Tk.ip_eval(cmd_string) else - # args for setConfig command + # args for setConfig command #Tk.tk_call_without_enc('::khim::setConfig', *args) Tk.tk_call('::khim::setConfig', *args) end diff --git a/ext/tk/lib/tkextlib/tcllib/plotchart.rb b/ext/tk/lib/tkextlib/tcllib/plotchart.rb index 3c944bb266..2f3d79d427 100644 --- a/ext/tk/lib/tkextlib/tcllib/plotchart.rb +++ b/ext/tk/lib/tkextlib/tcllib/plotchart.rb @@ -221,7 +221,7 @@ module Tk::Tcllib::Plotchart end def legend(series, text) - tk_call_without_enc(@chart, 'legend', + tk_call_without_enc(@chart, 'legend', _get_eval_enc_str(series), _get_eval_enc_str(text)) self end @@ -238,7 +238,7 @@ module Tk::Tcllib::Plotchart text, dir = args - tk_call_without_enc(@chart, 'balloon', x, y, + tk_call_without_enc(@chart, 'balloon', x, y, _get_eval_enc_str(text), dir) self end @@ -263,7 +263,7 @@ module Tk::Tcllib::Plotchart text, dir = args - tk_call_without_enc(@chart, 'plaintext', x, y, + tk_call_without_enc(@chart, 'plaintext', x, y, _get_eval_enc_str(text), dir) self end @@ -485,7 +485,7 @@ module Tk::Tcllib::Plotchart end def dot(series, xcrd, ycrd, value) - tk_call_without_enc(@chart, 'dot', _get_eval_enc_str(series), + tk_call_without_enc(@chart, 'dot', _get_eval_enc_str(series), xcrd, ycrd, value) self end @@ -804,7 +804,7 @@ module Tk::Tcllib::Plotchart private :_create_chart def plot(label, yvalue, color) - tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(label), + tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(label), _get_eval_enc_str(yvalue), color) self end @@ -1262,8 +1262,8 @@ module Tk::Tcllib::Plotchart # time_begin := String of time format (e.g. "1 january 2004") # time_end := String of time format (e.g. "1 january 2004") # args := Expected/maximum number of items - # ( This determines the vertical spacing. ), - # Expected/maximum width of items, + # ( This determines the vertical spacing. ), + # Expected/maximum width of items, # Option Hash ( { key=>value, ... } ) if args[0].kind_of?(String) @time_begin = args.shift diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist.rb b/ext/tk/lib/tkextlib/tcllib/tablelist.rb index b40f7a5b8b..bf5ab6620a 100644 --- a/ext/tk/lib/tkextlib/tcllib/tablelist.rb +++ b/ext/tk/lib/tkextlib/tcllib/tablelist.rb @@ -10,7 +10,7 @@ require 'tkextlib/tcllib.rb' # check Tile extension :: If already loaded, use tablelist_tile. unless defined? Tk::Tcllib::Tablelist_usingTile - Tk::Tcllib::Tablelist_usingTile = + Tk::Tcllib::Tablelist_usingTile = TkPackage.provide('tile') || TkPackage.provide('Ttk') end diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb b/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb index 850e75d845..2a5c415cc7 100644 --- a/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb +++ b/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb @@ -419,7 +419,7 @@ class Tk::Tcllib::Tablelist columnwidth(idx, 'total') end - def configcelllist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...] + def configcelllist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...] ary = [] lst.slice(3){|idx, opt, val| ary << _to_idx(idx) << "-#{opt}" << val @@ -439,7 +439,7 @@ class Tk::Tcllib::Tablelist end alias config_cells configcells - def configcolumnlist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...] + def configcolumnlist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...] ary = [] lst.slice(3){|idx, opt, val| ary << _to_idx(idx) << "-#{opt}" << val @@ -459,7 +459,7 @@ class Tk::Tcllib::Tablelist end alias config_columns configcolumns - def configrowlist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...] + def configrowlist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...] ary = [] lst.slice(3){|idx, opt, val| ary << _to_idx(idx) << "-#{opt}" << val @@ -841,11 +841,11 @@ class Tk::Tcllib::Tablelist # default of 'labelcommand' option - DEFAULT_labelcommand_value = + DEFAULT_labelcommand_value = DEFAULT_sortByColumn_cmd = '::tablelist::sortByColumn' # default of 'labelcommand2' option - DEFAULT_labelcommand2_value = + DEFAULT_labelcommand2_value = DEFAULT_addToSortColumns_cmd = '::tablelist::addToSortColumns' def sortByColumn_with_event_generate(idx) @@ -1053,7 +1053,7 @@ class << Tk::Tcllib::Tablelist else gmt = None end - Tk.tk_call('::tablelist::addDateTimeMentry', + Tk.tk_call('::tablelist::addDateTimeMentry', format, date_sep, time_sep, gmt, name) end diff --git a/ext/tk/lib/tkextlib/tile/sizegrip.rb b/ext/tk/lib/tkextlib/tile/sizegrip.rb index d7da0a4075..9947e0d870 100644 --- a/ext/tk/lib/tkextlib/tile/sizegrip.rb +++ b/ext/tk/lib/tkextlib/tile/sizegrip.rb @@ -28,5 +28,5 @@ end #Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Sizegrip, # :TkSizegrip, :TkSizeGrip) Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/sizegrip.rb', - :Ttk, Tk::Tile::Sizegrip, + :Ttk, Tk::Tile::Sizegrip, :TkSizegrip, :TkSizeGrip) diff --git a/ext/tk/lib/tkextlib/tile/style.rb b/ext/tk/lib/tkextlib/tile/style.rb index f38deda503..108d81f88b 100644 --- a/ext/tk/lib/tkextlib/tile/style.rb +++ b/ext/tk/lib/tkextlib/tile/style.rb @@ -295,7 +295,7 @@ class << Tk::Tile::Style fail ArgumentError, "too many arguments" unless args.empty? # define a Microsoft Visual Styles element - tk_call(TkCommandNames[0], 'element', 'create', name, 'vsapi', + tk_call(TkCommandNames[0], 'element', 'create', name, 'vsapi', class_name, part_id, state_map, opts) end diff --git a/ext/tk/sample/editable_listbox.rb b/ext/tk/sample/editable_listbox.rb index 7a9ad4450b..890aec032e 100644 --- a/ext/tk/sample/editable_listbox.rb +++ b/ext/tk/sample/editable_listbox.rb @@ -27,7 +27,7 @@ class Tk::RbWidget::Editable_Listbox < TkListbox if idx = @ebox.pos see(idx) if bbox(idx).empty? @ebox.focus(true) - end + end } } diff --git a/ext/tk/sample/menubar3.rb b/ext/tk/sample/menubar3.rb index 129cfd779b..4f42f81c88 100644 --- a/ext/tk/sample/menubar3.rb +++ b/ext/tk/sample/menubar3.rb @@ -58,7 +58,7 @@ layout_proc = proc{|parent, mbtn| =end menubar = TkMenubar.new(nil, menu_spec, - 'layout_proc'=>layout_proc, + 'layout_proc'=>layout_proc, 'tearoff'=>false, 'foreground'=>'grey40', 'activeforeground'=>'red', diff --git a/ext/tk/sample/safe-tk.rb b/ext/tk/sample/safe-tk.rb index 2aeae235df..38131c0155 100644 --- a/ext/tk/sample/safe-tk.rb +++ b/ext/tk/sample/safe-tk.rb @@ -87,7 +87,7 @@ if false && Object.const_defined?(:RubyVM) && ::RubyVM.class == Class Thread.new(l, &y).value }).pack(:fill=>:x, :padx=>5) else - # KNOWN BUG:: + # KNOWN BUG:: # Current multi-tk.rb cannot support long term threads on callbacks. # Such a thread freezes the Ruby/Tk process. end diff --git a/ext/tk/sample/scrollframe.rb b/ext/tk/sample/scrollframe.rb index 6a9381d465..e340e1da3c 100644 --- a/ext/tk/sample/scrollframe.rb +++ b/ext/tk/sample/scrollframe.rb @@ -209,7 +209,7 @@ end # test if __FILE__ == $0 - f = Tk::RbWidget::ScrollFrame.new(:scrollbarwidth=>10, + f = Tk::RbWidget::ScrollFrame.new(:scrollbarwidth=>10, :width=>300, :height=>200) f.pack(:expand=>true, :fill=>:both) @@ -234,13 +234,13 @@ if __FILE__ == $0 # remove a vertical scrollbar, and then the scrollframe is not scrollable. Tk.after(6000){ f.vscroll(false) } - # add a vertical scrollbar, and make the scrollframe scrollable. + # add a vertical scrollbar, and make the scrollframe scrollable. Tk.after(9000){ f.vscroll(true) } # remove a horizontal scrollbar, and then the scrollframe is not scrollable. Tk.after(12000){ f.hscroll(false) } - # add a horizontal scrollbar, and make the scrollframe scrollable. + # add a horizontal scrollbar, and make the scrollframe scrollable. Tk.after(15000){ f.hscroll(true) } Tk.mainloop diff --git a/ext/tk/sample/tkalignbox.rb b/ext/tk/sample/tkalignbox.rb index fb1b58f458..f3d083c33d 100644 --- a/ext/tk/sample/tkalignbox.rb +++ b/ext/tk/sample/tkalignbox.rb @@ -201,20 +201,20 @@ if __FILE__ == $0 TkButton.new(f, :text=>'aaa'), TkButton.new(f, :text=>'aaaa')) - f = Tk::RbWidget::VBox.new(:borderwidth=>5, + f = Tk::RbWidget::VBox.new(:borderwidth=>5, :relief=>'groove').pack(:fill=>:y, :expand=>true) f.add(TkButton.new(f, :text=>'a'), TkButton.new(f, :text=>'aa', :font=>'Helvetica 30'), TkButton.new(f, :text=>'aaa'), TkButton.new(f, :text=>'aaaa')) - f = Tk::RbWidget::HRBox.new(:borderwidth=>3, + f = Tk::RbWidget::HRBox.new(:borderwidth=>3, :relief=>'raised').pack(:fill=>:x) f.add(TkButton.new(f, :text=>'a'), TkButton.new(f, :text=>'aa'), TkButton.new(f, :text=>'aaa')) - f = Tk::RbWidget::VBBox.new(:borderwidth=>3, + f = Tk::RbWidget::VBBox.new(:borderwidth=>3, :relief=>'ridge').pack(:fill=>:x) f.propagate = false f.height 100 diff --git a/ext/tk/sample/tkballoonhelp.rb b/ext/tk/sample/tkballoonhelp.rb index a9c00d230d..2daa522601 100644 --- a/ext/tk/sample/tkballoonhelp.rb +++ b/ext/tk/sample/tkballoonhelp.rb @@ -64,8 +64,8 @@ class Tk::RbWidget::BalloonHelp'bisque').pack - @label = TkLabel.new(@frame, - 'foreground'=>DEFAULT_FOREGROUND, + @label = TkLabel.new(@frame, + 'foreground'=>DEFAULT_FOREGROUND, 'background'=>DEFAULT_BACKGROUND).pack @label.configure(_symbolkey2str(keys)) unless keys.empty? @path = @label @@ -147,7 +147,7 @@ if __FILE__ == $0 } TkButton.new('text'=>'This button has another balloon help') {|b| pack('fill'=>'x') - Tk::RbWidget::BalloonHelp.new(b, + Tk::RbWidget::BalloonHelp.new(b, 'text'=>"CONFIGURED MESSAGE\nchange colors, and so on", 'interval'=>200, 'font'=>'courier', 'background'=>'gray', 'foreground'=>'red') diff --git a/ext/tk/sample/tkcombobox.rb b/ext/tk/sample/tkcombobox.rb index 59db565f06..c38bde10d4 100644 --- a/ext/tk/sample/tkcombobox.rb +++ b/ext/tk/sample/tkcombobox.rb @@ -370,7 +370,7 @@ EOD startwait = keys.delete('startwait'){300} interval = keys.delete('interval'){150} - @lst = Tk::RbWidget::AutoScrollListbox.new(@top, :scrollbar=>true, + @lst = Tk::RbWidget::AutoScrollListbox.new(@top, :scrollbar=>true, :startwait=>startwait, :interval=>interval) @lst.pack(:fill=>:both, :expand=>true) @@ -464,7 +464,7 @@ if __FILE__ == $0 # e0.values(%w(aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp qq rr ss tt uu)) v = TkVariable.new - e = Tk::RbWidget::Combobox.new(:height=>7, :scrollbar=>true, + e = Tk::RbWidget::Combobox.new(:height=>7, :scrollbar=>true, :textvariable=>v, :arrowrelief=>:flat, :arrowborderwidth=>0, :startwait=>400, :interval=>200).pack @@ -480,9 +480,9 @@ if __FILE__ == $0 TkFrame.new(:relief=>:raised, :borderwidth=>2, :height=>3).pack(:fill=>:x, :expand=>true, :padx=>5, :pady=>3) - l = Tk::RbWidget::AutoScrollListbox.new(nil, :relief=>:groove, - :borderwidth=>4,:height=>7, - :width=>20).pack(:fill=>:both, + l = Tk::RbWidget::AutoScrollListbox.new(nil, :relief=>:groove, + :borderwidth=>4,:height=>7, + :width=>20).pack(:fill=>:both, :expand=>true) (0..20).each{|i| l.insert('end', "line #{i}")} diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c index 4b02fdd728..dd475c3455 100644 --- a/ext/tk/stubs.c +++ b/ext/tk/stubs.c @@ -334,7 +334,7 @@ ruby_tk_stubs_init(tcl_ip) FIX ME : dirty hack for Mac OS X frameworks. With stubs, fails to find Resource/Script directory of Tk.framework. So, teach it to a Tcl interpreter by an environment variable. - e.g. when $tcl_library == + e.g. when $tcl_library == /Library/Frameworks/Tcl.framwwork/8.5/Resources/Scripts ==> /Library/Frameworks/Tk.framwwork/8.5/Resources/Scripts */ diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c index 5135dfa8db..aecd90302c 100644 --- a/ext/tk/tcltklib.c +++ b/ext/tk/tcltklib.c @@ -950,7 +950,7 @@ Tcl_AppInitProc Dde_Init, Dde_SafeInit, Registry_Init; static char *rubytk_kitpath = NULL; -static char rubytkkit_preInitCmd[] = +static char rubytkkit_preInitCmd[] = "proc tclKitPreInit {} {\n" "rename tclKitPreInit {}\n" "load {} rubytk_kitpath\n" @@ -1009,7 +1009,7 @@ static char rubytkkit_preInitCmd[] = ; #if 0 -/* Not use this script. +/* Not use this script. It's a memo to support an initScript for Tcl interpreters in the future. */ static const char initScript[] = "if {[file isfile [file join $::tcl::kitpath main.tcl]]} {\n" @@ -1179,8 +1179,8 @@ static int call_tclkit_init_script(Tcl_Interp *interp) { #if 0 - /* Currently, do nothing in this function. - It's a memo (quoted from kitInit.c of Tclkit) + /* Currently, do nothing in this function. + It's a memo (quoted from kitInit.c of Tclkit) to support an initScript for Tcl interpreters in the future. */ if (Tcl_EvalEx(interp, initScript, -1, TCL_EVAL_GLOBAL) == TCL_OK) { const char *encoding = NULL; @@ -1247,7 +1247,7 @@ setup_rubytkkit() /* rbtk_win32_SetHINSTANCE("tcltklib.so"); */ { volatile VALUE basename; - basename = rb_funcall(rb_cFile, rb_intern("basename"), 1, + basename = rb_funcall(rb_cFile, rb_intern("basename"), 1, rb_str_new2(rb_sourcefile())); rbtk_win32_SetHINSTANCE(RSTRING_PTR(basename)); } diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index d308db75e7..acc2fea39d 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -24,7 +24,7 @@ ((__GNUC__ <= 3) && (__GNUC_MINOR__ < 4)) || \ ((__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4))) -#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) +#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) #ifndef NONAMELESSUNION #define NONAMELESSUNION 1 #endif @@ -56,13 +56,13 @@ #define DOUTI(x) fprintf(stderr, "[%ld]:" #x "=%d\n",__LINE__,x) #define DOUTD(x) fprintf(stderr, "[%d]:" #x "=%f\n",__LINE__,x) -#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) +#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) #define V_UNION1(X, Y) ((X)->u.Y) #else #define V_UNION1(X, Y) ((X)->Y) #endif -#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) +#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) #undef V_UNION #define V_UNION(X,Y) ((X)->n1.n2.n3.Y) @@ -1105,7 +1105,7 @@ ole_hresult2msg(HRESULT hr) dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, hr, + NULL, hr, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (LPTSTR)&p_msg, 0, NULL); if (dwCount == 0) { diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 7a595e32ee..c41e4e29eb 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -219,7 +219,7 @@ static VALUE rb_gzreader_each(int, VALUE*, VALUE); static VALUE rb_gzreader_readlines(int, VALUE*, VALUE); #endif /* GZIP_SUPPORT */ -/* +/* * Document-module: Zlib * * == Overview @@ -227,7 +227,7 @@ static VALUE rb_gzreader_readlines(int, VALUE*, VALUE); * Access to the zlib library. * * == Class tree - * + * * - Zlib::Deflate * - Zlib::Inflate * - Zlib::ZStream @@ -1264,7 +1264,7 @@ rb_deflate_s_allocate(VALUE klass) * filter (or predictor), HUFFMAN_ONLY to force Huffman encoding only (no * string match). * - * == Description + * == Description * * Creates a new deflate stream for compression. See zlib.h for details of * each argument. If an argument is nil, the default value of that argument is @@ -1276,14 +1276,14 @@ rb_deflate_s_allocate(VALUE klass) * === basic * * f = File.new("compressed.file","w+") - * #=> # + * #=> # * f << Zlib::Deflate.new().deflate(File.read("big.file")) - * #=> # + * #=> # * f.close - * #=> nil + * #=> nil * * === a little more robust - * + * * compressed_file = File.open("compressed.file", "w+") * #=> # * zd = Zlib::Deflate.new(Zlib::BEST_COMPRESSION, 15, Zlib::MAX_MEM_LEVEL, Zlib::HUFFMAN_ONLY) @@ -1423,7 +1423,7 @@ do_deflate(struct zstream *z, VALUE src, int flush) * call-seq: deflate(string[, flush]) * * == Arguments - * + * * +string+:: * String * @@ -1446,7 +1446,7 @@ do_deflate(struct zstream *z, VALUE src, int flush) * == Usage * * comp = Zlib.deflate(File.read("big.file")) - * or + * or * comp = Zlib.deflate(File.read("big.file"), Zlib::FULL_FLUSH) * */ @@ -1611,7 +1611,7 @@ rb_inflate_s_allocate(VALUE klass) } /* - * Document-method: Zlib::Inflate.new + * Document-method: Zlib::Inflate.new * * call-seq: Zlib::Inflate.new(window_bits) * @@ -1639,7 +1639,7 @@ rb_inflate_s_allocate(VALUE klass) * zi.close * cf.close * - * or + * or * * File.open("compressed.file") {|cf| * zi = Zlib::Inflate.new @@ -4027,13 +4027,13 @@ Init_zlib() rb_define_method(cZStream, "flush_next_out", rb_zstream_flush_next_out, 0); /* Integer representing date types which - * ZStream#data_type method returns */ + * ZStream#data_type method returns */ rb_define_const(mZlib, "BINARY", INT2FIX(Z_BINARY)); /* Integer representing date types which - * ZStream#data_type method returns */ + * ZStream#data_type method returns */ rb_define_const(mZlib, "ASCII", INT2FIX(Z_ASCII)); /* Integer representing date types which - * ZStream#data_type method returns */ + * ZStream#data_type method returns */ rb_define_const(mZlib, "UNKNOWN", INT2FIX(Z_UNKNOWN)); cDeflate = rb_define_class_under(mZlib, "Deflate", cZStream); @@ -4317,7 +4317,7 @@ Init_zlib() * * Subclass of Zlib::Error * - * When zlib returns a Z_STREAM_ERROR, + * When zlib returns a Z_STREAM_ERROR, * usually if the stream state was inconsistent. * */ diff --git a/include/ruby/win32.h b/include/ruby/win32.h index 13e01a4365..4a56895a84 100644 --- a/include/ruby/win32.h +++ b/include/ruby/win32.h @@ -274,7 +274,7 @@ extern char **rb_w32_get_environ(void); extern void rb_w32_free_environ(char **); extern int rb_w32_map_errno(DWORD); extern char * WSAAPI rb_w32_inet_ntop(int,void *,char *,size_t); -extern DWORD rb_w32_osver(void); +extern DWORD rb_w32_osver(void); extern int chown(const char *, int, int); extern int rb_w32_uchown(const char *, int, int); diff --git a/io.c b/io.c index 86685afc58..925bfd4ea0 100644 --- a/io.c +++ b/io.c @@ -7795,7 +7795,7 @@ rb_io_fcntl(int argc, VALUE *argv, VALUE io) * +String+ objects or +Integer+ objects. A +String+ object is passed * as a pointer to the byte sequence. An +Integer+ object is passed * as an integer whose bit size is same as a pointer. - * Up to nine parameters may be passed (14 on the Atari-ST). + * Up to nine parameters may be passed (14 on the Atari-ST). * * The function identified by _num_ is system * dependent. On some Unix systems, the numbers may be obtained from a @@ -7854,7 +7854,7 @@ rb_f_syscall(int argc, VALUE *argv) int num, retval = -1; #endif int i; - + if (RTEST(ruby_verbose)) { rb_warning("We plan to remove a syscall function at future release. DL(Fiddle) provides safer alternative."); } diff --git a/lib/erb.rb b/lib/erb.rb index 5a5af10230..0ddaa5000d 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -266,7 +266,7 @@ end # ERB::Compiler class ERB # = ERB::Compiler - # + # # Compiles ERB templates into Ruby code; the compiled code produces the # template result when evaluated. ERB::Compiler provides hooks to define how # generated output is handled. @@ -308,7 +308,7 @@ class ERB # # obj = 'It' # eval code - # + # # Evaluate using an input: # # mod = Module.new diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index ee5cf69409..3f161a2ff7 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -154,7 +154,7 @@ module IRB begin candidates = [] rec = eval(receiver, bind) - if sep == "::" and rec.kind_of?(Module) + if sep == "::" and rec.kind_of?(Module) candidates = rec.constants.collect{|m| m.to_s} end candidates |= rec.methods.collect{|m| m.to_s} diff --git a/lib/irb/init.rb b/lib/irb/init.rb index 2d7ff3146e..fce2df4f09 100644 --- a/lib/irb/init.rb +++ b/lib/irb/init.rb @@ -112,9 +112,9 @@ module IRB # @CONF[:LC_MESSAGES] = "en" @CONF[:LC_MESSAGES] = Locale.new - + @CONF[:AT_EXIT] = [] - + @CONF[:DEBUG_LEVEL] = 1 end @@ -160,7 +160,7 @@ module IRB opt = $1 || ARGV.shift set_encoding(*opt.split(':', 2)) when "--inspect" - if /^-/ !~ ARGV.first + if /^-/ !~ ARGV.first @CONF[:INSPECT_MODE] = ARGV.shift else @CONF[:INSPECT_MODE] = true diff --git a/lib/irb/inspector.rb b/lib/irb/inspector.rb index ab5128399e..aefe077f37 100644 --- a/lib/irb/inspector.rb +++ b/lib/irb/inspector.rb @@ -7,7 +7,7 @@ # # -- # -# +# # module IRB @@ -57,13 +57,13 @@ module IRB # else # inspector = IRB::Inspector(block, init_p) # end - + if block_given? inspector = IRB::Inspector(block, arg) else inspector = arg end - + case key when Array for k in key @@ -81,7 +81,7 @@ module IRB end INSPECTORS.def_inspector([false, :to_s, :raw]){|v| v.to_s} - INSPECTORS.def_inspector([true, :p, :inspect]){|v| + INSPECTORS.def_inspector([true, :p, :inspect]){|v| begin v.inspect rescue NoMethodError @@ -89,7 +89,7 @@ module IRB end } INSPECTORS.def_inspector([:pp, :pretty_inspect], proc{require "pp"}){|v| v.pretty_inspect.chomp} - INSPECTORS.def_inspector([:yaml, :YAML], proc{require "yaml"}){|v| + INSPECTORS.def_inspector([:yaml, :YAML], proc{require "yaml"}){|v| begin YAML.dump(v) rescue @@ -98,12 +98,12 @@ module IRB end } - INSPECTORS.def_inspector([:marshal, :Marshal, :MARSHAL, Marshal]){|v| + INSPECTORS.def_inspector([:marshal, :Marshal, :MARSHAL, Marshal]){|v| Marshal.dump(v) } end - - + + diff --git a/lib/irb/locale.rb b/lib/irb/locale.rb index 77cc06ed30..7781006da4 100644 --- a/lib/irb/locale.rb +++ b/lib/irb/locale.rb @@ -136,7 +136,7 @@ module IRB end # @param paths load paths in which IRB find a localized file. - # @param dir directory + # @param dir directory # @param file basename to be localized # # typically, for the parameters and a in paths, it searches diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index 30fecf7033..2414e5cffd 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -1100,7 +1100,7 @@ class RubyLex @indent = 0 @indent_stack = [] @lex_state = EXPR_BEG - + loop do @continue = false prompt @@ -1119,7 +1119,7 @@ class RubyLex @quoted = reserve_quoted end end - + def identify_comment @ltype = "#" diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 8e42483ddb..e66608f21a 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -601,7 +601,7 @@ int main() {printf("%d\\n", conftest_const); return 0;} end # You should use +have_func+ rather than +try_func+. -# +# # [+func+] a String which contains a symbol name # [+libs+] a String which contains library names. # [+headers+] a String or an Array of strings which contains @@ -691,7 +691,7 @@ def macro_defined?(macro, src, opt = "", &b) SRC end -# Returns whether or not +# Returns whether or not # * the +src+ can be compiled as a C source, # * the result object can be linked with its depending libraries successfully, # * the linked file can be invoked as an executable @@ -1754,7 +1754,7 @@ end # Processes the data contents of the "depend" file. # Each line of this file is expected to be a file name. -# +# # Returns the output of findings, in Makefile format. # def depend_rules(depend) diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 0b76a9ff4a..9a815d5678 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -313,7 +313,7 @@ module Net @receiver_thread.join synchronize do unless @sock.closed? - @sock.close + @sock.close end end raise e if e diff --git a/lib/rdoc/markup/formatter_test_case.rb b/lib/rdoc/markup/formatter_test_case.rb index dd755c55d1..26dc4b25e9 100644 --- a/lib/rdoc/markup/formatter_test_case.rb +++ b/lib/rdoc/markup/formatter_test_case.rb @@ -90,7 +90,7 @@ class RDoc::Markup::FormatterTestCase < MiniTest::Unit::TestCase ## # Calls start_accepting which needs to verify startup state - + def test_start_accepting @to.start_accepting @@ -100,7 +100,7 @@ class RDoc::Markup::FormatterTestCase < MiniTest::Unit::TestCase ## # Calls end_accepting on your test case which needs to call # @to.end_accepting and verify document generation - + def test_end_accepting @to.start_accepting @to.res << 'hi' @@ -196,7 +196,7 @@ class RDoc::Markup::FormatterTestCase < MiniTest::Unit::TestCase @to.start_accepting @to.accept_heading @RM::Heading.new(1, '\\Hello') - + accept_heading_suppressed_crossref end diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb index 4644324fc7..b2559fa3a9 100644 --- a/lib/rdoc/parser.rb +++ b/lib/rdoc/parser.rb @@ -185,7 +185,7 @@ class RDoc::Parser end ## - # Creates a new Parser storing +top_level+, +file_name+, +content+, + # Creates a new Parser storing +top_level+, +file_name+, +content+, # +options+ and +stats+ in instance variables. # # Usually invoked by +super+ diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index 6bf1c8d308..4d273598be 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -1560,7 +1560,7 @@ class RDoc::Parser::Ruby < RDoc::Parser else new_methods = [] - case vis_type + case vis_type when 'module_function' then args = parse_symbol_arg container.set_visibility_for args, :private, false diff --git a/lib/rdoc/ruby_lex.rb b/lib/rdoc/ruby_lex.rb index 60d4a4c76b..13e86728c9 100644 --- a/lib/rdoc/ruby_lex.rb +++ b/lib/rdoc/ruby_lex.rb @@ -407,7 +407,7 @@ class RDoc::RubyLex (ch = getc) res << ch end - + gets # consume =end @ltype = nil diff --git a/lib/rubygems/commands/server_command.rb b/lib/rubygems/commands/server_command.rb index 0d18a82201..c59f216262 100644 --- a/lib/rubygems/commands/server_command.rb +++ b/lib/rubygems/commands/server_command.rb @@ -50,7 +50,7 @@ class Gem::Commands::ServerCommand < Gem::Command options[:addresses].push(*address) end - add_option '-l', '--launch[=COMMAND]', + add_option '-l', '--launch[=COMMAND]', 'launches a browser window', "COMMAND defaults to 'start' on Windows", "and 'open' on all other platforms" do |launch, options| diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb index 29d5af5b12..2a147d59f2 100644 --- a/lib/rubygems/ext/builder.rb +++ b/lib/rubygems/ext/builder.rb @@ -19,7 +19,7 @@ class Gem::Ext::Builder def self.make(dest_path, results) unless File.exist? 'Makefile' then - raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}" + raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}" end mf = File.read('Makefile') diff --git a/lib/rubygems/package/tar_writer.rb b/lib/rubygems/package/tar_writer.rb index aeb11ad6ce..823f20c88c 100644 --- a/lib/rubygems/package/tar_writer.rb +++ b/lib/rubygems/package/tar_writer.rb @@ -236,7 +236,7 @@ class Gem::Package::TarWriter name = newname if name.size > 100 or prefix.size > 155 then - raise Gem::Package::TooLongFileName + raise Gem::Package::TooLongFileName end end diff --git a/lib/set.rb b/lib/set.rb index 99197961b5..226641d725 100755 --- a/lib/set.rb +++ b/lib/set.rb @@ -482,35 +482,35 @@ class Set end end -# +# # SortedSet implements a Set that guarantees that it's element are # yielded in sorted order (according to the return values of their # #<=> methods) when iterating over them. -# +# # All elements that are added to a SortedSet must respond to the <=> # method for comparison. -# +# # Also, all elements must be mutually comparable: el1 <=> # el2 must not return nil for any elements el1 # and el2, else an ArgumentError will be raised when # iterating over the SortedSet. # # == Example -# +# # require "set" -# +# # set = SortedSet.new([2, 1, 5, 6, 4, 5, 3, 3, 3]) # ary = [] -# +# # set.each do |obj| # ary << obj # end -# +# # p ary # => [1, 2, 3, 4, 5, 6] -# +# # set2 = SortedSet.new([1, 2, "3"]) # set2.each { |obj| } # => raises ArgumentError: comparison of Fixnum with String failed -# +# class SortedSet < Set @@setup = false @@ -535,7 +535,7 @@ class SortedSet < Set @hash = RBTree.new super end - + def add(o) o.respond_to?(:<=>) or raise ArgumentError, "value must respond to <=>" super diff --git a/lib/thwait.rb b/lib/thwait.rb index 963ff4d1b6..4a98c1cbba 100644 --- a/lib/thwait.rb +++ b/lib/thwait.rb @@ -19,10 +19,10 @@ require "e2mmap.rb" # STDERR.puts "Thread #{t} has terminated." # end # -# +# # th = ThreadsWait.new(thread1,...) # th.next_wait # next one to be done -# +# # class ThreadsWait RCS_ID='-$Id: thwait.rb,v 1.3 1998/06/26 03:19:34 keiju Exp keiju $-' diff --git a/lib/tracer.rb b/lib/tracer.rb index 318b254ac8..d1e088b90e 100644 --- a/lib/tracer.rb +++ b/lib/tracer.rb @@ -1,11 +1,11 @@ -# tracer.rb - +# tracer.rb - # $Release Version: 0.3$ # $Revision: 1.12 $ # by Keiju ISHITSUKA(keiju@ishitsuka.com) # # -- # -# +# # require "thread" @@ -136,7 +136,7 @@ class Tracer return unless p.call event, file, line, id, binding, klass end - return unless Tracer::display_c_call? or + return unless Tracer::display_c_call? or event != "c-call" && event != "c-return" Tracer::stdout_mutex.synchronize do @@ -151,7 +151,7 @@ class Tracer printf("%s:%d:%s:%s: %s", file, line, - klass || '', + klass || '', EVENT_SYMBOL[event], source) end diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 8d4e8c6d41..56c6946f28 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -10,9 +10,9 @@ # module URI - # + # # Includes URI::REGEXP::PATTERN - # + # module REGEXP # # Patterns used to parse URI's @@ -111,7 +111,7 @@ module URI # see also URI::Parser.initialize_pattern attr_reader :pattern - # The Hash of Regexp + # The Hash of Regexp # # see also URI::Parser.initialize_regexp attr_reader :regexp @@ -197,7 +197,7 @@ module URI # # == Description # - # parses +uri+ and constructs either matching URI scheme object + # parses +uri+ and constructs either matching URI scheme object # (FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or URI::Generic # # == Usage @@ -237,7 +237,7 @@ module URI uris.inject :merge end - # + # # :call-seq: # extract( str ) # extract( str, schemes ) @@ -279,7 +279,7 @@ module URI end end - # + # # :call-seq: # escape( str ) # escape( str, unsafe ) @@ -311,7 +311,7 @@ module URI end.force_encoding(Encoding::US_ASCII) end - # + # # :call-seq: # unescape( str ) # unescape( str, unsafe ) diff --git a/lib/uri/ftp.rb b/lib/uri/ftp.rb index 53e3b28645..26e4bb8326 100644 --- a/lib/uri/ftp.rb +++ b/lib/uri/ftp.rb @@ -151,7 +151,7 @@ module URI end end - # typecode accessor + # typecode accessor # # see URI::FTP::COMPONENT attr_reader :typecode diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb index 1bf4bcb080..bd5594fc3c 100644 --- a/lib/uri/generic.rb +++ b/lib/uri/generic.rb @@ -251,7 +251,7 @@ module URI # returns the port component of the URI. # # URI("http://foo/bar/baz").port #=> "80" - # + # # URI("http://foo:8080/bar/baz").port #=> "8080" # attr_reader :port @@ -265,13 +265,13 @@ module URI # returns the path component of the URI. # # URI("http://foo/bar/baz").path #=> "/bar/baz" - # + # attr_reader :path # returns the query component of the URI. # # URI("http://foo/bar/baz?search=FooBar").query #=> "search=FooBar" - # + # attr_reader :query # returns the opaque part of the URI. @@ -287,7 +287,7 @@ module URI # returns the fragment component of the URI. # # URI("http://foo/bar/baz?search=FooBar#ponies").fragment #=> "ponies" - # + # attr_reader :fragment # returns the parser to be used. @@ -518,7 +518,7 @@ module URI # (with validation) # # see also URI::Generic.userinfo= - # + # def set_userinfo(user, password = nil) unless password user, password = split_userinfo(user) @@ -1081,7 +1081,7 @@ module URI end private :split_path - # + # # Merges a base path +base+, with relative path +rel+, # returns a modified base path. # diff --git a/lib/webrick/httpservlet/filehandler.rb b/lib/webrick/httpservlet/filehandler.rb index 263c9fc80f..8736f5773a 100644 --- a/lib/webrick/httpservlet/filehandler.rb +++ b/lib/webrick/httpservlet/filehandler.rb @@ -151,7 +151,7 @@ module WEBrick # at directory +root+ # # If +options+ is a Hash the following keys are allowed: - # + # # :AcceptableLanguages:: Array of languages allowed for accept-language # :DirectoryCallback:: Allows preprocessing of directory requests # :FancyIndexing:: If true, show an index for directories @@ -166,7 +166,7 @@ module WEBrick # # If +options+ is true or false then +:FancyIndexing+ is enabled or # disabled respectively. - + def initialize(server, root, options={}, default=Config::FileHandler) @config = server.config @logger = @config[:Logger] diff --git a/lib/yaml/dbm.rb b/lib/yaml/dbm.rb index 3801565ff8..07441f53ad 100644 --- a/lib/yaml/dbm.rb +++ b/lib/yaml/dbm.rb @@ -4,7 +4,7 @@ require 'dbm' module YAML # YAML + DBM = YDBM -# +# # YAML::DBM provides the same interface as ::DBM. # # However, while DBM only allows strings for both keys and values, @@ -199,7 +199,7 @@ class DBM < ::DBM a end - + # Converts the contents of the database to an in-memory Hash object, and # returns it. def to_hash diff --git a/missing/alloca.c b/missing/alloca.c index d23917f3f7..efc1a77dff 100644 --- a/missing/alloca.c +++ b/missing/alloca.c @@ -6,7 +6,7 @@ This implementation of the PWB library alloca() function, which is used to allocate space off the run-time stack so - that it is automatically reclaimed upon procedure exit, + that it is automatically reclaimed upon procedure exit, was inspired by discussions with J. Q. Johnson of Cornell. It should work under any C implementation that uses an diff --git a/missing/flock.c b/missing/flock.c index b02f8bf832..763c49d675 100644 --- a/missing/flock.c +++ b/missing/flock.c @@ -27,7 +27,7 @@ int flock(int fd, int operation) { struct flock lock; - + switch (operation & ~LOCK_NB) { case LOCK_SH: lock.l_type = F_RDLCK; @@ -44,7 +44,7 @@ flock(int fd, int operation) } lock.l_whence = SEEK_SET; lock.l_start = lock.l_len = 0L; - + return fcntl(fd, (operation & LOCK_NB) ? F_SETLK : F_SETLKW, &lock); } diff --git a/missing/isinf.c b/missing/isinf.c index 4aef51b213..55187adc63 100644 --- a/missing/isinf.c +++ b/missing/isinf.c @@ -27,7 +27,7 @@ isinf(double n) #include #endif -/* +/* * isinf may be provided only as a macro. * ex. HP-UX, Solaris 10 * http://www.gnu.org/software/automake/manual/autoconf/Function-Portability.html diff --git a/missing/langinfo.c b/missing/langinfo.c index 143ee0e820..9ba06b15f6 100644 --- a/missing/langinfo.c +++ b/missing/langinfo.c @@ -65,7 +65,7 @@ nl_langinfo_codeset(void) { const char *l, *p; int n; - + if (((l = getenv("LC_ALL")) && *l) || ((l = getenv("LC_CTYPE")) && *l) || ((l = getenv("LANG")) && *l)) { diff --git a/missing/os2.c b/missing/os2.c index 3448cdc281..27dc2f1964 100644 --- a/missing/os2.c +++ b/missing/os2.c @@ -94,14 +94,14 @@ char *cmd; if (*s == '=') goto doshell; */ for (s = cmd; *s; s++) { - if (*sw == '-' && *s != ' ' && + if (*sw == '-' && *s != ' ' && !isalpha(*s) && index("$&*(){}[]'\";\\|?<>~`\n",*s)) { if (*s == '\n' && !s[1]) { *s = '\0'; break; } goto doshell; - } else if (*sw == '/' && *s != ' ' && + } else if (*sw == '/' && *s != ' ' && !isalpha(*s) && index("^()<>|&\n",*s)) { if (*s == '\n' && !s[1]) { *s = '\0'; diff --git a/numeric.c b/numeric.c index 82f0447f33..a02dfd3974 100644 --- a/numeric.c +++ b/numeric.c @@ -572,7 +572,7 @@ num_to_int(VALUE num) * * Floating point has a different arithmetic and is a inexact number. * So you should know its esoteric system. see following: - * + * * - http://docs.sun.com/source/806-3568/ncg_goldberg.html * - http://wiki.github.com/rdp/ruby_tutorials_core/ruby-talk-faq#floats_imprecise * - http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems diff --git a/pack.c b/pack.c index e8c5f391ba..1616a8a638 100644 --- a/pack.c +++ b/pack.c @@ -328,7 +328,7 @@ static unsigned long utf8_to_uv(const char*,long*); * | | * U | Integer | UTF-8 character * w | Integer | BER-compressed integer - * + * * Float | | * Directive | | Meaning * --------------------------------------------------------------------------- @@ -338,7 +338,7 @@ static unsigned long utf8_to_uv(const char*,long*); * e | Float | single-precision, little-endian byte order * G | Float | double-precision, network (big-endian) byte order * g | Float | single-precision, network (big-endian) byte order - * + * * String | | * Directive | | Meaning * --------------------------------------------------------------------------- @@ -355,7 +355,7 @@ static unsigned long utf8_to_uv(const char*,long*); * | | (if count is 0, no line feed are added, see RFC 4648) * P | String | pointer to a structure (fixed-length string) * p | String | pointer to a null-terminated string - * + * * Misc. | | * Directive | | Meaning * --------------------------------------------------------------------------- @@ -1280,7 +1280,7 @@ infected_str_new(const char *ptr, long len, VALUE str) * | | * U | Integer | UTF-8 character * w | Integer | BER-compressed integer (see Array.pack) - * + * * Float | | * Directive | Returns | Meaning * ----------------------------------------------------------------- @@ -1290,7 +1290,7 @@ infected_str_new(const char *ptr, long len, VALUE str) * e | Float | single-precision, little-endian byte order * G | Float | double-precision, network (big-endian) byte order * g | Float | single-precision, network (big-endian) byte order - * + * * String | | * Directive | Returns | Meaning * ----------------------------------------------------------------- @@ -1307,7 +1307,7 @@ infected_str_new(const char *ptr, long len, VALUE str) * | | base64 encoded string (RFC 4648) if followed by 0 * P | String | pointer to a structure (fixed-length string) * p | String | pointer to a null-terminated string - * + * * Misc. | | * Directive | Returns | Meaning * ----------------------------------------------------------------- diff --git a/prelude.rb b/prelude.rb index 04bf85044b..4b6ab1a677 100644 --- a/prelude.rb +++ b/prelude.rb @@ -19,7 +19,7 @@ class Thread # call-seq: # Thread.exclusive { block } => obj - # + # # Wraps a block in Thread.critical, restoring the original value # upon exit from the critical section, and returns the value of the # block. diff --git a/random.c b/random.c index ab9e42918f..cb3de6e7eb 100644 --- a/random.c +++ b/random.c @@ -1203,7 +1203,7 @@ random_equal(VALUE self, VALUE other) * range.member(number) == true. * * Or else converts _max_ to an integer using max1 = - * max.to_i.abs. + * max.to_i.abs. * * Then if _max_ is +nil+ the result is zero, returns a pseudorandom floating * point number greater than or equal to 0.0 and less than 1.0. diff --git a/sample/biorhythm.rb b/sample/biorhythm.rb index 7a8da7d124..bd7c39f5aa 100644 --- a/sample/biorhythm.rb +++ b/sample/biorhythm.rb @@ -1,13 +1,13 @@ #!/usr/local/bin/ruby # -# biorhythm.rb - +# biorhythm.rb - # $Release Version: $ # $Revision$ # by Yasuo OHBA(STAFS Development Room) # # -- # -# +# # # probably based on: @@ -91,7 +91,7 @@ display_period = options[:days] if ausgabeart == "v" print_header(bd.year, bd.month, bd.day, dd - bd, bd.strftime("%a")) print "\n" - + phys, emot, geist = get_position(dd - bd) printf "Biorhythm: %04d.%02d.%02d\n", dd.year, dd.month, dd.day printf "Physical: %d%%\n", phys @@ -104,10 +104,10 @@ else print " -------------------------+-------------------------\n" print " Bad Condition | Good Condition\n" print " -------------------------+-------------------------\n" - + (dd - bd).step(dd - bd + display_period) do |z| phys, emot, geist = get_position(z) - + printf "%04d.%02d.%02d : ", dd.year, dd.month, dd.day p = (phys / 2.0 + 0.5).to_i e = (emot / 2.0 + 0.5).to_i diff --git a/sample/drb/darray.rb b/sample/drb/darray.rb index 95ee01ff03..d2ac39513f 100644 --- a/sample/drb/darray.rb +++ b/sample/drb/darray.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- Array - Copyright (c) 1999-2001 Masatoshi SEKI + Copyright (c) 1999-2001 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/darrayc.rb b/sample/drb/darrayc.rb index b181d22699..579e11564e 100644 --- a/sample/drb/darrayc.rb +++ b/sample/drb/darrayc.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- Array client - Copyright (c) 1999-2001 Masatoshi SEKI + Copyright (c) 1999-2001 Masatoshi SEKI =end require 'drb/drb' @@ -19,7 +19,7 @@ p a puts "# find" p ro.find { |x| x.kind_of? String } - + puts "# each, break" ro.each do |x| next if x == "five" diff --git a/sample/drb/dbiff.rb b/sample/drb/dbiff.rb index 8faef50b07..b50edc0898 100644 --- a/sample/drb/dbiff.rb +++ b/sample/drb/dbiff.rb @@ -18,13 +18,13 @@ class Biff def run last = Time.now while true - begin + begin sleep(@interval) current = File::mtime(@filename) if current > last changed begin - notify_observers(@filename, current) + notify_observers(@filename, current) rescue Error end last = current diff --git a/sample/drb/dchatc.rb b/sample/drb/dchatc.rb index b506f5bbba..2b8ddbf4cc 100644 --- a/sample/drb/dchatc.rb +++ b/sample/drb/dchatc.rb @@ -1,12 +1,12 @@ =begin distributed Ruby --- chat client - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' class ChatClient - include DRbUndumped + include DRbUndumped def initialize(name) @name = name diff --git a/sample/drb/dchats.rb b/sample/drb/dchats.rb index 012dfeeebe..ccb2c7c9c5 100644 --- a/sample/drb/dchats.rb +++ b/sample/drb/dchats.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- chat server - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'thread' require 'drb/drb' diff --git a/sample/drb/dhasen.rb b/sample/drb/dhasen.rb index fb1724afa3..651b9c6c8a 100644 --- a/sample/drb/dhasen.rb +++ b/sample/drb/dhasen.rb @@ -1,13 +1,13 @@ =begin distributed Ruby --- dRuby Sample Server --- chasen server - Copyright (c) 1999-2001 Masatoshi SEKI + Copyright (c) 1999-2001 Masatoshi SEKI =end =begin How to play. Terminal 1 - | % ruby dhasen.rb + | % ruby dhasen.rb | druby://yourhost:7640 Terminal 2 diff --git a/sample/drb/dhasenc.rb b/sample/drb/dhasenc.rb index 2774feba5a..44e58ce096 100644 --- a/sample/drb/dhasenc.rb +++ b/sample/drb/dhasenc.rb @@ -1,7 +1,7 @@ # -*- encoding: euc-jp -*- =begin distributed Ruby --- dRuby Sample Client -- chasen client - Copyright (c) 1999-2001 Masatoshi SEKI + Copyright (c) 1999-2001 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/dlogc.rb b/sample/drb/dlogc.rb index c75bc7b520..3939a71827 100644 --- a/sample/drb/dlogc.rb +++ b/sample/drb/dlogc.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- Log test - Copyright (c) 1999-2001 Masatoshi SEKI + Copyright (c) 1999-2001 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/dlogd.rb b/sample/drb/dlogd.rb index 9f9aa2fd56..fef7ca0f1d 100644 --- a/sample/drb/dlogd.rb +++ b/sample/drb/dlogd.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- Log server - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/dqin.rb b/sample/drb/dqin.rb index 3ba1caa80c..4751335fff 100644 --- a/sample/drb/dqin.rb +++ b/sample/drb/dqin.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- store - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/dqout.rb b/sample/drb/dqout.rb index 4700e55cf7..f2b0b4ac95 100644 --- a/sample/drb/dqout.rb +++ b/sample/drb/dqout.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- fetch - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/dqueue.rb b/sample/drb/dqueue.rb index a5a43655fd..1c8878c080 100644 --- a/sample/drb/dqueue.rb +++ b/sample/drb/dqueue.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- Queue - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'thread' diff --git a/sample/drb/drbc.rb b/sample/drb/drbc.rb index 00132b46c8..50a86c39e8 100644 --- a/sample/drb/drbc.rb +++ b/sample/drb/drbc.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- dRuby Sample Client - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/drbch.rb b/sample/drb/drbch.rb index 495ff1c346..07fdcd5fae 100644 --- a/sample/drb/drbch.rb +++ b/sample/drb/drbch.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- dRuby Sample Client - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/drbm.rb b/sample/drb/drbm.rb index 74a15a4696..3390608cd1 100644 --- a/sample/drb/drbm.rb +++ b/sample/drb/drbm.rb @@ -1,13 +1,13 @@ =begin multiple DRbServer - Copyright (c) 1999-2002 Masatoshi SEKI + Copyright (c) 1999-2002 Masatoshi SEKI =end =begin How to play. Terminal 1 - | % ruby drbm.rb + | % ruby drbm.rb | druby://yourhost:7640 druby://yourhost:7641 Terminal 2 @@ -24,7 +24,7 @@ class Hoge def initialize(s) @str = s end - + def to_s @str end diff --git a/sample/drb/drbmc.rb b/sample/drb/drbmc.rb index c654fcea05..fd191401e6 100644 --- a/sample/drb/drbmc.rb +++ b/sample/drb/drbmc.rb @@ -1,6 +1,6 @@ =begin multiple DRbServer client - Copyright (c) 1999-2002 Masatoshi SEKI + Copyright (c) 1999-2002 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/drbs-acl.rb b/sample/drb/drbs-acl.rb index 151dd945d8..71c4f7bf42 100644 --- a/sample/drb/drbs-acl.rb +++ b/sample/drb/drbs-acl.rb @@ -1,13 +1,13 @@ =begin distributed Ruby --- dRuby Sample Server - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end =begin How to play. Terminal 1 - | % ruby drbs.rb + | % ruby drbs.rb | druby://yourhost:7640 Terminal 2 @@ -41,7 +41,7 @@ if __FILE__ == $0 acl = ACL.new(%w(deny all allow 192.168.1.* allow localhost)) - + DRb.install_acl(acl) DRb.start_service(nil, DRbEx.new) diff --git a/sample/drb/drbs.rb b/sample/drb/drbs.rb index b76e283c80..5a913d9918 100644 --- a/sample/drb/drbs.rb +++ b/sample/drb/drbs.rb @@ -1,13 +1,13 @@ =begin distributed Ruby --- dRuby Sample Server - Copyright (c) 1999-2000,2002 Masatoshi SEKI + Copyright (c) 1999-2000,2002 Masatoshi SEKI =end =begin How to play. Terminal 1 - | % ruby drbs.rb + | % ruby drbs.rb | druby://yourhost:7640 Terminal 2 diff --git a/sample/drb/extserv_test.rb b/sample/drb/extserv_test.rb index 83d871a6a2..2c4f485dc6 100644 --- a/sample/drb/extserv_test.rb +++ b/sample/drb/extserv_test.rb @@ -1,11 +1,11 @@ =begin dRuby sample - Copyright (c) 2000 Masatoshi SEKI + Copyright (c) 2000 Masatoshi SEKI = How to play * Terminal 1 - + % ruby -I. extserv_test.rb server druby://yourhost:12345 @@ -26,11 +26,11 @@ end class Foo include DRbUndumped - + def initialize(str) @str = str end - + def hello(it) "#{it}: #{self}" end @@ -55,7 +55,7 @@ when 'server' DRb::ExtServManager.command['itest1'] = "ruby -I. #{$0} itest1" DRb::ExtServManager.command['itest2'] = "ruby -I. #{$0} itest2" - + s = DRb::ExtServManager.new DRb.start_service(ARGV.shift, s) puts DRb.uri @@ -72,7 +72,7 @@ else t2 = s.service('itest2').front puts t2 puts t1.hello(t2) - if (cmd == 'quit') + if (cmd == 'quit') s.service('itest1').stop_service s.service('itest2').stop_service end diff --git a/sample/drb/holderc.rb b/sample/drb/holderc.rb index 8dd72ebd11..e627916d76 100644 --- a/sample/drb/holderc.rb +++ b/sample/drb/holderc.rb @@ -11,7 +11,7 @@ DRb.start_service() ro = DRbObject.new(nil, there) ary = [] -10.times do +10.times do ary.push(ro.gen) end diff --git a/sample/drb/holders.rb b/sample/drb/holders.rb index 2d9974f3fc..293426faa5 100644 --- a/sample/drb/holders.rb +++ b/sample/drb/holders.rb @@ -14,7 +14,7 @@ % ruby holderc.rb druby://yourhost:1234 =end - + require 'drb/drb' @@ -36,11 +36,11 @@ end class DRbEx4 include DRbUndumped - + def initialize @curr = 1 end - + def gen begin @curr += 1 diff --git a/sample/drb/http0.rb b/sample/drb/http0.rb index 7649925282..d4c9f6b7fb 100644 --- a/sample/drb/http0.rb +++ b/sample/drb/http0.rb @@ -46,14 +46,14 @@ module DRb def close; end def alive?; false; end - + def send_request(ref, msg_id, *arg, &b) stream = StrStream.new @msg.send_request(stream, ref, msg_id, *arg, &b) @reply_stream = StrStream.new post(@uri, stream.buf) end - + def recv_reply @msg.recv_reply(@reply_stream) end @@ -66,7 +66,7 @@ module DRb http.post(path, data, {'Content-Type'=>'application/octetstream;'}) do |str| sio.write(str) if @config[:load_limit] < sio.buf.size - raise TypeError, 'too large packet' + raise TypeError, 'too large packet' end end @reply_stream = sio diff --git a/sample/drb/http0serv.rb b/sample/drb/http0serv.rb index 100d126b8f..8318123fa9 100644 --- a/sample/drb/http0serv.rb +++ b/sample/drb/http0serv.rb @@ -5,7 +5,7 @@ require 'thread' module DRb module HTTP0 - + def self.open_server(uri, config) unless /^http:/ =~ uri raise(DRbBadScheme, uri) unless uri =~ /^http:/ @@ -20,7 +20,7 @@ module DRb @drb = drb @queue = Queue.new end - + def do_POST(req, res) @req = req @res = res @@ -28,7 +28,7 @@ module DRb @res.body = @queue.pop @res['content-type'] = 'application/octet-stream;' end - + def req_body @req.body end @@ -36,7 +36,7 @@ module DRb def reply(body) @queue.push(body) end - + def close @queue.push('') end @@ -78,7 +78,7 @@ module DRb s.start end end - + class ServerSide def initialize(callback, config) @callback = callback @@ -86,7 +86,7 @@ module DRb @msg = DRbMessage.new(@config) @req_stream = StrStream.new(@callback.req_body) end - + def close @callback.close if @callback @callback = nil diff --git a/sample/drb/name.rb b/sample/drb/name.rb index 86b478fbec..9527d47764 100644 --- a/sample/drb/name.rb +++ b/sample/drb/name.rb @@ -1,12 +1,12 @@ =begin distributed Ruby --- NamedObject Sample - Copyright (c) 2000-2001 Masatoshi SEKI + Copyright (c) 2000-2001 Masatoshi SEKI =end =begin How to play. -* start server +* start server Terminal 1 | % ruby name.rb druby://yourhost:7640 | druby://yourhost:7640 @@ -28,9 +28,9 @@ How to play. | druby://yourhost:7640 | [return] to exit -* continue client +* continue client Terminal 2 - type [return] + type [return] | 1 | 2 =end @@ -44,7 +44,7 @@ module DRbNamedObject def drb_name=(name) @drb_name = name - Thread.exclusive do + Thread.exclusive do raise(IndexError, name) if DRbNAMEDICT[name] DRbNAMEDICT[name] = self end @@ -62,7 +62,7 @@ class DRbNamedIdConv < DRb::DRbIdConv def to_id(obj) if obj.kind_of? DRbNamedObject - return obj.drb_name + return obj.drb_name else return super end @@ -98,7 +98,7 @@ class Front @name['seq'] = seq @name['mutex'] = mutex end - + def [](k) @name[k] end @@ -108,7 +108,7 @@ if __FILE__ == $0 uri = ARGV.shift name_conv = DRbNamedIdConv.new - + DRb.install_id_conv(name_conv) DRb.start_service(uri, Front.new) puts DRb.uri diff --git a/sample/drb/namec.rb b/sample/drb/namec.rb index f6db6f3022..98b9d0e532 100644 --- a/sample/drb/namec.rb +++ b/sample/drb/namec.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- NamedObject Sample Client - Copyright (c) 2000-2001 Masatoshi SEKI + Copyright (c) 2000-2001 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/old_tuplespace.rb b/sample/drb/old_tuplespace.rb index 3e13b92ee1..0da9fa84c3 100644 --- a/sample/drb/old_tuplespace.rb +++ b/sample/drb/old_tuplespace.rb @@ -82,7 +82,7 @@ class TupleSpace end end return nil unless found - + @que[sz].delete_at(i) return x @@ -167,7 +167,7 @@ if __FILE__ == $0 def client(ts, n) Thread.start { ac = Object.new - tuples = (1..10).collect { |i| + tuples = (1..10).collect { |i| ['req', ac, i * 10 + n] } ts.out(*tuples) @@ -201,7 +201,7 @@ if __FILE__ == $0 clients.push(client(ts, n)) end - (1..3).each do + (1..3).each do watcher(ts) end diff --git a/sample/drb/ring_echo.rb b/sample/drb/ring_echo.rb index 0633aa839a..3b743cab8e 100644 --- a/sample/drb/ring_echo.rb +++ b/sample/drb/ring_echo.rb @@ -8,7 +8,7 @@ class RingEcho def initialize(name) @name = name end - + def echo(str) "#{@name}: #{str}" end diff --git a/sample/drb/simpletuple.rb b/sample/drb/simpletuple.rb index 3ae9208c79..1b9b7a35a7 100644 --- a/sample/drb/simpletuple.rb +++ b/sample/drb/simpletuple.rb @@ -13,7 +13,7 @@ class SimpleTupleSpace @waiting.taint self.taint end - + def out(key, obj) Thread.critical = true @hash[key] ||= [] @@ -48,7 +48,7 @@ class SimpleTupleSpace Thread.critical = false end end -end +end if __FILE__ == $0 ts = SimpleTupleSpace.new @@ -75,7 +75,7 @@ if __FILE__ == $0 } end - 3.times do + 3.times do servers.push(server(ts)) end diff --git a/sample/drb/speedc.rb b/sample/drb/speedc.rb index 14d526d48d..64b8a65021 100644 --- a/sample/drb/speedc.rb +++ b/sample/drb/speedc.rb @@ -11,7 +11,7 @@ when /^tcpromp:/, /^unixromp:/ foo = client.resolve("foo") when /^druby:/ require 'drb/drb' - + DRb.start_service foo = DRbObject.new(nil, uri) end diff --git a/sample/drb/speeds.rb b/sample/drb/speeds.rb index 76b4b29dba..7984059423 100644 --- a/sample/drb/speeds.rb +++ b/sample/drb/speeds.rb @@ -3,7 +3,7 @@ class Foo def initialize @i = 0 end - + def foo(i) @i = i i + i @@ -24,7 +24,7 @@ when /^tcpromp:/, /^unixromp:/ when /^druby:/ require 'drb/drb' - + DRb.start_service(uri, Foo.new) end diff --git a/sample/from.rb b/sample/from.rb index aa93e6726a..918745e55f 100644 --- a/sample/from.rb +++ b/sample/from.rb @@ -36,7 +36,7 @@ def get_mailfile(user) file = user unless user file = ENV['MAIL'] - user = ENV['USER'] || ENV['USERNAME'] || ENV['LOGNAME'] + user = ENV['USER'] || ENV['USERNAME'] || ENV['LOGNAME'] end if file == nil or !File.exist?(file) diff --git a/sample/fullpath.rb b/sample/fullpath.rb index 8472e5d8f4..112ca58081 100644 --- a/sample/fullpath.rb +++ b/sample/fullpath.rb @@ -3,7 +3,7 @@ if ARGV[0] =~ /-p/ ARGV.shift - path = ARGV.shift + path = ARGV.shift end if path == nil diff --git a/sample/list2.rb b/sample/list2.rb index 914cb8996e..1d71affc1b 100644 --- a/sample/list2.rb +++ b/sample/list2.rb @@ -9,7 +9,7 @@ class Point sprintf("%d@%d", @x, @y) end end - + list1 = [10, 20, Point.new(2, 3), Point.new(4, 5)] list2 = [20, Point.new(4, 5), list1] print("list1:\n", list1.join("\n"), "\n") diff --git a/sample/list3.rb b/sample/list3.rb index 1d756fdff0..1d9f04b710 100644 --- a/sample/list3.rb +++ b/sample/list3.rb @@ -11,7 +11,7 @@ class Point sprintf("%d@%d", @x, @y) end end - + list1 = [10, 20, Point.new(2, 3), Point.new(4, 5)] list2 = [20, Point.new(4, 5), list1] print("list1: ", list1.inspect, "\n") diff --git a/sample/openssl/certstore.rb b/sample/openssl/certstore.rb index bbc637f668..c0bc21bcbb 100644 --- a/sample/openssl/certstore.rb +++ b/sample/openssl/certstore.rb @@ -48,7 +48,7 @@ class CertStore case guess_cert_type(cert) when CERT_TYPE_SELF_SIGNED true - when CERT_TYPE_OTHER + when CERT_TYPE_OTHER true else false diff --git a/sample/openssl/smime_write.rb b/sample/openssl/smime_write.rb index 535b3d6685..5a5236c750 100644 --- a/sample/openssl/smime_write.rb +++ b/sample/openssl/smime_write.rb @@ -20,4 +20,4 @@ smime0 = PKCS7::write_smime(p7sig) rcpt = X509::Certificate.new(File::read(rcpt_file)) p7enc = PKCS7::encrypt([rcpt], smime0) -print PKCS7::write_smime(p7enc) +print PKCS7::write_smime(p7enc) diff --git a/sample/rss/re_read.rb b/sample/rss/re_read.rb index ee54a18a88..c386ab20f6 100755 --- a/sample/rss/re_read.rb +++ b/sample/rss/re_read.rb @@ -24,7 +24,7 @@ ARGV.each do |fname| File.open(fname) do |f| source = f.read end - + rss = nil read = false begin @@ -44,7 +44,7 @@ ARGV.each do |fname| rescue RSS::Error error($!) if verbose end - + if rss.nil? puts "Invalid feed: #{fname}" elsif !read diff --git a/sample/svr.rb b/sample/svr.rb index f4f29eb8e7..eb49ccf170 100644 --- a/sample/svr.rb +++ b/sample/svr.rb @@ -26,7 +26,7 @@ loop do s.close socks.delete(s) # single thread gets may block whole service - elsif str = s.gets + elsif str = s.gets s.write(str) end end diff --git a/sample/test.rb b/sample/test.rb index 496856e444..4e934f1f84 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -21,7 +21,7 @@ def test_ok(cond,n=1) else STDERR.print "F" printf "not ok %s %d -- %s\n", $what, $testnum, where - $failed+=1 + $failed+=1 end STDOUT.flush STDERR.flush @@ -657,7 +657,7 @@ $string = "this must be handled no.3" begin begin raise "exception in rescue clause" - rescue + rescue raise $string end test_ok(false) @@ -671,7 +671,7 @@ end begin begin raise "this must be handled no.4" - ensure + ensure raise "exception in ensure clause" end test_ok(false) @@ -741,7 +741,7 @@ test_ok($x[1,3] == [1, 2, 3]) $x[0, 2] = 10 test_ok($x[0] == 10 && $x[1] == 2) - + $x[0, 0] = -1 test_ok($x[0] == -1 && $x[1] == 10) @@ -817,7 +817,7 @@ $x = {1=>2, 2=>4, 3=>6} test_ok($x[1] == 2) -test_ok(begin +test_ok(begin for k,v in $x raise if k*2 != v end @@ -1164,7 +1164,7 @@ def proc_return4 end test_ok(proc_return4() == 42) -def ljump_test(state, proc, *args) +def ljump_test(state, proc, *args) x = state begin proc.call(*args) @@ -1362,7 +1362,7 @@ class ITER_TEST4 < ITER_TEST3 end end -ITER_TEST4.new.foo(44){55} +ITER_TEST4.new.foo(44){55} class ITER_TEST5 def tt(aa) @@ -1628,8 +1628,8 @@ test_ok(-265419172580680477752431643787347.to_s(36) == "-justanotherrubyhacker") a = [] (0..255).each {|n| - ch = [n].pack("C") - a.push ch if /a#{Regexp.quote ch}b/x =~ "ab" + ch = [n].pack("C") + a.push ch if /a#{Regexp.quote ch}b/x =~ "ab" } test_ok(a.size == 0) @@ -1960,7 +1960,7 @@ end test_ok(bar.test2 == "test2") test_ok(bar.test == "test") -test_ok(foo.test == "test") +test_ok(foo.test == "test") begin foo.test2 @@ -2054,7 +2054,7 @@ class Gods def self.ruler1 # <= per method definition style @@rule - end + end class << self # <= multiple method definition style def ruler2 @@rule diff --git a/sample/trojan.rb b/sample/trojan.rb index 3a35ac21c2..2be9567b98 100644 --- a/sample/trojan.rb +++ b/sample/trojan.rb @@ -5,7 +5,7 @@ path = ENV['PATH'].split(File::PATH_SEPARATOR) for dir in path if File.directory?(dir) for f in d = Dir.open(dir) - fpath = File.join(dir, f) + fpath = File.join(dir, f) if File.file?(fpath) && (File.stat(fpath).mode & 022) != 0 printf("file %s is writable from other users\n", fpath) end diff --git a/signal.c b/signal.c index d53c56491c..af129cad74 100644 --- a/signal.c +++ b/signal.c @@ -970,7 +970,7 @@ sig_trap(int argc, VALUE *argv) /* disable interrupt */ sigfillset(&fullmask); pthread_sigmask(SIG_BLOCK, &fullmask, &arg.mask); - + return rb_ensure(trap, (VALUE)&arg, trap_ensure, (VALUE)&arg); } #else diff --git a/test/dl/test_func.rb b/test/dl/test_func.rb index 27bf7daf7f..45d475c919 100644 --- a/test/dl/test_func.rb +++ b/test/dl/test_func.rb @@ -58,7 +58,7 @@ module DL assert_equal("123", str.to_s) ensure GC.stress = stress - end + end def test_isdigit() f = Function.new(CFunc.new(@libc['isdigit'], TYPE_INT, 'isdigit'), diff --git a/test/json/test_json.rb b/test/json/test_json.rb index aea50485fc..4c724fd36e 100755 --- a/test/json/test_json.rb +++ b/test/json/test_json.rb @@ -154,7 +154,7 @@ class TC_JSON < Test::Unit::TestCase assert_equal(@ary, parse('[[1],["foo"],[3.14],[47.11e+2],[2718.0E-3],[null],[[1,-2,3]]'\ ',[false],[true]]')) - assert_equal(@ary, parse(%Q{ [ [1] , ["foo"] , [3.14] \t , [47.11e+2] + assert_equal(@ary, parse(%Q{ [ [1] , ["foo"] , [3.14] \t , [47.11e+2] , [2718.0E-3 ],\r[ null] , [[1, -2, 3 ]], [false ],[ true]\n ] })) end diff --git a/test/json/test_json_addition.rb b/test/json/test_json_addition.rb index 34f0a71b48..36b89e5c35 100755 --- a/test/json/test_json_addition.rb +++ b/test/json/test_json_addition.rb @@ -23,7 +23,7 @@ class TC_JSONAddition < Test::Unit::TestCase def ==(other) a == other.a end - + def self.json_create(object) new(*object['args']) end diff --git a/test/logger/test_logger.rb b/test/logger/test_logger.rb index 576bec519f..0736314b1a 100644 --- a/test/logger/test_logger.rb +++ b/test/logger/test_logger.rb @@ -498,7 +498,7 @@ class TestLoggerApplication < Test::Unit::TestCase @app.set_log(@filename) begin @app.level = Logger::UNKNOWN - @app.start # logs FATAL log + @app.start # logs FATAL log assert_equal(1, File.read(@filename).split(/\n/).size) ensure @app.logger.close diff --git a/test/minitest/test_minitest_mock.rb b/test/minitest/test_minitest_mock.rb index 311f5fa7fb..5d0bae8ad7 100644 --- a/test/minitest/test_minitest_mock.rb +++ b/test/minitest/test_minitest_mock.rb @@ -89,10 +89,10 @@ class TestMiniTestMock < MiniTest::Unit::TestCase def test_assign_per_mock_return_values a = MiniTest::Mock.new b = MiniTest::Mock.new - + a.expect(:foo, :a) b.expect(:foo, :b) - + assert_equal :a, a.foo assert_equal :b, b.foo end diff --git a/test/open-uri/test_ssl.rb b/test/open-uri/test_ssl.rb index 0502f76346..64fc214ce5 100644 --- a/test/open-uri/test_ssl.rb +++ b/test/open-uri/test_ssl.rb @@ -143,13 +143,13 @@ Certificate: 36:c1:44:4e:ab:9a:b2:73:6d Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:FALSE - Netscape Comment: + Netscape Comment: OpenSSL Generated Certificate - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 24:6F:03:A3:EE:06:51:75:B2:BA:FC:3A:38:59:BF:ED:87:CD:E8:7F - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:24:6F:03:A3:EE:06:51:75:B2:BA:FC:3A:38:59:BF:ED:87:CD:E8:7F Signature Algorithm: sha1WithRSAEncryption @@ -205,15 +205,15 @@ Certificate: f0:86:61:ce:f1:ff:42:c7:23 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:FALSE - Netscape Cert Type: + Netscape Cert Type: SSL Server - Netscape Comment: + Netscape Comment: OpenSSL Generated Certificate - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 7F:17:5A:58:88:96:E1:1F:44:EA:FF:AD:C6:2E:90:E2:95:32:DD:F0 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:24:6F:03:A3:EE:06:51:75:B2:BA:FC:3A:38:59:BF:ED:87:CD:E8:7F Signature Algorithm: sha1WithRSAEncryption diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb index 4fd4771d7b..62d0eb476d 100644 --- a/test/openssl/test_asn1.rb +++ b/test/openssl/test_asn1.rb @@ -429,7 +429,7 @@ class OpenSSL::TestASN1 < Test::Unit::TestCase assert_equal(raw, OpenSSL::ASN1.decode(raw).to_der) end end - + def test_primitive_inf_length assert_raises(OpenSSL::ASN1::ASN1Error) do spec = %w{ 02 80 02 01 01 00 00 } @@ -438,6 +438,6 @@ class OpenSSL::TestASN1 < Test::Unit::TestCase OpenSSL::ASN1.decode_all(raw) end end - + end if defined?(OpenSSL) diff --git a/test/openssl/test_x509cert.rb b/test/openssl/test_x509cert.rb index 786eebb368..6d39c9690d 100644 --- a/test/openssl/test_x509cert.rb +++ b/test/openssl/test_x509cert.rb @@ -170,9 +170,9 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase nil, nil, OpenSSL::Digest::MD5.new) } end - + private - + def certificate_error_returns_false yield rescue OpenSSL::X509::CertificateError diff --git a/test/openssl/test_x509crl.rb b/test/openssl/test_x509crl.rb index c0c996e966..56508e0a12 100644 --- a/test/openssl/test_x509crl.rb +++ b/test/openssl/test_x509crl.rb @@ -208,9 +208,9 @@ class OpenSSL::TestX509CRL < Test::Unit::TestCase crl.version = 0 assert_equal(false, crl.verify(@dsa512)) end - + private - + def crl_error_returns_false yield rescue OpenSSL::X509::CRLError diff --git a/test/openssl/test_x509req.rb b/test/openssl/test_x509req.rb index 1b660ca051..882a1d7356 100644 --- a/test/openssl/test_x509req.rb +++ b/test/openssl/test_x509req.rb @@ -137,9 +137,9 @@ class OpenSSL::TestX509Request < Test::Unit::TestCase assert_raise(OpenSSL::X509::RequestError){ issue_csr(0, @dn, @dsa512, OpenSSL::Digest::MD5.new) } end - + private - + def request_error_returns_false yield rescue OpenSSL::X509::RequestError diff --git a/test/psych/test_null.rb b/test/psych/test_null.rb index 1ebf6444c2..0fee1d2464 100644 --- a/test/psych/test_null.rb +++ b/test/psych/test_null.rb @@ -10,7 +10,7 @@ module Psych --- - ~ - null -- +- - Null - NULL eoyml diff --git a/test/psych/test_struct.rb b/test/psych/test_struct.rb index 42c4e113ab..39e38f7dfd 100644 --- a/test/psych/test_struct.rb +++ b/test/psych/test_struct.rb @@ -39,7 +39,7 @@ module Psych def test_load obj = Psych.load(<<-eoyml) ---- !ruby/struct:PsychStructWithIvar +--- !ruby/struct:PsychStructWithIvar :foo: bar :@bar: hello eoyml diff --git a/test/rake/in_environment.rb b/test/rake/in_environment.rb index f0a340fac9..f6fd8fb731 100644 --- a/test/rake/in_environment.rb +++ b/test/rake/in_environment.rb @@ -1,11 +1,11 @@ module InEnvironment private - + # Create an environment for a test. At the completion of the yielded # block, the environment is restored to its original conditions. def in_environment(settings) original_settings = set_env(settings) - yield + yield ensure set_env(original_settings) if original_settings end diff --git a/test/rake/test_application.rb b/test/rake/test_application.rb index 9158689e65..27c7d8df05 100644 --- a/test/rake/test_application.rb +++ b/test/rake/test_application.rb @@ -123,7 +123,7 @@ class Rake::TestApplication < Test::Unit::TestCase def test_load_rakefile in_environment("PWD" => File.join(BASEDIR, "data/unittest")) do - @app.instance_eval do + @app.instance_eval do handle_options options.silent = true load_rakefile @@ -151,8 +151,8 @@ class Rake::TestApplication < Test::Unit::TestCase handle_options options.silent = true end - ex = assert_raise(RuntimeError) do - @app.instance_eval do raw_load_rakefile end + ex = assert_raise(RuntimeError) do + @app.instance_eval do raw_load_rakefile end end assert_match(/no rakefile found/i, ex.message) end @@ -313,7 +313,7 @@ class Rake::TestApplicationOptions < Test::Unit::TestCase RakeFileUtils.verbose_flag = false RakeFileUtils.nowrite_flag = false end - + def clear_argv while ! ARGV.empty? ARGV.pop @@ -519,7 +519,7 @@ class Rake::TestApplicationOptions < Test::Unit::TestCase assert_equal :exit, @exit end end - + def test_classic_namespace flags(['--classic-namespace'], ['-C', '-T', '-P', '-n', '-s', '-t']) do |opts| assert opts.classic_namespace @@ -534,7 +534,7 @@ class Rake::TestApplicationOptions < Test::Unit::TestCase def test_bad_option capture_stderr do ex = assert_raise(OptionParser::InvalidOption) do - flags('--bad-option') + flags('--bad-option') end if ex.message =~ /^While/ # Ruby 1.9 error message assert_match(/while parsing/i, ex.message) @@ -549,12 +549,12 @@ class Rake::TestApplicationOptions < Test::Unit::TestCase command_line("a", "b") assert_equal ["a", "b"], @tasks.sort end - + def test_default_task_collection command_line() assert_equal ["default"], @tasks end - + def test_environment_definition ENV.delete('TESTKEY') command_line("a", "TESTKEY=12") @@ -562,12 +562,12 @@ class Rake::TestApplicationOptions < Test::Unit::TestCase assert '12', ENV['TESTKEY'] end - private + private def flags(*sets) sets.each do |set| ARGV.clear - @out = capture_stdout { + @out = capture_stdout { @exit = catch(:system_exit) { opts = command_line(*set) } } yield(@app.options) if block_given? @@ -593,31 +593,31 @@ class Rake::TestTaskArgumentParsing < Test::Unit::TestCase def setup @app = Rake::Application.new end - + def test_name_only name, args = @app.parse_task_string("name") assert_equal "name", name assert_equal [], args end - + def test_empty_args name, args = @app.parse_task_string("name[]") assert_equal "name", name assert_equal [], args end - + def test_one_argument name, args = @app.parse_task_string("name[one]") assert_equal "name", name assert_equal ["one"], args end - + def test_two_arguments name, args = @app.parse_task_string("name[one,two]") assert_equal "name", name assert_equal ["one", "two"], args end - + def test_can_handle_spaces_between_args name, args = @app.parse_task_string("name[one, two,\tthree , \tfour]") assert_equal "name", name diff --git a/test/rake/test_definitions.rb b/test/rake/test_definitions.rb index 164958ecd5..a5440dcadc 100644 --- a/test/rake/test_definitions.rb +++ b/test/rake/test_definitions.rb @@ -6,7 +6,7 @@ require_relative 'filecreation' ###################################################################### class Rake::TestDefinitions < Test::Unit::TestCase include Rake - + EXISTINGFILE = "testdata/existing" def setup @@ -78,4 +78,4 @@ class Rake::TestDefinitions < Test::Unit::TestCase end end - + diff --git a/test/rake/test_earlytime.rb b/test/rake/test_earlytime.rb index a228146679..d94523cffd 100644 --- a/test/rake/test_earlytime.rb +++ b/test/rake/test_earlytime.rb @@ -24,7 +24,7 @@ class Rake::TestEarlyTime < Test::Unit::TestCase assert t1 < t2 assert t2 > t1 assert t1 == t1 - assert t2 == t2 + assert t2 == t2 end def test_to_s diff --git a/test/rake/test_extension.rb b/test/rake/test_extension.rb index 94348aafa6..3b10a4c6ed 100644 --- a/test/rake/test_extension.rb +++ b/test/rake/test_extension.rb @@ -16,14 +16,14 @@ class Rake::TestExtension < Test::Unit::TestCase $stderr = old_err end end - + class Sample extend Redirect def duplicate_method :original end - + OK_ERRS = error_redirect do rake_extension("a") do def ok_method diff --git a/test/rake/test_file_task.rb b/test/rake/test_file_task.rb index 0232ac95ed..132bd88853 100644 --- a/test/rake/test_file_task.rb +++ b/test/rake/test_file_task.rb @@ -77,7 +77,7 @@ class Rake::TestFileTask < Test::Unit::TestCase # deleting the file target on failure is always the proper thing to # do. I'm willing to hear input on this topic. def ztest_file_deletes_on_failure - task :obj + task :obj file NEWFILE => [:obj] do |t| FileUtils.touch NEWFILE fail "Ooops" diff --git a/test/rake/test_filelist.rb b/test/rake/test_filelist.rb index 08456a4da8..2b1ad44237 100644 --- a/test/rake/test_filelist.rb +++ b/test/rake/test_filelist.rb @@ -89,7 +89,7 @@ class Rake::TestFileList < Test::Unit::TestCase h = f.include("y") assert_equal f.object_id, h.object_id end - + def test_match fl = FileList.new fl.include(File.expand_path('../test*.rb', __FILE__)) @@ -155,7 +155,7 @@ class Rake::TestFileList < Test::Unit::TestCase fl.exclude('testdata/existing') assert_equal [], fl end - + def test_excluding_via_block fl = FileList['testdata/a.c', 'testdata/b.c', 'testdata/xyz.c'] fl.exclude { |fn| fn.pathmap('%n') == 'xyz' } @@ -235,24 +235,24 @@ class Rake::TestFileList < Test::Unit::TestCase assert_equal ["testdata/abc.o", "testdata/x.o", "testdata/xyz.o"].sort, f3.sort end - + def test_claim_to_be_a_kind_of_array fl = FileList['testdata/*.c'] assert fl.is_a?(Array) assert fl.kind_of?(Array) end - + def test_claim_to_be_a_kind_of_filelist fl = FileList['testdata/*.c'] assert fl.is_a?(FileList) assert fl.kind_of?(FileList) end - + def test_claim_to_be_a_filelist_instance fl = FileList['testdata/*.c'] assert fl.instance_of?(FileList) end - + def test_dont_claim_to_be_an_array_instance fl = FileList['testdata/*.c'] assert ! fl.instance_of?(Array) @@ -590,12 +590,12 @@ class Rake::TestFileList < Test::Unit::TestCase assert_equal ['b', 'd'], r assert_equal FileList, r.class end - + def test_file_utils_can_use_filelists cfiles = FileList['testdata/*.c'] - + cp cfiles, @cdir, :verbose => false - + assert File.exist?(File.join(@cdir, 'abc.c')) assert File.exist?(File.join(@cdir, 'xyz.c')) assert File.exist?(File.join(@cdir, 'x.c')) @@ -603,7 +603,7 @@ class Rake::TestFileList < Test::Unit::TestCase def create_test_data verbose(false) do - + mkdir "testdata" unless File.exist? "testdata" mkdir "testdata/CVS" rescue nil mkdir "testdata/.svn" rescue nil @@ -621,5 +621,5 @@ class Rake::TestFileList < Test::Unit::TestCase touch "testdata/existing" end end - + end diff --git a/test/rake/test_fileutils.rb b/test/rake/test_fileutils.rb index 1664ec80c3..b6106c0978 100644 --- a/test/rake/test_fileutils.rb +++ b/test/rake/test_fileutils.rb @@ -18,7 +18,7 @@ class Rake::TestFileUtils < Test::Unit::TestCase @oldruby = nil end end - + def teardown FileUtils.rm_rf("testdata") FileUtils::LN_SUPPORTED[0] = true @@ -28,7 +28,7 @@ class Rake::TestFileUtils < Test::Unit::TestCase FileUtils.class_eval {const_set(:RUBY, ruby)} end end - + def test_rm_one_file create_file("testdata/a") FileUtils.rm_rf "testdata/a" @@ -165,7 +165,7 @@ class Rake::TestFileUtils < Test::Unit::TestCase end def test_sh_failure - assert_raise(RuntimeError) { + assert_raise(RuntimeError) { verbose(false) { Sh.run "#{RUBY} #{File.expand_path('../shellcommand.rb', __FILE__)} 1" } } end @@ -241,7 +241,7 @@ class Rake::TestFileUtils < Test::Unit::TestCase end private - + def redirect_stderr old_err = $stderr $stderr = StringIO.new @@ -258,5 +258,5 @@ class Rake::TestFileUtils < Test::Unit::TestCase def env_var windows? ? '%RAKE_TEST_SH%' : '$RAKE_TEST_SH' end - + end diff --git a/test/rake/test_multitask.rb b/test/rake/test_multitask.rb index 9711e7e77e..0413d03db3 100644 --- a/test/rake/test_multitask.rb +++ b/test/rake/test_multitask.rb @@ -40,4 +40,4 @@ class Rake::TestMultiTask < Test::Unit::TestCase end end - + diff --git a/test/rake/test_pathmap.rb b/test/rake/test_pathmap.rb index 257529ab87..2775b91039 100644 --- a/test/rake/test_pathmap.rb +++ b/test/rake/test_pathmap.rb @@ -23,7 +23,7 @@ class Rake::TestPathMap < Test::Unit::TestCase def test_n_returns_basename_without_extension assert_equal "abc", "abc.rb".pathmap("%n") - assert_equal "abc", "abc".pathmap("%n") + assert_equal "abc", "abc".pathmap("%n") assert_equal "abc", "this/is/a/dir/abc.rb".pathmap("%n") assert_equal "abc", "/this/is/a/dir/abc.rb".pathmap("%n") assert_equal "abc", "/this/is/a/dir/abc".pathmap("%n") diff --git a/test/rake/test_rake.rb b/test/rake/test_rake.rb index 52230fe148..44fecee559 100644 --- a/test/rake/test_rake.rb +++ b/test/rake/test_rake.rb @@ -35,5 +35,5 @@ class Rake::TestRake < Test::Unit::TestCase def test_original_dir_reports_current_dir assert_equal Dir.pwd, Rake.original_dir end - + end diff --git a/test/rake/test_task_arguments.rb b/test/rake/test_task_arguments.rb index d40144f3fd..9e907aed7d 100644 --- a/test/rake/test_task_arguments.rb +++ b/test/rake/test_task_arguments.rb @@ -76,7 +76,7 @@ class Rake::TestTaskArguments < Test::Unit::TestCase child = Rake::TaskArguments.new(['aa'], [2], parent) assert_equal 2, child.aa end - + def test_default_arguments_values_can_be_merged ta = Rake::TaskArguments.new(["aa", "bb"], [nil, "original_val"]) ta.with_defaults({ :aa => 'default_val' }) diff --git a/test/rake/test_task_manager.rb b/test/rake/test_task_manager.rb index 1e92e25fbf..3ab039ca85 100644 --- a/test/rake/test_task_manager.rb +++ b/test/rake/test_task_manager.rb @@ -135,7 +135,7 @@ class Rake::TestTaskManager < Test::Unit::TestCase end end assert_equal t1, @tm[:t, []] - assert_equal t2, @tm[:t, ["a"]] + assert_equal t2, @tm[:t, ["a"]] assert_equal t3, @tm[:t, ["a", "b"]] assert_equal s, @tm[:s, ["a", "b"]] assert_equal s, @tm[:s, ["a"]] @@ -153,7 +153,7 @@ class Rake::TestTaskManager < Test::Unit::TestCase @tm["a:x"].invoke assert_equal ["next z"], values end - + end class Rake::TestTaskManagerArgumentResolution < Test::Unit::TestCase diff --git a/test/rake/test_test_task.rb b/test/rake/test_test_task.rb index a0dc7a0717..0b7dbc625b 100644 --- a/test/rake/test_test_task.rb +++ b/test/rake/test_test_task.rb @@ -4,7 +4,7 @@ require 'rake/testtask' class Rake::TestTestTask < Test::Unit::TestCase include Rake - + def setup @oldwd = Dir.pwd @tmpwd = Dir.mktmpdir diff --git a/test/rdoc/test_rdoc_context_section.rb b/test/rdoc/test_rdoc_context_section.rb index 1636c98246..d37a4d222e 100644 --- a/test/rdoc/test_rdoc_context_section.rb +++ b/test/rdoc/test_rdoc_context_section.rb @@ -5,7 +5,7 @@ require 'rdoc' require 'rdoc/code_objects' class TestRDocContextSection < MiniTest::Unit::TestCase - + def setup @S = RDoc::Context::Section @s = @S.new nil, 'section', '# comment' diff --git a/test/rdoc/test_rdoc_parser_ruby.rb b/test/rdoc/test_rdoc_parser_ruby.rb index 6c2b445ef3..87ac45a073 100644 --- a/test/rdoc/test_rdoc_parser_ruby.rb +++ b/test/rdoc/test_rdoc_parser_ruby.rb @@ -2067,7 +2067,7 @@ end foo = @top_level.classes.first - assert_equal "= DESCRIPTION\n\nThis is a simple test class\n\n= RUMPUS\n\nIs a silly word", + assert_equal "= DESCRIPTION\n\nThis is a simple test class\n\n= RUMPUS\n\nIs a silly word", foo.comment m = foo.method_list.first diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb index fc1e719462..a504fa5e2f 100644 --- a/test/readline/test_readline.rb +++ b/test/readline/test_readline.rb @@ -118,8 +118,8 @@ class TestReadline < Test::Unit::TestCase stdin.close(true) stdout.close(true) end - end - + end + # line_buffer # point def test_line_buffer__point @@ -129,7 +129,7 @@ class TestReadline < Test::Unit::TestCase rescue NotImplementedError return end - + stdin = Tempfile.new("test_readline_stdin") stdout = Tempfile.new("test_readline_stdout") begin diff --git a/test/rexml/test_attributes.rb b/test/rexml/test_attributes.rb index 51a7774b0f..e46850de3a 100644 --- a/test/rexml/test_attributes.rb +++ b/test/rexml/test_attributes.rb @@ -91,10 +91,10 @@ class AttributesTester < Test::Unit::TestCase # Submitted by Kou def test_namespace_conflict - assert_raise( ParseException, + assert_raise( ParseException, "Declaring two attributes with the same namespace should be an error" ) do REXML::Document.new <<-XML - diff --git a/test/rexml/test_contrib.rb b/test/rexml/test_contrib.rb index eb16b8946c..7d00202c95 100644 --- a/test/rexml/test_contrib.rb +++ b/test/rexml/test_contrib.rb @@ -92,7 +92,7 @@ DELIMITER doc = REXML::Document.new source assert_equal "myprog-config", doc.root.name count = 0 - REXML::XPath.each(doc, "x:myprog-config/x:main/x:parameter", + REXML::XPath.each(doc, "x:myprog-config/x:main/x:parameter", {"x"=>"http://someurl/program/version"}) { |element| assert_equal "name", element.attributes["name"] count += 1; @@ -183,7 +183,7 @@ DELIMITER result = XPath.first(doc, xpath) assert_equal desired_result.to_s, result.to_s end - + def test_xpath_whitespace_TobiasReif # same as above, with whitespace in XPath doc = Document.new(XML_STRING_01.dup) @@ -193,7 +193,7 @@ DELIMITER failure_message = "\n[[[TR: AFAIK, whitespace should be allowed]]]\n" assert_equal(desired_result.to_s, result.to_s, failure_message) end - + def test_xpath_02_TobiasReif doc = Document.new XML_STRING_01.dup desired_result = Document.new 'Thomas, David; Hunt, Andrew' @@ -211,7 +211,7 @@ DELIMITER failure_message = "\nHow to handle the apos inside the string inside the XPath?\nXPath = #{xpath}\n" assert_equal desired_result.to_s, result.to_s, failure_message end - + def test_xpath_03_TobiasReif doc = Document.new XML_STRING_02.dup desired_result_string = " @@ -303,7 +303,7 @@ EOF assert_nil XPath.first(doc,'//leg') assert_equal 'http://www.foo.com/human', doc.root.elements[1].namespace - assert_equal 'human leg', + assert_equal 'human leg', XPath.first(doc, '//x:leg/text()', {'x'=>'http://www.foo.com/human'}).to_s end @@ -312,8 +312,8 @@ EOF source = File.new(fixture_path('ProductionSupport.xml')) h = Hash.new doc = REXML::Document.new source - doc.elements.each("//CommonError") { |el| - h[el.elements['Key'].text] = 'okay' + doc.elements.each("//CommonError") { |el| + h[el.elements['Key'].text] = 'okay' } assert(h.include?('MotorInsuranceContract(Object)>>#error:')) end @@ -426,7 +426,7 @@ EOF assert text !~ /&rbconfig/, "'#{text}' failed" end - #Error occurred in test_package_file_opens(TC_PackageInstall): + #Error occurred in test_package_file_opens(TC_PackageInstall): # ArgumentError: #illegal access mode &rbconfig.prefix;/lib/rexml # @@ -464,7 +464,7 @@ EOL end end - def test_maintain_dtd + def test_maintain_dtd src = %q{ diff --git a/test/rexml/test_doctype.rb b/test/rexml/test_doctype.rb index 20603f5378..0a87c0a304 100644 --- a/test/rexml/test_doctype.rb +++ b/test/rexml/test_doctype.rb @@ -18,7 +18,7 @@ class TestDocTypeAccessor < Test::Unit::TestCase XMLEND @doctype1 = REXML::Document.new(document_string1).doctype - + @pubid = "TEST_ID" document_string2 = <<-"XMLEND" @@ -31,15 +31,15 @@ class TestDocTypeAccessor < Test::Unit::TestCase XMLEND @doctype3 = REXML::Document.new(document_string3).doctype - + end - + def test_public assert_equal(nil, @doctype1.public) assert_equal(@pubid, @doctype2.public) assert_equal(@pubid, @doctype3.public) end - + def test_system assert_equal(@sysid, @doctype1.system) assert_equal(nil, @doctype2.system) @@ -50,20 +50,20 @@ class TestDocTypeAccessor < Test::Unit::TestCase assert_equal(@notid1, @doctype1.notation("n1").system) assert_equal(@notid2, @doctype1.notation("n2").system) end - + def test_notations notations = @doctype1.notations assert_equal(2, notations.length) assert_equal(@notid1, find_notation(notations, "n1").system) assert_equal(@notid2, find_notation(notations, "n2").system) end - + def find_notation(notations, name) notations.find { |notation| name == notation.name } end - + end class TestNotationDeclPublic < Test::Unit::TestCase diff --git a/test/rexml/test_elements.rb b/test/rexml/test_elements.rb index 210004a1c0..424b2a2c9b 100644 --- a/test/rexml/test_elements.rb +++ b/test/rexml/test_elements.rb @@ -19,16 +19,16 @@ class ElementsTester < Test::Unit::TestCase doc.root.elements['c'] = Element.new('d') assert_equal 'd', doc.root.elements[1].name end - + def test_elements_delete doc = Document.new '' - block = proc { |str| + block = proc { |str| out = '' doc.write out - assert_equal str, out + assert_equal str, out } b = doc.root.elements[1] - doc.root.elements.delete b + doc.root.elements.delete b block.call( "" ) doc.elements.delete("a/c[@id='1']") block.call( '' ) @@ -90,13 +90,13 @@ class ElementsTester < Test::Unit::TestCase assert_equal 2, doc.root.elements.to_a("child::node()").size assert_equal 4, XPath.match(doc.root, "child::node()").size end - + def test_elements_collect doc = Document.new( "" ) r = doc.elements.collect( "/a/b" ) { |e| e.attributes["id"].to_i } assert_equal( [1,2], r ) end - + def test_elements_inject doc = Document.new( "" ) r = doc.elements.inject( "/a/b", 3 ) { |s, e| diff --git a/test/rexml/test_encoding_2.rb b/test/rexml/test_encoding_2.rb index 2e845b58a0..6a985f3897 100644 --- a/test/rexml/test_encoding_2.rb +++ b/test/rexml/test_encoding_2.rb @@ -44,7 +44,7 @@ END end end - if broken_encodings > 0 + if broken_encodings > 0 fail "There were #{broken_encodings} encoding failures out of #{UnixCharsets.size} plus some REXML internal encodings" else fail "There were no encoding failures" diff --git a/test/rexml/test_entity.rb b/test/rexml/test_entity.rb index 5219004a49..e6d6f29007 100644 --- a/test/rexml/test_entity.rb +++ b/test/rexml/test_entity.rb @@ -10,23 +10,23 @@ class EntityTester < Test::Unit::TestCase simple =~ /#{REXML::Entity::GEDECL}/ assert $& assert_equal simple, $& - + REXML::Entity::ENTITYDECL =~ simple assert REXML::Entity::matches?(simple) match = REXML::Entity::ENTITYDECL.match(simple) assert_equal 'foo', match[1] assert_equal "'bar'", match[2] - simple = '' assert REXML::Entity::matches?(simple) match = REXML::Entity::ENTITYDECL.match(simple) assert_equal 'Pub-Status', match[1] assert_equal '"This is a pre-release of the specification."', match[2] - txt = '"This is a + txt = '"This is a pre-release of specification."' - simple = "" assert REXML::Entity::matches?(simple) match = REXML::Entity::ENTITYDECL.match(simple) @@ -117,7 +117,7 @@ class EntityTester < Test::Unit::TestCase source = ' ]>replace &ent;' - doc = REXML::Document.new( source ) + doc = REXML::Document.new( source ) assert_equal(source, doc.to_s) assert_equal("replace replace", doc.root.text) assert_equal(source, doc.to_s) diff --git a/test/rexml/test_functions.rb b/test/rexml/test_functions.rb index e0f8a67fc1..082d772e23 100644 --- a/test/rexml/test_functions.rb +++ b/test/rexml/test_functions.rb @@ -155,7 +155,7 @@ class FunctionsTester < Test::Unit::TestCase id_1 = doc.elements["/a/b[@id='1']"] id_2 = doc.elements["/a/b[@id='2']"] id_3 = doc.elements["/a/b[@id='3']"] - + good = { "floor" => [[], [id_1], [id_2], [id_3]], "ceiling" => [[id_1], [id_2], [id_3], []], diff --git a/test/rexml/test_jaxen.rb b/test/rexml/test_jaxen.rb index 1870928438..222cf79c60 100644 --- a/test/rexml/test_jaxen.rb +++ b/test/rexml/test_jaxen.rb @@ -41,18 +41,18 @@ class JaxenTester < Test::Unit::TestCase file = File.new(fixture_path(fname+".xml")) doc = Document.new( file ) XPath.each( doc, "/tests/document" ) {|e| handleDocument(e)} -# end +# end # } end - # processes a tests/document/context node + # processes a tests/document/context node def handleContext( testDoc, ctxElement) testCtx = XPath.match( testDoc, ctxElement.attributes["select"] )[0] - namespaces = {} + namespaces = {} if testCtx.class == Element - testCtx.prefixes.each { |pre| handleNamespace( testCtx, pre, namespaces ) } + testCtx.prefixes.each { |pre| handleNamespace( testCtx, pre, namespaces ) } end - variables = {} + variables = {} XPath.each( ctxElement, "@*[namespace-uri() = 'http://jaxen.org/test-harness/var']") { |attrib| handleVariable(testCtx, variables, attrib) } XPath.each( ctxElement, "valueOf") { |e| handleValueOf(testCtx, variables, namespaces, e) } XPath.each( ctxElement, "test[not(@exception) or (@exception != 'true') ]") { |e| handleNominalTest(testCtx,variables, namespaces, e) } @@ -61,7 +61,7 @@ class JaxenTester < Test::Unit::TestCase # processes a tests/document/context/valueOf or tests/document/context/test/valueOf node def handleValueOf(ctx,variables, namespaces, valueOfElement) - expected = valueOfElement.text + expected = valueOfElement.text got = XPath.match( ctx, valueOfElement.attributes["select"], namespaces, variables )[0] assert_true( (got.nil? && expected.nil?) || !got.nil? ) case got.class @@ -71,10 +71,10 @@ class JaxenTester < Test::Unit::TestCase assert_equal( expected, got.to_s ) when Instruction assert_equal( expected, got.content ) - when Fixnum + when Fixnum assert_equal( exected.to_f, got ) when String - # normalize values for comparison + # normalize values for comparison got = "" if got == nil or got == "" expected = "" if expected == nil or expected == "" assert_equal( expected, got ) @@ -82,45 +82,45 @@ class JaxenTester < Test::Unit::TestCase assert_fail( "Wassup?" ) end end - - + + # processes a tests/document/context/test node ( where @exception is false or doesn't exist ) def handleNominalTest(ctx, variables, namespaces, testElement) - expected = testElement.attributes["count"] + expected = testElement.attributes["count"] got = XPath.match( ctx, testElement.attributes["select"], namespaces, variables ) # might be a test with no count attribute, but nested valueOf elements assert( expected == got.size.to_s ) if !expected.nil? - - XPath.each( testElement, "valueOf") { |e| - handleValueOf(got, variables, namespaces, e) + + XPath.each( testElement, "valueOf") { |e| + handleValueOf(got, variables, namespaces, e) } end - - # processes a tests/document/context/test node ( where @exception is true ) + + # processes a tests/document/context/test node ( where @exception is true ) def handleExceptionalTest(ctx, variables, namespaces, testElement) assert_raise( Exception ) { XPath.match( ctx, testElement.attributes["select"], namespaces, variables ) } end - # processes a tests/document node + # processes a tests/document node def handleDocument(docElement) puts "- Processing document: #{docElement.attributes['url']}" testFile = File.new( docElement.attributes["url"] ) testDoc = Document.new testFile XPath.each( docElement, "context") { |e| handleContext(testDoc, e) } end - - # processes a variable definition in a namespace like + + # processes a variable definition in a namespace like def handleVariable( ctx, variables, attrib ) puts "--- Found attribute: #{attrib.name}" variables[attrib.name] = attrib.value end - - # processes a namespace definition like + + # processes a namespace definition like def handleNamespace( ctx, prefix, namespaces ) puts "--- Found namespace: #{prefix}" - namespaces[prefix] = ctx.namespaces[prefix] + namespaces[prefix] = ctx.namespaces[prefix] end - + end diff --git a/test/rexml/test_light.rb b/test/rexml/test_light.rb index 3b9e8adfec..1b56159254 100644 --- a/test/rexml/test_light.rb +++ b/test/rexml/test_light.rb @@ -12,7 +12,7 @@ class LightTester < Test::Unit::TestCase tag, content = parser.parse assert_equal([:document, :text], [tag, content.first]) end - + # FIXME INCOMPLETE # This is because the light API is not yet ready to be used to produce # trees. @@ -22,7 +22,7 @@ class LightTester < Test::Unit::TestCase foo = doc.add_element( 'foo' ) assert_equal( "foo", foo.name ) end - + def test_add_attribute foo = Node.new( "a" ) foo["attr"] = "bar" diff --git a/test/rexml/test_listener.rb b/test/rexml/test_listener.rb index f2cc4b7c35..0afbdcd5ff 100644 --- a/test/rexml/test_listener.rb +++ b/test/rexml/test_listener.rb @@ -11,7 +11,7 @@ class BaseTester < Test::Unit::TestCase return unless defined? @listener # Empty. t1 = %Q{} - assert_equal( "", @listener.parse( t1 ), + assert_equal( "", @listener.parse( t1 ), "Empty" ) end @@ -59,11 +59,11 @@ class BaseTester < Test::Unit::TestCase return unless defined? @listener # CR. t7 = %Q{ \r\n \r \n } - assert_equal( " \n \n \n ".unpack("C*").inspect, + assert_equal( " \n \n \n ".unpack("C*").inspect, @listener.parse( t7 ).unpack("C*").inspect, "CR" ) end - # The accent bug, and the code that exibits the bug, was contributed by + # The accent bug, and the code that exibits the bug, was contributed by # Guilhem Vellut class AccentListener def tag_start(name,attributes) diff --git a/test/rexml/test_notationdecl_mixin.rb b/test/rexml/test_notationdecl_mixin.rb index d5212534c1..68dcc555ac 100644 --- a/test/rexml/test_notationdecl_mixin.rb +++ b/test/rexml/test_notationdecl_mixin.rb @@ -31,11 +31,11 @@ class TestNotationDeclMixin < Test::Unit::TestCase XMLEND @doctype = REXML::Document.new(doc_string).doctype end - + def test_name assert_equal('n1', @doctype.notation('n1').name) end - + def test_public_2 assert_equal(@pubid1, @doctype.notation('n1').public) assert_equal(@pubid2, @doctype.notation('n2').public) @@ -45,7 +45,7 @@ class TestNotationDeclMixin < Test::Unit::TestCase assert_equal(@pubid6, @doctype.notation('n6').public) assert_nil(@doctype.notation('n7').public) end - + def test_system_2 assert_equal(@sysid2, @doctype.notation('n2').system) assert_nil(@doctype.notation('n3').system) diff --git a/test/rexml/test_notationdecl_parsetest.rb b/test/rexml/test_notationdecl_parsetest.rb index 6a8449e37d..2e86d322e0 100644 --- a/test/rexml/test_notationdecl_parsetest.rb +++ b/test/rexml/test_notationdecl_parsetest.rb @@ -14,7 +14,7 @@ class TestNotationDecl < Test::Unit::TestCase XMLEND @doctype = REXML::Document.new(doc_string).doctype end - + def test_notation assert(@doctype.notation('n1'), "Testing notation n1") assert(@doctype.notation('n2'), "Testing notation n2") diff --git a/test/rexml/test_pullparser.rb b/test/rexml/test_pullparser.rb index 1c9bcc0045..bfce60f268 100644 --- a/test/rexml/test_pullparser.rb +++ b/test/rexml/test_pullparser.rb @@ -21,19 +21,19 @@ class PullParserTester < Test::Unit::TestCase end res[ :text ] += 1 if results.text? end - [ :xmldecl, :doctype, :a, :b ].each { |tag| + [ :xmldecl, :doctype, :a, :b ].each { |tag| assert res[tag] , "#{tag} wasn't processed" } - assert_equal 4, res[ :text ] - rescue ParseException + assert_equal 4, res[ :text ] + rescue ParseException puts $! end def test_bad_document source = "" parser = REXML::Parsers::PullParser.new(source) - assert_raise(ParseException, "Parsing should have failed") { - results = parser.pull while parser.has_next? + assert_raise(ParseException, "Parsing should have failed") { + results = parser.pull while parser.has_next? } end diff --git a/test/rexml/test_sax.rb b/test/rexml/test_sax.rb index 569270ceb1..f5d7fb44ce 100644 --- a/test/rexml/test_sax.rb +++ b/test/rexml/test_sax.rb @@ -41,7 +41,7 @@ class SAX2Tester < Test::Unit::TestCase } start_document = 0 - end_document = 0 + end_document = 0 parser.listen( :start_document ) { start_document += 1 } parser.listen( :end_document ) { end_document += 1 } parser.listen( :start_element, %w{ changelog bugs todo }, &blok ) @@ -69,8 +69,8 @@ class SAX2Tester < Test::Unit::TestCase assert(text=~/@ANT_VERSION@/, "version was '#{text}'") tc += 1 } - - begin + + begin parser.parse rescue => exception if exception.kind_of? Test::Unit::AssertionFailedError @@ -255,12 +255,12 @@ class SAX2Tester < Test::Unit::TestCase assert_equal(252, result[0]) end - class Ticket68 - include REXML::SAX2Listener - end + class Ticket68 + include REXML::SAX2Listener + end def test_ticket_68 parser = REXML::Parsers::SAX2Parser.new(File.new(fixture_path('ticket_68.xml'))) - parser.listen( Ticket68.new ) + parser.listen( Ticket68.new ) begin parser.parse rescue diff --git a/test/rexml/test_stream.rb b/test/rexml/test_stream.rb index 2d9c177008..3f876aed35 100644 --- a/test/rexml/test_stream.rb +++ b/test/rexml/test_stream.rb @@ -12,11 +12,11 @@ class StreamTester < Test::Unit::TestCase # Submitted by Han Holl def test_listener data = %Q{\n} - + b = RequestReader.new( data ) b = RequestReader.new( data ) end - + def test_ticket_49 source = StringIO.new( <<-EOL ) XYZ} ) no_error( validator, %q{Option 1} ) no_error( validator, %q{Option 2} ) - + # Attribute values rng = %q{ @@ -772,13 +772,13 @@ class RNGValidation < Test::Unit::TestCase error( validator, %q{} ) error( validator, %q{} ) end - + def error( validator, source ) parser = REXML::Parsers::TreeParser.new( source ) parser.add_listener( validator.reset ) - assert_raise( REXML::Validation::ValidationException, + assert_raise( REXML::Validation::ValidationException, "Expected a validation error" ) { parser.parse } end diff --git a/test/rexml/test_xml_declaration_parent_child.rb b/test/rexml/test_xml_declaration_parent_child.rb index 6386bed4f1..d883e105c1 100644 --- a/test/rexml/test_xml_declaration_parent_child.rb +++ b/test/rexml/test_xml_declaration_parent_child.rb @@ -17,15 +17,15 @@ class TestXmlDeclaration < Test::Unit::TestCase @root = @doc.root @xml_declaration = @doc.children[0] end - + def test_xml_declaration_is_first_child assert_kind_of(REXML::XMLDecl, @xml_declaration) end - + def test_xml_declaration_has_document_as_parent assert_kind_of(REXML::Document, @xml_declaration.parent) end - + def test_xml_declaration_has_sibling assert_kind_of(REXML::XMLDecl, @root.previous_sibling.previous_sibling) assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling) diff --git a/test/rexml/test_xpath.rb b/test/rexml/test_xpath.rb index d7ab9620a8..ad09fcafb2 100644 --- a/test/rexml/test_xpath.rb +++ b/test/rexml/test_xpath.rb @@ -163,7 +163,7 @@ class XPathTester < Test::Unit::TestCase #res = XPath::first(doc, "*") #assert_equal "a", res.name - assert_equal( :processing_instruction, + assert_equal( :processing_instruction, XPath::first(doc.root, "processing-instruction()").node_type) assert_equal( :comment, XPath::first(doc.root, "comment()").node_type) end @@ -206,7 +206,7 @@ class XPathTester < Test::Unit::TestCase # Here are some XPath tests that were originally submitted by ... # The code has changed some, but the logic and the source documents are the # same. - # This method reads a document from a file, and then a series of xpaths, + # This method reads a document from a file, and then a series of xpaths, # also from a file. It then checks each xpath against the source file. def test_more xmlsource = fixture_path("testsrc.xml") @@ -222,7 +222,7 @@ class XPathTester < Test::Unit::TestCase rt = doc.root #puts "#"*80 #print "\nDoing #{line} " ; $stdout.flush - doc.elements.each(line) do |el| + doc.elements.each(line) do |el| #print "." ; $stdout.flush results.root << el.clone #results << el.to_s @@ -255,7 +255,7 @@ class XPathTester < Test::Unit::TestCase result = XPath::first( @@doc, "descendant::f[@a='c']") assert_equal "11", result.attributes['id'] - + assert_equal "11", XPath::first(@@doc, "a/e/f[@a='c']").attributes["id"] assert_equal "11", XPath::first(@@doc, "a/e/*[@a='c']").attributes["id"] end @@ -282,9 +282,9 @@ class XPathTester < Test::Unit::TestCase d = XPath.first( doc, "//d" ) assert_equal "d", d.name b = each_test( d, "ancestor::b" ) { |el| - assert((1..2) === el.attributes['id'].to_i, + assert((1..2) === el.attributes['id'].to_i, "Expected #{el.attributes['id']} to be either 1 or 2" - ) + ) } assert_equal 2, b end @@ -316,7 +316,7 @@ class XPathTester < Test::Unit::TestCase def test_lang doc = Document.new(File.new(fixture_path("lang0.xml"))) #puts IO.read( "test/lang.xml" ) - + #puts XPath.match( doc, "//language/*" ).size c = each_test( doc, "//language/*" ) { |element| #puts "#{element.name}: #{element.text}" @@ -428,9 +428,9 @@ class XPathTester < Test::Unit::TestCase assert_equal 2, res.size end - # The following three paths were provided by + # The following three paths were provided by # Jeni Tennison - # a consultant who is also an XSL and XPath expert + # a consultant who is also an XSL and XPath expert #def test_child_cubed # els = @@jeni.elements.to_a("*****") # assert_equal 3, els.size @@ -445,7 +445,7 @@ class XPathTester < Test::Unit::TestCase # results = @@jeni.root.elements[1].elements[1].elements.to_a("../following-sibling::*[*[name() = name(current())]]") # puts results #end - + # Contributed by Mike Stok def test_starts_with source = <<-EOF @@ -511,7 +511,7 @@ class XPathTester < Test::Unit::TestCase doc = Document.new source [ - #['o', 2], + #['o', 2], ['foo', 1], ['bar', 0]].each { |search, expected| set = doc.elements.to_a("//a[contains(@href, '#{search}')]") assert_equal expected, set.size @@ -614,7 +614,7 @@ class XPathTester < Test::Unit::TestCase assert_equal 1, REXML::XPath.match(doc, "//b[number(@id) = (1 mod 2)]").size assert_equal 1, REXML::XPath.match(doc, "//b[number(@id) = (4 div 2)]").size end - + # Contributed by Kouhei def test_substring_before doc = Document.new("") @@ -629,27 +629,27 @@ class XPathTester < Test::Unit::TestCase ") - assert_equal( 1, REXML::XPath.match(doc, + assert_equal( 1, REXML::XPath.match(doc, "//*[local-name()='c' and @id='b']").size ) - assert_equal( 1, REXML::XPath.match(doc, + assert_equal( 1, REXML::XPath.match(doc, "//*[ local-name()='c' and @id='b' ]").size ) - assert_equal( 1, REXML::XPath.match(doc, + assert_equal( 1, REXML::XPath.match(doc, "//*[ local-name() = 'c' and @id = 'b' ]").size ) - assert_equal( 1, + assert_equal( 1, REXML::XPath.match(doc, '/a/c[@id]').size ) assert_equal( 1, REXML::XPath.match(doc, '/a/c[(@id)]').size ) - assert_equal( 1, + assert_equal( 1, REXML::XPath.match(doc, '/a/c[ @id ]').size ) - assert_equal( 1, + assert_equal( 1, REXML::XPath.match(doc, '/a/c[ (@id) ]').size ) - assert_equal( 1, + assert_equal( 1, REXML::XPath.match(doc, '/a/c[( @id )]').size ) - assert_equal( 1, REXML::XPath.match(doc.root, + assert_equal( 1, REXML::XPath.match(doc.root, '/a/c[ ( @id ) ]').size ) - assert_equal( 1, REXML::XPath.match(doc, + assert_equal( 1, REXML::XPath.match(doc, '/a/c [ ( @id ) ] ').size ) - assert_equal( 1, REXML::XPath.match(doc, + assert_equal( 1, REXML::XPath.match(doc, ' / a / c [ ( @id ) ] ').size ) end @@ -719,8 +719,8 @@ class XPathTester < Test::Unit::TestCase end def test_and - d = Document.new %q{} assert_equal( nil, d.root.elements["route[@run='0']"] ) assert_equal( nil, d.root.elements["route[@run='0' and @title='HNO']"] ) @@ -803,7 +803,7 @@ class XPathTester < Test::Unit::TestCase EOL rd = REXML::Document.new( src ) union = rd.get_elements('//em|//strong') - assert_equal(2, union.length, + assert_equal(2, union.length, 'Both tag types are returned by XPath union operator') end @@ -828,7 +828,7 @@ class XPathTester < Test::Unit::TestCase d = REXML::Document.new( string ) c1 = XPath.match( d, '/a/*/*[1]' ) assert_equal( 1, c1.length ) - assert_equal( 'c1', c1[0].name ) + assert_equal( 'c1', c1[0].name ) end def test_sum @@ -872,25 +872,25 @@ class XPathTester < Test::Unit::TestCase EOL - root_node = XPath.first(doc, "rss") - assert_not_nil root_node - channel_node = XPath.first(root_node, "channel") - assert_not_nil channel_node - items = XPath.match(channel_node, "*") - assert_equal 4, items.size - items = XPath.match(channel_node, "item") + root_node = XPath.first(doc, "rss") + assert_not_nil root_node + channel_node = XPath.first(root_node, "channel") + assert_not_nil channel_node + items = XPath.match(channel_node, "*") + assert_equal 4, items.size + items = XPath.match(channel_node, "item") assert_equal 3, items.size # fails end def test_ticket_42 - source = "" - doc = Document.new(source) - bElem = Element.new('b') - doc.root.add_element(bElem) - doc.elements.each('//b[name(..) = "a"]') { |x| - assert_equal x,bElem - } + source = "" + doc = Document.new(source) + bElem = Element.new('b') + doc.root.add_element(bElem) + doc.elements.each('//b[name(..) = "a"]') { |x| + assert_equal x,bElem + } end def test_ticket_56 @@ -900,7 +900,7 @@ class XPathTester < Test::Unit::TestCase column_headers = [] - REXML::XPath.each(finaldoc, '//h:form[@action="ModifyCampaign"]//h:th', + REXML::XPath.each(finaldoc, '//h:form[@action="ModifyCampaign"]//h:th', namespaces) do |el| node = REXML::XPath.first(el, 'h:a/text()', namespaces) column_headers << (node ? node.value : nil) @@ -915,17 +915,17 @@ class XPathTester < Test::Unit::TestCase def test_ticket_70 string = < - Text1, text, -text + - Text2, text, -text + Text1, text, +text - - + Text2, text, +text + + + EOF doc = Document.new string @@ -933,7 +933,7 @@ EOF end def test_ticket_43 - #url = http://news.search.yahoo.com/news/rss?p=market&ei=UTF-8&fl=0&x=wrt + #url = http://news.search.yahoo.com/news/rss?p=market&ei=UTF-8&fl=0&x=wrt sum = Document.new(File.new(fixture_path("yahoo.xml"))).elements.to_a("//item").size assert_equal( 10, sum ) @@ -988,12 +988,12 @@ EOF def ticket_61_fixture(doc, xpath) matches = [] doc.elements.each(xpath) do |element| - matches << element - assert_equal('Add', element.text) + matches << element + assert_equal('Add', element.text) assert_equal('ButtonText', element.attributes['class']) end assert_equal(1, matches.length) - end + end def test_ticket_61_text file = File.open(fixture_path("ticket_61.xml")) diff --git a/test/rexml/test_xpath_attribute_query.rb b/test/rexml/test_xpath_attribute_query.rb index 99439f2286..c0ad2c2e8c 100644 --- a/test/rexml/test_xpath_attribute_query.rb +++ b/test/rexml/test_xpath_attribute_query.rb @@ -6,7 +6,7 @@ require 'test/unit' require 'rexml/document' class TestRexmlXpathAttributeQuery < Test::Unit::TestCase - + # xmlstr1 and xmlstr2 only differ in the second line - namespaces in the root element @@xmlstr1 = ' @@ -26,7 +26,7 @@ class TestRexmlXpathAttributeQuery < Test::Unit::TestCase ' - + @@xmlstr2 = ' http://www.google.com/calendar/feeds/me%40gmail.com @@ -44,22 +44,22 @@ class TestRexmlXpathAttributeQuery < Test::Unit::TestCase ' - + # Fails def test_xpath_query do_test @@xmlstr1 end - + # Passes def test_xpath_query_no_namespace do_test @@xmlstr2 end - + def do_test(xmlString) - hrefs = [ - "http://www.google.com/calendar/feeds/me%40gmail.com/private/full", - "http://www.google.com/calendar/feeds/me%40gmail.com/acl/full", - "http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com" + hrefs = [ + "http://www.google.com/calendar/feeds/me%40gmail.com/private/full", + "http://www.google.com/calendar/feeds/me%40gmail.com/acl/full", + "http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com" ] ctr=0 REXML::Document.new(xmlString).elements.each("feed/entry") do |element| @@ -70,13 +70,13 @@ class TestRexmlXpathAttributeQuery < Test::Unit::TestCase end end - + def test_another_way doc = REXML::Document.new(@@xmlstr1) - hrefs = [ - "http://www.google.com/calendar/feeds/me%40gmail.com/private/full", - "http://www.google.com/calendar/feeds/me%40gmail.com/acl/full", - "http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com" + hrefs = [ + "http://www.google.com/calendar/feeds/me%40gmail.com/private/full", + "http://www.google.com/calendar/feeds/me%40gmail.com/acl/full", + "http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com" ] ctr=0 REXML::XPath.each(doc, "//link[@rel='alternate']") do |element| diff --git a/test/rexml/test_xpath_pred.rb b/test/rexml/test_xpath_pred.rb index 373a7f562b..584358966a 100644 --- a/test/rexml/test_xpath_pred.rb +++ b/test/rexml/test_xpath_pred.rb @@ -20,7 +20,7 @@ class XPathPredicateTester < Test::Unit::TestCase EOL - + def setup @doc = REXML::Document.new( SRC ) @parser = REXML::Parsers::XPathParser.new @@ -48,8 +48,8 @@ class XPathPredicateTester < Test::Unit::TestCase assert_equal( 1, m.size ) assert_equal( "1", m[0].attributes["id"] ) end - - def do_path( path ) + + def do_path( path ) m = REXML::XPath.match( @doc, path ) #puts path, @parser.parse( path ).inspect return m diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index b7f1a0093b..3eebbfafca 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -462,7 +462,7 @@ class TestMarshal < Test::Unit::TestCase attr_reader :foo end private_constant :PrivateClass - + def test_marshal_private_class o1 = PrivateClass.new("test") o2 = Marshal.load(Marshal.dump(o1)) diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 10b2708804..0dcfeccef9 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -141,7 +141,7 @@ class TestModule < Test::Unit::TestCase :bClass3 end end - + class CClass < BClass def self.cClass end diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index 66faa70a76..743b71d73f 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -146,7 +146,7 @@ class TestSuper < Test::Unit::TestCase @first or fail end - def subseq + def subseq @first or fail end end diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 838a7692f7..6a00b99443 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -176,7 +176,7 @@ class TestTime < Test::Unit::TestCase t = Time.at(2**40 + "1/3".to_r, 9999999999999).utc assert_equal(36812, t.year) - + t = Time.at(-0x3fff_ffff_ffff_ffff) assert_equal(-146138510344, t.year) t = Time.at(-0x4000_0000_0000_0000) diff --git a/test/rubygems/test_gem_commands_unpack_command.rb b/test/rubygems/test_gem_commands_unpack_command.rb index 8291a6b949..8764a4017b 100644 --- a/test/rubygems/test_gem_commands_unpack_command.rb +++ b/test/rubygems/test_gem_commands_unpack_command.rb @@ -21,7 +21,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase util_make_gems assert_equal( - @cmd.find_in_cache(@a1.file_name), + @cmd.find_in_cache(@a1.file_name), Gem.cache_gem(@a1.file_name, @gemhome), 'found a-1.gem in the cache' ) @@ -31,7 +31,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase util_make_gems util_setup_fake_fetcher util_setup_spec_fetcher @a1 - + a1_data = nil open Gem.cache_gem(@a1.file_name, @gemhome), 'rb' do |fp| @@ -40,19 +40,19 @@ class TestGemCommandsUnpackCommand < Gem::TestCase Gem::RemoteFetcher.fetcher.data['http://gems.example.com/gems/a-1.gem'] = a1_data - + dep = Gem::Dependency.new(@a1.name, @a1.version) assert_equal( - @cmd.get_path(dep), - Gem.cache_gem(@a1.file_name, @gemhome), + @cmd.get_path(dep), + Gem.cache_gem(@a1.file_name, @gemhome), 'fetches a-1 and returns the cache path' ) FileUtils.rm Gem.cache_gem(@a1.file_name, @gemhome) assert_equal( - @cmd.get_path(dep), - Gem.cache_gem(@a1.file_name, @gemhome), + @cmd.get_path(dep), + Gem.cache_gem(@a1.file_name, @gemhome), 'when removed from cache, refetches a-1' ) end diff --git a/test/rubygems/test_gem_platform.rb b/test/rubygems/test_gem_platform.rb index 666669b233..485bab72a2 100644 --- a/test/rubygems/test_gem_platform.rb +++ b/test/rubygems/test_gem_platform.rb @@ -235,7 +235,7 @@ class TestGemPlatform < Gem::TestCase util_set_arch 'java' assert_match 'java', Gem::Platform.local assert_match 'jruby', Gem::Platform.local - + util_set_arch 'universal-dotnet2.0' assert_match 'universal-dotnet', Gem::Platform.local assert_match 'universal-dotnet-2.0', Gem::Platform.local @@ -243,13 +243,13 @@ class TestGemPlatform < Gem::TestCase assert_match 'dotnet', Gem::Platform.local assert_match 'dotnet-2.0', Gem::Platform.local refute_match 'dotnet-4.0', Gem::Platform.local - + util_set_arch 'universal-dotnet4.0' assert_match 'universal-dotnet', Gem::Platform.local - refute_match 'universal-dotnet-2.0', Gem::Platform.local + refute_match 'universal-dotnet-2.0', Gem::Platform.local assert_match 'universal-dotnet-4.0', Gem::Platform.local assert_match 'dotnet', Gem::Platform.local - refute_match 'dotnet-2.0', Gem::Platform.local + refute_match 'dotnet-2.0', Gem::Platform.local assert_match 'dotnet-4.0', Gem::Platform.local util_set_arch 'powerpc-darwin' diff --git a/test/rubygems/test_gem_silent_ui.rb b/test/rubygems/test_gem_silent_ui.rb index 1968a89b28..8005b3b1cc 100644 --- a/test/rubygems/test_gem_silent_ui.rb +++ b/test/rubygems/test_gem_silent_ui.rb @@ -55,7 +55,7 @@ class TestGemSilentUI < Gem::TestCase assert_empty out, 'No output' assert_empty err, 'No output' - + out, err = capture_io do use_ui @sui do value = @sui.ask_yes_no 'Problem?', true @@ -66,7 +66,7 @@ class TestGemSilentUI < Gem::TestCase assert_empty err, 'No output' assert value, 'Value is true' - + out, err = capture_io do use_ui @sui do value = @sui.ask_yes_no 'Problem?', false diff --git a/test/syck/test_null.rb b/test/syck/test_null.rb index b38bf50fba..8bd710fe5e 100644 --- a/test/syck/test_null.rb +++ b/test/syck/test_null.rb @@ -11,7 +11,7 @@ module Syck --- - ~ - null -- +- - Null - NULL eoyml diff --git a/test/syck/test_struct.rb b/test/syck/test_struct.rb index 547c5f2d71..8d4c538d98 100644 --- a/test/syck/test_struct.rb +++ b/test/syck/test_struct.rb @@ -30,7 +30,7 @@ module Syck def test_load obj = YAML.load(<<-eoyml) ---- !ruby/struct:StructWithIvar +--- !ruby/struct:StructWithIvar foo: bar @bar: hello eoyml diff --git a/test/syck/test_yaml.rb b/test/syck/test_yaml.rb index b346de4bee..7edf79dbe6 100644 --- a/test/syck/test_yaml.rb +++ b/test/syck/test_yaml.rb @@ -505,7 +505,7 @@ EoY WHOIS lookup made at 11:56:46 19-Mar-2010 --- +-- This WHOIS information is provided for free by Nominet UK the central registry for .uk domain names. This information and the .uk WHOIS are: @@ -517,7 +517,7 @@ includes restrictions on: (A) use of the data for advertising, or its repackaging, recompilation, redistribution or reuse (B) obscuring, removing or hiding any or all of this notice and (C) exceeding query rate or volume limits. The data is provided on an 'as-is' basis and may lag behind the -register. Access may be withdrawn or restricted at any time. +register. Access may be withdrawn or restricted at any time. EoY end diff --git a/test/test_pstore.rb b/test/test_pstore.rb index b6f79251da..b5deb9f359 100644 --- a/test/test_pstore.rb +++ b/test/test_pstore.rb @@ -100,7 +100,7 @@ class PStoreTest < Test::Unit::TestCase File.unlink("pstore.tmp2.#{Process.pid}") rescue nil end end - + def test_nested_transaction_raises_error assert_raise(PStore::Error) do @pstore.transaction { @pstore.transaction { } } diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb index 9c1818fac2..b0ffe0866d 100644 --- a/test/thread/test_queue.rb +++ b/test/thread/test_queue.rb @@ -28,7 +28,7 @@ class TestQueue < Test::Unit::TestCase num_objects.times { from_workers.pop } } }.join - + num_threads.times { to_workers.push nil } workers.each { |t| t.join } diff --git a/test/webrick/test_cookie.rb b/test/webrick/test_cookie.rb index 1275dc8eff..48f0235aeb 100644 --- a/test/webrick/test_cookie.rb +++ b/test/webrick/test_cookie.rb @@ -56,7 +56,7 @@ class TestWEBrickCookie < Test::Unit::TestCase def test_parse_non_whitespace data = [ - '$Version="1";', + '$Version="1";', 'Customer="WILE_E_COYOTE";$Path="/acme";', 'Part_Number="Rocket_Launcher_0001";$Path="/acme";', 'Shipping="FedEx";$Path="/acme"' diff --git a/test/webrick/test_httprequest.rb b/test/webrick/test_httprequest.rb index 0f411d9859..2d96c2fcb0 100644 --- a/test/webrick/test_httprequest.rb +++ b/test/webrick/test_httprequest.rb @@ -309,7 +309,7 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase msg = <<-_end_of_message_ POST /path HTTP/1.1 Expect: 100-continue - + _end_of_message_ msg.gsub!(/^ {6}/, "") req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP) @@ -325,7 +325,7 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase def test_continue_not_sent msg = <<-_end_of_message_ POST /path HTTP/1.1 - + _end_of_message_ msg.gsub!(/^ {6}/, "") req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP) diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb index aa6504059f..2b34d273e2 100644 --- a/test/win32ole/test_win32ole_variant.rb +++ b/test/win32ole/test_win32ole_variant.rb @@ -383,7 +383,7 @@ if defined?(WIN32OLE_VARIANT) end # this test failed because of VariantTimeToSystemTime - # and SystemTimeToVariantTime API ignores wMilliseconds + # and SystemTimeToVariantTime API ignores wMilliseconds # member of SYSTEMTIME struct. # # def test_conversion_time_nsec2date diff --git a/time.c b/time.c index 2c6104a501..cffe12a77b 100644 --- a/time.c +++ b/time.c @@ -4363,7 +4363,7 @@ strftimev(const char *fmt, VALUE time) * -0001, 0000, 1995, 2009, 14292, etc. * %C - year / 100 (round down. 20 in 2009) * %y - year % 100 (00..99) - * + * * %m - Month of the year, zero-padded (01..12) * %_m blank-padded ( 1..12) * %-m no-padded (1..12) @@ -4372,13 +4372,13 @@ strftimev(const char *fmt, VALUE time) * %b - The abbreviated month name (``Jan'') * %^b uppercased (``JAN'') * %h - Equivalent to %b - * + * * %d - Day of the month, zero-padded (01..31) * %-d no-padded (1..31) * %e - Day of the month, blank-padded ( 1..31) * * %j - Day of the year (001..366) - * + * * Time (Hour, Minute, Second, Subsecond): * %H - Hour of the day, 24-hour clock, zero-padded (00..23) * %k - Hour of the day, 24-hour clock, blank-padded ( 0..23) @@ -4386,24 +4386,24 @@ strftimev(const char *fmt, VALUE time) * %l - Hour of the day, 12-hour clock, blank-padded ( 1..12) * %P - Meridian indicator, lowercase (``am'' or ``pm'') * %p - Meridian indicator, uppercase (``AM'' or ``PM'') - * + * * %M - Minute of the hour (00..59) - * + * * %S - Second of the minute (00..60) - * + * * %L - Millisecond of the second (000..999) * %N - Fractional seconds digits, default is 9 digits (nanosecond) * %3N millisecond (3 digits) * %6N microsecond (6 digits) * %9N nanosecond (9 digits) * %12N picosecond (12 digits) - * + * * Time zone: * %z - Time zone as hour and minute offset from UTC (e.g. +0900) * %:z - hour and minute offset from UTC with a colon (e.g. +09:00) * %::z - hour, minute and second offset from UTC (e.g. +09:00:00) * %Z - Time zone abbreviation name - * + * * Weekday: * %A - The full weekday name (``Sunday'') * %^A uppercased (``SUNDAY'') @@ -4411,7 +4411,7 @@ strftimev(const char *fmt, VALUE time) * %^a uppercased (``SUN'') * %u - Day of the week (Monday is 1, 1..7) * %w - Day of the week (Sunday is 0, 0..6) - * + * * ISO 8601 week-based year and week number: * The week 1 of YYYY starts with a Monday and includes YYYY-01-04. * The days in the year before the first week are in the last week of @@ -4419,21 +4419,21 @@ strftimev(const char *fmt, VALUE time) * %G - The week-based year * %g - The last 2 digits of the week-based year (00..99) * %V - Week number of the week-based year (01..53) - * + * * Week number: * The week 1 of YYYY starts with a Sunday or Monday (according to %U * or %W). The days in the year before the first week are in week 0. * %U - Week number of the year. The week starts with Sunday. (00..53) * %W - Week number of the year. The week starts with Monday. (00..53) - * + * * Seconds since the Epoch: * %s - Number of seconds since 1970-01-01 00:00:00 UTC. - * + * * Literal string: * %n - Newline character (\n) * %t - Tab character (\t) * %% - Literal ``%'' character - * + * * Combination: * %c - date and time (%a %b %e %T %Y) * %D - Date (%m/%d/%y) @@ -4459,7 +4459,7 @@ strftimev(const char *fmt, VALUE time) * t = Time.new(2007,11,19,8,37,48,"-06:00") #=> 2007-11-19 08:37:48 -0600 * t.strftime("Printed on %m/%d/%Y") #=> "Printed on 11/19/2007" * t.strftime("at %I:%M%p") #=> "at 08:37AM" - * + * * Various ISO 8601 formats: * %Y%m%d => 20071119 Calendar date (basic) * %F => 2007-11-19 Calendar date (extended) diff --git a/tool/asm_parse.rb b/tool/asm_parse.rb index f3d7f73c99..e39580c1a1 100755 --- a/tool/asm_parse.rb +++ b/tool/asm_parse.rb @@ -7,7 +7,7 @@ while line = ARGF.gets puts line size = 0 len = 0 - + while line = ARGF.gets if /\[start\] (\w+)/ =~ line puts "\t; # length: #{len}, size: #{size}" @@ -29,8 +29,8 @@ while line = ARGF.gets size += 1 end end - - + + if /__NEXT_INSN__/ !~ line && /\[end \] (\w+)/ =~ line ename = $1 if name != ename diff --git a/tool/eval.rb b/tool/eval.rb index ced244a4da..18e645a314 100755 --- a/tool/eval.rb +++ b/tool/eval.rb @@ -86,7 +86,7 @@ def parse_result data else raise "not a data" end - + end if /benchmark summary/ =~ line flag = true diff --git a/tool/instruction.rb b/tool/instruction.rb index 4fd2127be2..9dc7604170 100755 --- a/tool/instruction.rb +++ b/tool/instruction.rb @@ -35,7 +35,7 @@ class RubyVM @sc << sci sci.set_sc end - + attr_reader :name, :opes, :pops, :rets attr_reader :body, :comm attr_reader :nextsc, :pushsc @@ -45,11 +45,11 @@ class RubyVM attr_reader :is_sc attr_reader :tvars attr_reader :sp_inc - + def set_sc @is_sc = true end - + def add_unif insns @unifs << insns end @@ -84,7 +84,7 @@ class RubyVM "return depth + #{rets.size - pops.size};" end end - + def inspect "#" end @@ -113,7 +113,7 @@ class RubyVM attr_reader :vpath attr_reader :destdir - + %w[use_const verbose].each do |attr| attr_reader attr alias_method "#{attr}?", attr @@ -455,7 +455,7 @@ class RubyVM rv = rpvars[1] "#define #{pv[1]} #{rv[1]}" }.join("\n") + - "\n" + + "\n" + redef_vars.map{|v, type| "#define #{v} #{v}_#{i}" }.join("\n") + "\n" + @@ -693,7 +693,7 @@ class RubyVM } } end - + def make_header_operands insn comment " /* declare and get from iseq */" @@ -718,7 +718,7 @@ class RubyVM # ops.join commit ops.reverse end - + def make_header_default_operands insn vars = insn.defopes @@ -907,7 +907,7 @@ class RubyVM commit " ELABEL_PTR(#{insn.name}),\n" } end - + ERB.new(vpath.read('template/vmtc.inc.tmpl')).result(binding) end end @@ -1156,7 +1156,7 @@ class RubyVM uni_insns.map{|e| "BIN(#{e.name})"}.join(", ") + "};\n" } else - + end if size > 0 unif_insns << "static const int *const UNIFIED_#{insn.name}[] = {(int *)#{size+1}, \n" diff --git a/tool/mdoc2man.rb b/tool/mdoc2man.rb index 0922474b47..274f2d5d08 100755 --- a/tool/mdoc2man.rb +++ b/tool/mdoc2man.rb @@ -10,7 +10,7 @@ ### Copyright (c) 2001 Mark D. Roth ### Copyright (c) 2002, 2003 Akinori MUSHA ### All rights reserved. -### +### ### Redistribution and use in source and binary forms, with or without ### modification, are permitted provided that the following conditions ### are met: @@ -26,7 +26,7 @@ ### 4. The University nor the names of their ### contributors may be used to endorse or promote products derived from ### this software without specific prior written permission. -### +### ### THIS SOFTWARE IS PROVIDED BY THE TRUSTEES AND CONTRIBUTORS ``AS IS'' AND ### ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ### IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -210,7 +210,7 @@ class Mdoc2Man retval << 'and ' unless retval.empty? retval << @refauthors.shift - # title + # title retval << ', \\fI' << @reftitle << '\\fP' # issue diff --git a/tool/strip-rdoc.rb b/tool/strip-rdoc.rb index dc4c3dc5dc..449f9b71a8 100755 --- a/tool/strip-rdoc.rb +++ b/tool/strip-rdoc.rb @@ -1,7 +1,7 @@ #!ruby source = ARGF.read -source = source.gsub(%r{/\*([!*])((?!\*/).+?)\*/}m) do |comment| +source = source.gsub(%r{/\*([!*])((?!\*/).+?)\*/}m) do |comment| marker, comment = $1, $2 next "/**#{comment}*/" unless /^\s*\*\s?\-\-\s*$/ =~ comment doxybody = nil diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb index 833fc219a8..dc1f6ea911 100755 --- a/tool/transcode-tblgen.rb +++ b/tool/transcode-tblgen.rb @@ -397,7 +397,7 @@ class ActionMap end def inspect - "\#<#{self.class}:" + + "\#<#{self.class}:" + @tree.inspect + ">" end