[#109207] [Ruby master Feature#18915] New error class: NotImplementedYetError or scope change for NotImplementedYet — Quintasan <noreply@...>
Issue #18915 has been reported by Quintasan (Michał Zając).
18 messages
2022/07/14
[ruby-core:109116] [Ruby master Bug#18892] ARGF.lineno starts from 2 when the file has shebang
From:
"znz (Kazuhiro NISHIYAMA)" <noreply@...>
Date:
2022-07-02 06:11:08 UTC
List:
ruby-core #109116
Issue #18892 has been reported by znz (Kazuhiro NISHIYAMA). ---------------------------------------- Bug #18892: ARGF.lineno starts from 2 when the file has shebang https://bugs.ruby-lang.org/issues/18892 * Author: znz (Kazuhiro NISHIYAMA) * Status: Open * Priority: Normal * ruby -v: ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [aarch64-linux], ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [aarch64-linux] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Since ruby 3.0, `ARGF.lineno` starts from 2 if the file has shebang. Following example has `#!/usr/bin/env ruby`, and it can reproduce with the file has `#!` only. ``` $ cat f.rb #!/usr/bin/env ruby ARGF.each do p ARGF.lineno exit end $ RBENV_VERSION=3.1.2 ruby -v f.rb f.rb ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [aarch64-linux] 2 $ RBENV_VERSION=3.0.4 ruby -v f.rb f.rb ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [aarch64-linux] 2 $ RBENV_VERSION=2.7.6 ruby -v f.rb f.rb ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [aarch64-linux] 1 ``` -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>