Recall & Review
beginner
What is a Ruby gem?
A Ruby gem is a packaged library or tool that can be shared and reused in Ruby programs. It helps you add features without writing all code yourself.
Click to reveal answer
beginner
Which command creates a new gem skeleton in Ruby?
The command
bundle gem gem_name creates a new folder with files and folders needed to start a gem.Click to reveal answer
intermediate
What is the purpose of the gemspec file in a Ruby gem?
The gemspec file describes the gem’s name, version, author, summary, files, and dependencies. It tells RubyGems how to build and install the gem.
Click to reveal answer
beginner
How do you build a Ruby gem into a .gem file?
Run
gem build gem_name.gemspec. This creates a .gem file you can install or share.Click to reveal answer
beginner
How can you install your built gem locally?
Use
gem install ./gem_name-version.gem to install the gem file on your computer.Click to reveal answer
What does the command
bundle gem my_gem do?✗ Incorrect
The command
bundle gem my_gem sets up a new folder with files to start building a gem called my_gem.Which file contains the gem’s metadata like version and author?
✗ Incorrect
The gemspec file holds important info about the gem such as its version, author, and dependencies.
How do you build the gem package from the gemspec file?
✗ Incorrect
The
gem build command creates the .gem package from the gemspec.What is the main folder where your gem’s Ruby code lives?
✗ Incorrect
The
lib/ folder contains the main Ruby files for your gem.Which command installs a gem from a local .gem file?
✗ Incorrect
Use
gem install ./gem_name-version.gem to install a gem from a local file.Explain the basic steps to create and share a Ruby gem.
Think about starting, describing, coding, packaging, and sharing.
You got /5 concepts.
What is the role of the gemspec file and why is it important?
It’s like the gem’s ID card and instruction sheet.
You got /4 concepts.