mattbrictson / mattbrictson/bundleup

`nil` not handled in `Bundleup::Colors.strip`

Open Beginner friendly
#290 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
193
Forks
6
Avg merge
4m
Merged PRs (30d)
1

Description

I got `'Bundleup::Colors.strip': undefined method 'gsub' for nil (NoMethodError)` running `bundleup`

Added some debug code like below (`lib/bundleup/report.rb`
```ruby
def max_length_of_each_column(rows)
puts "rows.inspect"
puts rows.inspect
Array.new(rows.first.count) do |i|
rows.map { |values| Colors.strip(values[i]).length }.max
end
end
```

and results in
```
rows.inspect
[["database_cleaner-core", "2.0.1", "→", "2.1.0", ":", "pinned at", "2026-06-01", nil, ""], ["i18n-js", "3.9.2", "→", "4.2.4", ":", "pinned at", "~>", "3.9.2", "\e[0;90;49m# Export translations to JS\e[0m"], ["ruby_jard", "0.2.0", "→", "0.3.1", ":", "pinned at", ">=", "0", "\e[0;90;49m# https://rubyjard.org`\e[0m"], ["rugged", "1.6.5", "→", "1.9.4", ":", "pinned at", "~>", "1.6.5", "\e[0;90;49m# https://github.com/prontolabs/pronto/issues/447\e[0m"], ["tty-prompt", "0.22.0", "→", "0.23.1", ":", "pinned at", ">=", "0.22.0", ""], ["twitter-text", "1.14.7", "→", "3.1.0", ":", "pinned at", "~>", "1.14.7", "\e[0;90;49m# For URL extraction from text\e[0m"], ["unf", "0.1.4", "→", "0.2.0", ":", "pinned at", "2024-08-17", nil, ""], ["useragents", "0.1.4", "→", "0.1.6", ":", "pinned at", " =", "0.1.4", "\e[0;90;49m# New versions got bug and got extra nokogiri dependency\e[0m"]]
```

I dunno what generates those `nil`s, the Gemfile does not reference them (dependencies of Gemfile dependenceis

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/bundleup/report.rb at max_length_of_each_column and trace how its rows reach Bundleup::Colors.strip. Reproduce the failure with bundleup using the reported rows, then verify that nil values no longer raise NoMethodError and the command completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.