Project

General

Profile

Actions

Feature #14316

closed

Update Status Code classes

Added by znz (Kazuhiro NISHIYAMA) almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Assignee:
-
Target version:
[ruby-core:84645]

Description

In lib/net/http/responses.rb, some class names are old names.
So I would like to update and add 103 Early Hints if no objection.

see https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml


Files

0001-Specify-frozen_string_literal-true.patch (697 Bytes) 0001-Specify-frozen_string_literal-true.patch znz (Kazuhiro NISHIYAMA), 01/05/2018 01:51 PM
0002-Add-103-Early-Hints.patch (1.11 KB) 0002-Add-103-Early-Hints.patch znz (Kazuhiro NISHIYAMA), 01/05/2018 01:51 PM
0003-Update-Status-Code.patch (3.93 KB) 0003-Update-Status-Code.patch znz (Kazuhiro NISHIYAMA), 01/05/2018 01:51 PM

Updated by normalperson (Eric Wong) almost 7 years ago

wrote:

0001-Specify-frozen_string_literal-true.patch (697 Bytes)

0001 seems pointless, only strings in that file are literal hash
keys and they are all frozen since 2.1
(I also wrote
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/438693
the other day)

0002-Add-103-Early-Hints.patch (1.11 KB)

Seems fine.

0003-Update-Status-Code.patch (3.93 KB)

Thank you for keeping old constants for compatibility. I guess
new constants are nice for people reading current documentation;
but they add cognitive overhead for users experienced with the
old names :<

I wonder if we should slowly move towards using classes based on
the numbers instead, and leave the unstable English phrasing out
of our API...

Updated by naruse (Yui NARUSE) almost 7 years ago

Looks fine.
Could you commit them?

0001-Specify-frozen_string_literal-true.patch (697 Bytes)

0001 seems pointless, only strings in that file are literal hash
keys and they are all frozen since 2.1

This patch actually does nothing.
But it prevents that a future change accidentally adds mutable strings.
This change also fine to me.

Updated by znz (Kazuhiro NISHIYAMA) almost 7 years ago

  • Status changed from Open to Closed

I commited at r61633, r61634, r61635.

Updated by znz (Kazuhiro NISHIYAMA) almost 7 years ago

I wonder if we should slowly move towards using classes based on
the numbers instead, and leave the unstable English phrasing out
of our API...

I think Net::HTTP::STATUS_CODES is added for such purpose.
https://bugs.ruby-lang.org/issues/12935

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0