January 23 - Create and Deploy a RubyGem
Taking a different approach than normal exercises, in this coding exercise we're going to create and a deploy a RubyGem to rubygems.or.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
  • Complete the Exercise
Video locked
This video is viewable to users with a Bottega Bootcamp license

Taking a different approach than normal, in this coding exercise we're going to create and a deploy a RubyGem to rubygems.org.

Process

Generate the Gem

bundle gem tippy

Edit the Gemspec File

# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'tippy/version'

Gem::Specification.new do |spec|
  spec.name          = "tippy"
  spec.version       = Tippy::VERSION
  spec.authors       = ["Jordan Hudgens"]
  spec.email         = ["jordan@wow.com"]

  spec.summary       = %q{A gem for generating tip values based on a number of inputs.}
  spec.homepage      = "https://github.com/jordanhudgens/tippy"
  spec.license       = "MIT"

  spec.files         = `git ls-files -z`.split("\x0").reject do |f|
    f.match(%r{^(test|spec|features)/})
  end
  spec.bindir        = "exe"
  spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
  spec.require_paths = ["lib"]

  spec.add_development_dependency "bundler", "~> 1.13"
  spec.add_development_dependency "rake", "~> 10.0"
  spec.add_development_dependency "rspec", "~> 3.0"
end

Update the .gitignore File

/.bundle/
/.yardoc
/Gemfile.lock
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
*.gem

Add Code

GitHub Link

Deploy to GitHub

Bundle Local Gemfile

bundle install

Generate and Deploy to RubyGems.org

bundle exec rake release

Resources