Skip to content

Commit

Permalink
Fix FrozenError: can't modify frozen String: "google" (FrozenError) w…
Browse files Browse the repository at this point in the history
…hen running ping_search_engines

Backtrace:

FrozenError: can't modify frozen String: "google" (FrozenError)
/Users/nicolas/PROJECTS/CONCERTO/concerto/.bundle/ruby/3.2.0/bundler/gems/sitemap_generator-426a0b86cb56/lib/sitemap_generator/utilities.rb:145:in `gsub!'
/Users/nicolas/PROJECTS/CONCERTO/concerto/.bundle/ruby/3.2.0/bundler/gems/sitemap_generator-426a0b86cb56/lib/sitemap_generator/utilities.rb:145:in `titleize'
/Users/nicolas/PROJECTS/CONCERTO/concerto/.bundle/ruby/3.2.0/bundler/gems/sitemap_generator-426a0b86cb56/lib/sitemap_generator/link_set.rb:296:in `block in ping_search_engines'
/Users/nicolas/PROJECTS/CONCERTO/concerto/.bundle/ruby/3.2.0/bundler/gems/sitemap_generator-426a0b86cb56/lib/sitemap_generator/link_set.rb:294:in `each'
/Users/nicolas/PROJECTS/CONCERTO/concerto/.bundle/ruby/3.2.0/bundler/gems/sitemap_generator-426a0b86cb56/lib/sitemap_generator/link_set.rb:294:in `ping_search_engines'
/Users/nicolas/PROJECTS/CONCERTO/concerto/.bundle/ruby/3.2.0/bundler/gems/sitemap_generator-426a0b86cb56/lib/sitemap_generator.rb:44:in `method_missing'
/Users/nicolas/PROJECTS/CONCERTO/concerto/app/concepts/system/operation/refresh_sitemap.rb:11:in `refresh_sitemap!'
  • Loading branch information
n-rodriguez committed Jan 12, 2024
1 parent 2a88286 commit c518f54
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/sitemap_generator/utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def with_warnings(flag)
end

def titleize(string)
string = string.dup if string.frozen?
string.gsub!(/_/, ' ')
string.split(/(\W)/).map(&:capitalize).join
end
Expand Down

0 comments on commit c518f54

Please sign in to comment.