Challenge 3: Sketch a Tiny Gem — Solution # temp_converter.gemspec Gem::Specification.new do |spec| spec.name = "temp_converter" spec.version = "0.1.0" spec.authors = ["Philip Osztromok"] spec.summary = "Converts temperatures between Celsius and Fahrenheit." spec.files = ["lib/temp_converter.rb"] end # lib/temp_converter.rb module TempConverter def self.celsius_to_fahrenheit(c) (c * 9.0 / 5) + 32 end end # Usage, once installed: # require "temp_converter" # TempConverter.celsius_to_fahrenheit(100) # => 212.0 =begin Notes: - spec.name, spec.version, spec.authors, and spec.summary are the minimum metadata RubyGems needs to identify and describe the gem — this mirrors the "name"/"version"/"description" fields in a PHP composer.json or a Python pyproject.toml's [project] section. - spec.files lists exactly which files get packaged into the built .gem — only lib/temp_converter.rb here, since that's the gem's entire implementation. - celsius_to_fahrenheit is defined with self., making it a class method (Course 1, Chapter 6) callable directly as TempConverter.celsius_to_ fahrenheit(...) with no instance required, appropriate for a small, stateless utility gem like this one. - (c * 9.0 / 5) uses 9.0 rather than plain 9 deliberately, to force float division and avoid the Course 1 Chapter 2 integer-division gotcha that would otherwise silently truncate the result. =end