Project

General

Profile

Actions

Backport #3954

closed

Digest::Base に無引数の initialize を定義しませんか?

Added by metanest (Makoto Kishimoto) over 13 years ago. Updated over 12 years ago.

Status:
Closed

Description

=begin
背景

トランクでは r11154 より前、1.8 ブランチでは r11223 より前、リリースとしては
1.8.6 より前の Digest::(HashAlgorithm)#initialize は、ハッシュを取りたい
文字列(の先頭部分)を引数に取ることができる仕様でした。

そこに仕様の変更があり、それ以後は、SHA2 でハッシュの長さの引数を取る他は、
引数を取らなくなり、従来の、文字列を引数に指定していたスクリプトはエラーに
なるようになりました。

その後、トランクでは r26135、1.8 ブランチでは r26136 で、Object#initialize
が任意の引数を認めるように変更され( #2451 によれば Spec はそうなっている
ということですが)その結果、Digest::(HashAlgorithm)#initialize の古い書き方を
しているスクリプトがエラーにならず、しかも設定された文字列が無視されるため、
期待した結果にもならない、という状態になっています。

提案

以上を踏まえて提案なのですが、Digest に限り従来通りエラーになるように
Digest::Base に無引数の initialize を定義しませんか?
(1.9に登録しますが、1.8にもバックポートを希望します)
=end

Actions #1

Updated by knu (Akinori MUSHA) over 13 years ago

  • Status changed from Open to Assigned
  • Assignee set to knu (Akinori MUSHA)

=begin

=end

Actions #2

Updated by knu (Akinori MUSHA) over 13 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r29528.
Makoto, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions #3

Updated by knu (Akinori MUSHA) over 13 years ago

  • Category set to ext
  • Status changed from Closed to Assigned
  • Target version set to Ruby 1.8.8

=begin

=end

Actions #4

Updated by knu (Akinori MUSHA) over 13 years ago

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r29656.
Makoto, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions #5

Updated by shyouhei (Shyouhei Urabe) over 13 years ago

=begin
確認ですがこれはバグなんでしょうか仕様変更でしょうか。つまり、1.8.7はどうすべき?
=end

Actions #6

Updated by knu (Akinori MUSHA) over 13 years ago

=begin
1.8.7には入れなくていいと思います。

ただ、私は今1.8.7先端を試せないのですがもし ruby-1.8.7 -rdigest -e 'Digest::Base.new' でコアを吐くようなら入れてください。(1.9.2は出るので要修正です)
=end

Actions #7

Updated by knu (Akinori MUSHA) over 13 years ago

  • Status changed from Closed to Assigned

=begin
r29528 はまだ1.9.2にbackportされていないようですね。 #note-6 のコードで死ぬと思うのでbackportが必要です。
=end

Actions #8

Updated by knu (Akinori MUSHA) over 13 years ago

  • Assignee changed from knu (Akinori MUSHA) to yugui (Yuki Sonoda)
  • Priority changed from 3 to Normal

=begin

=end

Actions #9

Updated by shyouhei (Shyouhei Urabe) over 13 years ago

  • Assignee changed from yugui (Yuki Sonoda) to knu (Akinori MUSHA)
  • Priority changed from Normal to 3

=begin
1.8.7は死にませんでしたのでバックポートしないことに決めました。
=end

Actions #10

Updated by shyouhei (Shyouhei Urabe) over 13 years ago

  • Assignee changed from knu (Akinori MUSHA) to yugui (Yuki Sonoda)
  • Priority changed from 3 to Normal

=begin

=end

Actions #11

Updated by knu (Akinori MUSHA) over 12 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r29528.
Makoto, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ext/digest/digest.c (rb_digest_class_init): Define
    Digest::Class.new(). [Feature #3954]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0