dry-rb / dry-inflector

Inflector for Ruby
https://dry-rb.org/gems/dry-inflector
MIT License
95 stars 15 forks source link

Fix `Dry::Inflector#constantize` to not inherit constants from sibling namespaces #32

Closed jodosha closed 3 years ago

jodosha commented 3 years ago
module Foo
  module Bar
    VERSION = "0.1.0"
  end

  module Baz
  end
end

module Test
end

module Check
end

inflector = Dry::Inflector.new

# BEFORE
inflector.constantize("Foo::Baz::VERSION") # => VERSION
inflector.constantize("Test::Check") # => Check

# AFTER
inflector.constantize("Foo::Baz::VERSION") # => raises NameError
inflector.constantize("Test::Check") # => raises NameError
flash-gordon commented 3 years ago

CHANGELOG.md files are automatically generated from changelog.yml and we should have a banner about that... /cc @solnic

solnic commented 3 years ago

we should have a banner about that

@flash-gordon what kind of a banner?

flash-gordon commented 3 years ago

@solnic "# DO NOT EDIT. THIS FILE IS AUTOMATICALLY GENERATED" kind of banner :)

solnic commented 3 years ago

@flash-gordon ah yeah, totally. I'll add it then!

jodosha commented 3 years ago

@flash-gordon My apologize, I didn't remember about that. :/

solnic commented 3 years ago

I wonder if we could configure git/github so that pushing certain files is only allowed by dry-bot 🤔