Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move deprecation_warning from lib/thor.rb to lib/thor/base.rb #703

Closed
BrianHawley opened this issue Dec 16, 2019 · 1 comment · Fixed by #704
Closed

Move deprecation_warning from lib/thor.rb to lib/thor/base.rb #703

BrianHawley opened this issue Dec 16, 2019 · 1 comment · Fixed by #704

Comments

@BrianHawley
Copy link
Contributor

Projects like Rails use thor by require 'thor/group' rather than require 'thor'. This can cause a problem because the deprecation_warning method added in version 1.0.0 is defined in "ib/thor.rb", which doesn't get required, but is referenced in "lib/thor/base.rb" and "lib/thor/parser/option.rb".

The safest solution would be to move the deprecation_warning method to "lib/thor/base.rb" and let the Thor class get it when "thor/base" is required.

A temporary workaround to get thor 1.0.0 working is to add an explicit gem 'thor' reference to your Gemfile, which will require "thor" as a side effect.

BrianHawley added a commit to BrianHawley/thor that referenced this issue Dec 16, 2019
Make deprecation_warning available in Thor::Base and Thor::Optiopn when
"thor" is not required, by moving it to "lib/thor/base.rb" which will
be required.

[Fixes rails#703]
BrianHawley added a commit to BrianHawley/thor that referenced this issue Dec 16, 2019
Make deprecation_warning available in Thor::Base and Thor::Option when
"thor" is not required, by moving it to "lib/thor/base.rb" which will
be required.

[Fixes rails#703]
@BrianHawley
Copy link
Contributor Author

BrianHawley commented Dec 16, 2019

Note that this bug makes thor 1.0.0 non-functional in rails. Seemed worth mentioning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant