Welcome to the – Cleveland Ruby Brigade Build your own Gem workshop! – Build your own Gem workshop!



Welcome to the – Cleveland Ruby Brigade Build your own Gem workshop! – Build your own Gem workshop!

0 0


make_a_gem_slides


On Github clerb / make_a_gem_slides

Welcome to the

Cleveland Ruby Brigade

Build your own Gem workshop!

October 2nd, 2014

What is a RubyGem?

RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gems, and a server for distributing them.

- http://en.wikipedia.org/wiki/RubyGems

What is a RubyGem?

Ruby code + [gemname].gemspec

Gem::Specification.new do |s|
  s.name        = 'your_fancy_gem'
  s.version     = '0.0.0'
  s.date        = '2014-10-02'
  s.summary     = "Your Fancy Gem"
  s.description = "The fanciest gem ever!"
  s.authors     = ["Joel"]
  s.email       = 'joelbyler@gmail.com'
  s.files       = ["lib/fancy.rb"]
  s.homepage    = 'http://rubygems.org/gems/your_fancy_gem'
  s.license       = 'MIT'
end
					

Why?

In software engineering, don’t repeat yourself (DRY) is a principle of software development, aimed at reducing repetition of information of all kinds, especially useful in multi-tier architectures.

- http://en.wikipedia.org/wiki/Don't_repeat_yourself

Who?

Anybody can do it. You just need some code that you want to share

Where?

  • Locally:
    gem 'foo', :path => '/path/to/foo'
  • Github:
    gem 'nokogiri', :git => 'https://github.com/tenderlove/nokogiri.git'.
  • Server:
    source 'rubygems.org'
    gem 'rails', '4.1.6'

How?

  • Form small groups, a pair or maybe more.
  • Walk through the rubygems.org guide(s).
  • Substitute your own code if you wish.
  • Try to make sure that everyone gets a chance to try.

Resources

  • http://guides.rubygems.org/make-your-own-gem/
  • http://www.kataclub.com/

Lets get started!

Wrap up...