ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:48879] [Ruby trunk - Bug #10889] [Open] rdocでのスクリプトエンコーディングの挙動が違う
       [not found] <redmine.issue-10889.20150223074119@ruby-lang.org>
@ 2015-02-23  7:41 ` yamamoto
  2019-07-23 15:21 ` [ruby-dev:50817] [Ruby master Bug#10889] rdocでのスクリプトエンコーディングの挙動が違う merch-redmine
  1 sibling, 0 replies; 2+ messages in thread
From: yamamoto @ 2015-02-23  7:41 UTC (permalink / raw)
  To: ruby-dev

Issue #10889 has been reported by Sohey Yamamoto.

----------------------------------------
Bug #10889: rdocでのスクリプトエンコーディングの挙動が違う
https://bugs.ruby-lang.org/issues/10889

* Author: Sohey Yamamoto
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.0.0p598 (2014-11-13) [i386-mingw32]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
以下のような、マジックコメントの前に文字があるスタイルでスクリプトエンコーディングを指定した場合、
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 -*-
~~~




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-dev:50817] [Ruby master Bug#10889] rdocでのスクリプトエンコーディングの挙動が違う
       [not found] <redmine.issue-10889.20150223074119@ruby-lang.org>
  2015-02-23  7:41 ` [ruby-dev:48879] [Ruby trunk - Bug #10889] [Open] rdocでのスクリプトエンコーディングの挙動が違う yamamoto
@ 2019-07-23 15:21 ` merch-redmine
  1 sibling, 0 replies; 2+ messages in thread
From: merch-redmine @ 2019-07-23 15:21 UTC (permalink / raw)
  To: ruby-dev

Issue #10889 has been updated by jeremyevans0 (Jeremy Evans).

Status changed from Open to Closed

This appears to have been fixed between Ruby 2.4 (RDoc 5.0.0) and Ruby 2.5 (RDoc 6.0.1):

```
$ rdoc24 -o renc-rdoc renc.rb
Parsing sources...
100% [ 1/ 1]  renc.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

$ rdoc25 -o renc-rdoc renc.rb
Parsing sources...
100% [ 1/ 1]  renc.rb

Generating Darkfish format into /path/renc-rdoc...

  Files:      1

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

  Total:      1 (0 undocumented)
  100.00% documented

  Elapsed: 0.3s

```

----------------------------------------
Bug #10889: rdocでのスクリプトエンコーディングの挙動が違う
https://bugs.ruby-lang.org/issues/10889#change-79879

* Author: sohey (Sohey Yamamoto)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.0.0p598 (2014-11-13) [i386-mingw32]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
以下のような、マジックコメントの前に文字があるスタイルでスクリプトエンコーディングを指定した場合、
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 -*-
~~~




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-23 15:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-10889.20150223074119@ruby-lang.org>
2015-02-23  7:41 ` [ruby-dev:48879] [Ruby trunk - Bug #10889] [Open] rdocでのスクリプトエンコーディングの挙動が違う yamamoto
2019-07-23 15:21 ` [ruby-dev:50817] [Ruby master Bug#10889] rdocでのスクリプトエンコーディングの挙動が違う merch-redmine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).