{"record":{"id":"a4f100aee7406547","repo":"ruby/rubygems","slug":"ruby-code-case-not-handled-obj-class","errorCode":null,"errorMessage":"ruby_code case not handled: #{obj.class}","messagePattern":"ruby_code case not handled: #(.+?)","errorType":"exception","errorClass":"Gem::Exception","httpStatus":null,"severity":"error","filePath":"lib/rubygems/specification.rb","lineNumber":2267,"sourceCode":"  # object.\n\n  def ruby_code(obj)\n    case obj\n    when String             then obj.dump + \".freeze\"\n    when Array              then \"[\" + obj.map {|x| ruby_code x }.join(\", \") + \"]\"\n    when Hash               then\n      seg = obj.keys.sort.map {|k| \"#{k.to_s.dump} => #{obj[k].to_s.dump}\" }\n      \"{ #{seg.join(\", \")} }\"\n    when Gem::Version       then ruby_code(obj.to_s)\n    when DateLike           then obj.strftime(\"%Y-%m-%d\").dump\n    when Time               then obj.strftime(\"%Y-%m-%d\").dump\n    when Numeric            then obj.inspect\n    when true, false, nil   then obj.inspect\n    when Gem::Platform      then \"Gem::Platform.new(#{ruby_code obj.to_a})\"\n    when Gem::Requirement   then\n      list = obj.as_list\n      \"Gem::Requirement.new(#{ruby_code(list.size == 1 ? obj.to_s : list)})\"\n    else raise Gem::Exception, \"ruby_code case not handled: #{obj.class}\"\n    end\n  end\n\n  private :ruby_code\n\n  ##\n  # List of dependencies that will automatically be activated at runtime.\n\n  def runtime_dependencies\n    dependencies.select(&:runtime?)\n  end\n\n  ##\n  # True if this gem has the same attributes as +other+.\n\n  def same_attributes?(spec)\n    @@attributes.all? {|name, _default| send(name) == spec.send(name) }\n  end","sourceCodeStart":2249,"sourceCodeEnd":2285,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/specification.rb#L2249-L2285","documentation":"Error \"ruby_code case not handled: #{obj.class}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/specification.rb:2267 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is an internal RubyGems gap for an unsupported object type; report it at https://github.com/rubygems/rubygems/issues"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}