Build-a-Gem Workshop
Upcoming SlideShare
Loading in...5
×
 

Build-a-Gem Workshop

on

  • 1,095 views

Slides from our Newer Yankee Workshop "Build-a-Gem" session.

Slides from our Newer Yankee Workshop "Build-a-Gem" session.

Statistics

Views

Total Views
1,095
Views on SlideShare
1,092
Embed Views
3

Actions

Likes
1
Downloads
4
Comments
0

2 Embeds 3

http://www.linkedin.com 2
http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Build-a-Gem Workshop Build-a-Gem Workshop Presentation Transcript

    • Newer Yankee Workshop Build-a-Gem
    • What's a Gem?
      • Reusable Pieces of Ruby Code
      • Packaged Following a Convention
      • Python Eggs, Perl CPAN Modules, PHP PEAR Packages
    • Why Build a Gem?
      • So people can use your wonderful code
      • DRY
      • Version control across different project
    • Good Practices
      • Don't require “rubygems” in your library - http://gist.github.com/54177
      • Always have test coverage
      • Write your README (README.rdoc)
      • Expose commit history (github is most common)
      • Good documentation – RDOC
      • Versions 0.0.0 (major, minor, patch)
      • Use pre for Prereleases ( 0.1.0pre1 )
    • Gem Anatomy
      • http://github.com/technicalpickles/the-perfect-gem
      LICENSE README Rakefile VERSION <gem-name>.gemspec ./lib ./tests ./specs ./features
      • Gem::Specification
      Gem::Specification.new do |s| s.name = 'example' s.version = '1.0' s.summary = “example gem ...” end
    • But... we'll be using Jeweler http://github.com/technicalpickles/jeweler
    • Distributing Gems
      • gems.rubyforge.org, rubygems.org, gemcutter.org (confused?)
      • github also used to host gems (more confused?)
      • Consistency is coming / here
      http://update.gemcutter.org/2010/02/20/rubygems-org-move-complete.html
      • Host your own gems, use gem server
      • Cache / distribute .gem files – building sometimes makes “binaries” which are system-specific.
    • Using Gems
      • gem install <gem>
      • $LOAD_PATH then require gem
      • require 'rubygems'
      • gem bundler (bundler) - bundler under rapid development!
    • Hello World (simple example followed by nextbus example followed by everyone pairing and gem building)