Project

General

Profile

Actions

Bug #10889

closed

rdocでのスクリプトエンコーディングの挙動が違う

Added by sohey (Sohey Yamamoto) about 9 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p598 (2014-11-13) [i386-mingw32]
[ruby-dev:48879]

Description

以下のような、マジックコメントの前に文字があるスタイルでスクリプトエンコーディングを指定した場合、
rubyスクリプトとしては正常に認識されますが、rdocでは認識されません。

#========== -*- coding: utf-8 -*-
# test
#================================
p __ENCODING__
# テスト
def test_method
  puts 'テスト'
end

test_method

実行結果

[d:\tmp] ruby test.rb
#<Encoding:UTF-8>
テスト
[d:\tmp] rdoc -v
4.2.0
[d:\tmp] rdoc test.rb
Parsing sources...
100% [ 1/ 1]  test.rb

No newer files.

  Files:      1

  Classes:    0 (0 undocumented)
  Modules:    0 (0 undocumented)
  Constants:  0 (0 undocumented)
  Attributes: 0 (0 undocumented)
  Methods:    0 (0 undocumented)

  Total:      0 (0 undocumented)
    0.00% documented

  Elapsed: 0.0s

[d:\tmp]

余分な文字を入れない場合は正しく認識されます。

# -*- coding: utf-8 -*-
Actions

Also available in: Atom PDF

Like0
Like0