Your SlideShare is downloading. ×
0
Newer Yankee Workshop Build-a-Gem
What's a Gem? <ul><li>Reusable Pieces of Ruby Code
Packaged Following a Convention
Python Eggs, Perl CPAN Modules, PHP PEAR Packages </li></ul>
Why Build a Gem? <ul><li>So people can use your wonderful code
DRY
Version control across different project </li></ul>
Good Practices <ul><li>Don't  require “rubygems”  in your library -  http://gist.github.com/54177
Always have test coverage
Upcoming SlideShare
Loading in...5
×

Build-a-Gem Workshop

577

Published on

Slides from the Newer Yankee Workshop session "Build-a-Gem"

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
577
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Build-a-Gem Workshop"

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

    Clipping is a handy way to collect important slides you want to go back to later.

×