Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes rubocop#7576. This PR fixes the following error for `Gemspec/OrderedDependencies` when using a local variable in an argument of dependent gem. ```console % cat example.gemspec Gem::Specification.new do |s| %w[foo bar].each { |dep| s.add_dependency dep } s.add_dependency 'baz' end % rubocop --only Gemspec/OrderedDependencies example.gemspec -d (nsip) An error occurred while Gemspec/OrderedDependencies cop was inspecting /Users/koic/src/github.com/koic/rubocop-issues/7576/example.gemspec. undefined method `str_type?' for nil:NilClass ``` Since it is difficult to trace variables and list gem names, this PR will skip them. And `add_dependency`, `add_runtime_dependency`, and `add_development_dependency` accept a symbol. e.g. `add_dependency(:foo)` The original implementation raises the same error if a symbol is passed as an argument. This PR also solves that problem. The issue for `add_dependency` and` abc` to accept symbols will open as separate a PR.
- Loading branch information