[#113407] [Ruby master Feature#19630] [RFC] Deprecate `Kernel.open("|command-here")` due to frequent security issues — "postmodern (Hal Brodigan) via ruby-core" <ruby-core@...>

Issue #19630 has been reported by postmodern (Hal Brodigan).

19 messages 2023/05/05

[#113430] [Ruby master Feature#19633] Allow passing block to `Kernel#autoload` as alternative to second `filename` argument — "shioyama (Chris Salzberg) via ruby-core" <ruby-core@...>

Issue #19633 has been reported by shioyama (Chris Salzberg).

16 messages 2023/05/09

[#113489] [Ruby master Bug#19642] Remove vectored read/write from `io.c`. — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #19642 has been reported by ioquatix (Samuel Williams).

10 messages 2023/05/15

[#113498] [Ruby master Feature#19644] Module::current to complement Module::nesting — "bughit (bug hit) via ruby-core" <ruby-core@...>

Issue #19644 has been reported by bughit (bug hit).

12 messages 2023/05/16

[#113517] [Ruby master Misc#19679] Migrate Wiki from bugs.ruby-lang.org to ruby/ruby GitHub repository — "jemmai (Jemma Issroff) via ruby-core" <ruby-core@...>

Issue #19679 has been reported by jemmai (Jemma Issroff).

11 messages 2023/05/18

[#113529] [Ruby master Bug#19681] The final classpath of partially named modules is sometimes inconsistent once permanently named — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>

Issue #19681 has been reported by byroot (Jean Boussier).

34 messages 2023/05/19

[#113538] [Ruby master Feature#19682] ability to get a reference to the "default definee" — "bughit (bug hit) via ruby-core" <ruby-core@...>

Issue #19682 has been reported by bughit (bug hit).

28 messages 2023/05/19

[#113601] [Ruby master Bug#19687] Should a development version of the standard library be included in ruby/ruby? — "jaruga (Jun Aruga) via ruby-core" <ruby-core@...>

Issue #19687 has been reported by jaruga (Jun Aruga).

9 messages 2023/05/23

[#113632] [Ruby master Bug#19691] Case insensitive file systems, require filename casing — "MSP-Greg (Greg L) via ruby-core" <ruby-core@...>

Issue #19691 has been reported by MSP-Greg (Greg L).

7 messages 2023/05/24

[#113656] [Ruby master Misc#19693] Data initialization is significantly slower than Struct — janosch-x via ruby-core <ruby-core@...>

Issue #19693 has been reported by janosch-x (Janosch M=FCller).

13 messages 2023/05/25

[#113660] [Ruby master Feature#19694] Add Regexp#timeout= setter — "aharpole (Aaron Harpole) via ruby-core" <ruby-core@...>

Issue #19694 has been reported by aharpole (Aaron Harpole).

15 messages 2023/05/25

[#113676] [Ruby master Bug#19697] Resolv::DNS resolution for international domains fails with "Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT" — "clairity (claire c) via ruby-core" <ruby-core@...>

SXNzdWUgIzE5Njk3IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGNsYWlyaXR5IChjbGFpcmUgYykuDQ0K

6 messages 2023/05/27

[ruby-core:113657] [Ruby master Feature#19644] Module::current to complement Module::nesting

From: "Eregon (Benoit Daloze) via ruby-core" <ruby-core@...>
Date: 2023-05-25 11:00:58 UTC
List: ruby-core #113657
Issue #19644 has been updated by Eregon (Benoit Daloze).


bughit (bug hit) wrote in #note-12:
> Still, a single label identifier without arguments (like `__mod(ule)__`) looks better: `"#{__module__}##{__method__}"`

Finally a concrete example (although partial): logging with `"#{__module__}##{__method__}"`.
We asked many times, I am not sure why you waited so long to show this one.
One can maybe guess what you want, but that is not productive and will not help the ticket, it will only waste time.
At a developer meeting, or earlier, if there is no concrete use case, either the proposal will be skipped or closed (maybe as Feedback to reflect the lack of a convincing and concrete example, maybe Rejected for not following the template).
It should have been part of the issue description as the [template](https://bugs.ruby-lang.org/projects/ruby/wiki/HowToRequestFeatures) says.
The template could be more explicit that an example with Ruby code is the most important, however this has already been mentioned to you in [here](https://bugs.ruby-lang.org/issues/10450#note-22) (and many other times) and is also what I meant by `This needs a concrete use case`. I'll improve the template in that direction.
And of course ideally the template should be shown when opening a new feature, there have been discussions to do that.

Now going to this example, there are two problems:
* This means every time one wants to do tracing/logging like that, they cannot just use `LOGGER.info "message"`, they would need to use `LOGGER.info "#{__module__}##{__method__} message"`. That seems very inconvenient. Maybe you want to access the caller's module? That is a different proposal then.
* This is confusing and incorrect if in a method inside class_exec/module_exec/instance_exec:

```ruby
module Foo
  def self.setup(klass)
    klass.class_exec do
      def bar
        LOGGER.info "#{__module__}##{__method__} message" # incorrect, will show `Foo#bar`, but no such method was ever defined in this program
      end
    end
  end
end

Foo.setup(String)
```

So probably the default definee would be better for that. Of course it does not address the first point.
Maybe you can realize now why I think this is closely related or a duplicate with #19682:
* They both didn't have a concrete example, were filed closely in time, and are talking about related concepts, so the use case might mix both.
* If the use case is logging, it seems you might want the default definee and not Module.nesting[0].

I also think it's of little practical value to have the module (and method) there. For the rare cases it'd be useful, one could just write the module name by hand to help tracing/debugging, or likely more useful words to identify that place (e.g. when printing in multiple places in a method). If you want to trace every method call that is also possible with TracePoint.
The file and line can already be shown, and they can be queried for the caller, so `LOGGER.info "message"` can show `INFO: foo.rb:5 message` already today. That seems plenty and is more precise.

Both of these issues are closed now, you can see I am not the only one which has a problem with such vague feature requests and the way you communicate.

---

Now I want to reply to some of your disrespectful comments, because it may help you find a better way to communicate with others.
So, apparently you are mixing both concepts of Module.nesting and default definee in this issue with the logging use case.
But yet I am not going to harass you about it, I will say it here only once, without any pejorative adjective.

In contrast, you keep claiming I don't know when [it's clear I know very well](https://github.com/oracle/truffleruby/commit/c5925bd54c00dc22bb5609e76aa3e2666b522d30).
The fact you repeat it many times does not make it more true, nobody will be fooled by that, it is just more obvious you harass people and do not know how to communicate properly.
Also you must realize that attacking everyone on this bug tracker like https://bugs.ruby-lang.org/issues/19682#note-26 is not productive and will not help your proposal, it will only help you get banned.
If you think everyone is wrong, most likely it is not the case, probably you are misreading or misinterpreting what they said or you are wrong.

In the future, and for the last time, do communicate as an adult, never harass or insult others, or leave this bug tracker/mailing list.
Never use [Ad hominem](https://en.wikipedia.org/wiki/Ad_hominem), discuss and argue the substance, not the person.
That also implies no pejorative adjectives in what you write.
It might be a good idea to ask someone to review your replies before posting them to make sure they are appropriate.

----------------------------------------
Feature #19644: Module::current to complement Module::nesting
https://bugs.ruby-lang.org/issues/19644#change-103299

* Author: bughit (bug hit)
* Status: Rejected
* Priority: Normal
----------------------------------------
Module::current == Module::nesting[0] but without needlessly walking the entire nesting hierarchy.

Could be useful for debugging/logging.

It could also be a Kernel global (like `__method__`) or a keyword (like `__FILE__`)



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

In This Thread

Prev Next