Skip to content

Commit

Permalink
fix: Ensure icons with commas do not break Hash generator
Browse files Browse the repository at this point in the history
  • Loading branch information
heyvito committed Aug 10, 2023
1 parent a4fa36f commit 0b50525
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ GEM
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
method_source (1.0.0)
mini_portile2 (2.8.4)
minitest (5.16.3)
nokogiri (1.13.8-aarch64-linux)
racc (~> 1.4)
nokogiri (1.13.8-x86_64-linux)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
parallel (1.22.1)
parser (3.1.2.1)
Expand Down Expand Up @@ -120,6 +120,7 @@ GEM

PLATFORMS
aarch64-linux
x86_64-darwin-22
x86_64-linux

DEPENDENCIES
Expand Down
2 changes: 1 addition & 1 deletion lib/lucide-rails/icon_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def memory

file_path = LucideRails::GEM_ROOT.join("icons/stripped.bin.gz")
data = ActiveSupport::Gzip.decompress(File.read(file_path))
@memory = data.split("\x00").to_h { |x| x.split(",") }
@memory = data.split("\x00").to_h { |x| x.split(",", 2) }
end
end
end

2 comments on commit 0b50525

@aviflombaum
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I swear I tried adding a limit to the split and still got errors!

@heyvito
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's odd... Could you kindly confirm whether this works with your fork after updating?

Please sign in to comment.