SlideShare ist ein Scribd-Unternehmen logo
1 von 9
CREATING
RUBY
GEMS
BY AMBER TUNNELL
AND BEN SHORE
Creating Ruby Gems - Tunnell & Shore
WHAT IS A GEM?
• A RubyGem is a package manager that provides a
standardized format for distributing Ruby programs.
Popular Gems include:
• Gems provide pre-made code to Ruby users, increasing
functionality and efficiency
• They also allow for “lighter” applications because the
Gem code does not need to be a part of the application.
Creating Ruby Gems - Tunnell & Shore
LET’S CREATE A GEM
Use “Bundler” to create the standard directory of files
needed for your Gem.
Creating Ruby Gems - Tunnell & Shore
$ bundle gem your_gem_name
This is the Gem directory Bundler
will create locally.
Let’s look at these files more closely.
A LOOK AT SOME KEY
FILES
This is where you will tell the world what your
Gem does, how to install it, and how to use it.
Creating Ruby Gems - Tunnell & Shore
README.rdoc
lib/your_gems_name.rb
Gemfile
lib/your_gems_name/version.rb
This is where your application’s
code will live.
Your Gem will need
a version in order to work at all. Try to follow the Ruby
A very minimal file, most of the leg work
happens in the gemspec file [next slide].
SETTING UP THE
GEMSPEC
Gem::Specification.new do |spec|
spec.name = "your_gem_name"
spec.version = gem_name::VERSION
spec.authors = ["author’s name"]
spec.email = ["author’s email"]
spec.summary = %q{SHORT DESC}
spec.description = %q{LONG DESC}
…
spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake"
spec.add_runtime_dependency "nokogiri"
end
Creating Ruby Gems - Tunnell & Shore
USING RAKE TO BUILD
AND INSTALL
• Run to see a list of available rake tasks
provided by bundler. You should see:
• Run to add the Gem to your local
system.
• To test for the successful installation, run
and see if it appears.
• Next hop into IRB and , if it
returns true, you are in business.
Creating Ruby Gems - Tunnell & Shore
$ rake -T
rake build # Build your_gem_name-0.0.1.gem into the pkg directory
rake install # Build and install your_gem_name-0.0.1.gem into system gems
rake release # Creates tag v0.0.1 and build and push your_gem_name-0.0.1.g.
$ rake install
$ gem list
require ‘your_gem_name’
RELEASE IT TO THE
WORLD
• Create an account at RubyGems.org
• Make sure you have everything working (you should build
some tests) and that your work has been committed
• Run
• Dude, you are officially the author of a RubyGem!
Creating Ruby Gems - Tunnell & Shore
$ rake release
WE BUILT A GEM
• Feel free to download it:
A web-scraping gem that provides live news updates related
to the High Yield Bond Markets. Anticipating 10+ million
downloads this week.
Creating Ruby Gems - Tunnell & Shore
$ gem install hybondnews
ADDITIONAL RESOURCES
• RubyGems.org Guides (http://guides.rubygems.org/)
• Gem It (http://gemit.us/)
Thank You!
If you have questions, contact us!
Amber - amber.tunnell@flatironschool.com
Ben - benjamin.shore@flatironschool.com
Creating Ruby Gems - Tunnell & Shore

Weitere ähnliche Inhalte

Ähnlich wie Creating Ruby Gems

Gem That (2009)
Gem That (2009)Gem That (2009)
Gem That (2009)lazyatom
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for RubyHiroshi SHIBATA
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Hiroshi SHIBATA
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
Crate - ruby based standalone executables
Crate - ruby based standalone executablesCrate - ruby based standalone executables
Crate - ruby based standalone executablesJeremy Hinegardner
 
Writing a Ruby Gem for beginners
Writing a Ruby Gem for beginnersWriting a Ruby Gem for beginners
Writing a Ruby Gem for beginnersConFoo
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Maurício Linhares
 
Create your-own-gem-with-github-jeweler-rubygems
Create your-own-gem-with-github-jeweler-rubygemsCreate your-own-gem-with-github-jeweler-rubygems
Create your-own-gem-with-github-jeweler-rubygemsNico Hagenburger
 
Your fist RubyMotion Application
Your fist RubyMotion ApplicationYour fist RubyMotion Application
Your fist RubyMotion Applicationtoamitkumar
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3Blazing Cloud
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overviewThomas Asikis
 
The story of language development
The story of language developmentThe story of language development
The story of language developmentHiroshi SHIBATA
 
Ruby on rails toolbox
Ruby on rails toolboxRuby on rails toolbox
Ruby on rails toolboxBlazing Cloud
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)scandiweb
 

Ähnlich wie Creating Ruby Gems (20)

11 Ruby Gems
11 Ruby Gems11 Ruby Gems
11 Ruby Gems
 
Gem That (2009)
Gem That (2009)Gem That (2009)
Gem That (2009)
 
Setup ruby
Setup rubySetup ruby
Setup ruby
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for Ruby
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Install Guide
Install GuideInstall Guide
Install Guide
 
Rails onCpanel
Rails onCpanelRails onCpanel
Rails onCpanel
 
Crate - ruby based standalone executables
Crate - ruby based standalone executablesCrate - ruby based standalone executables
Crate - ruby based standalone executables
 
Writing a Ruby Gem for beginners
Writing a Ruby Gem for beginnersWriting a Ruby Gem for beginners
Writing a Ruby Gem for beginners
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10
 
Bundler
BundlerBundler
Bundler
 
Create your-own-gem-with-github-jeweler-rubygems
Create your-own-gem-with-github-jeweler-rubygemsCreate your-own-gem-with-github-jeweler-rubygems
Create your-own-gem-with-github-jeweler-rubygems
 
Your fist RubyMotion Application
Your fist RubyMotion ApplicationYour fist RubyMotion Application
Your fist RubyMotion Application
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Ruby on rails toolbox
Ruby on rails toolboxRuby on rails toolbox
Ruby on rails toolbox
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)
 

Mehr von Flatiron School

How to Leverage Your Network to Land Your First Job as a Developer
How to Leverage Your Network to Land Your First Job as a DeveloperHow to Leverage Your Network to Land Your First Job as a Developer
How to Leverage Your Network to Land Your First Job as a DeveloperFlatiron School
 
Pay and Get Paid: How To Integrate Stripe Into Your App
Pay and Get Paid: How To Integrate Stripe Into Your AppPay and Get Paid: How To Integrate Stripe Into Your App
Pay and Get Paid: How To Integrate Stripe Into Your AppFlatiron School
 
Pick-a-Plex App: The Pinnacle of Cinema Experiences
Pick-a-Plex App: The Pinnacle of Cinema ExperiencesPick-a-Plex App: The Pinnacle of Cinema Experiences
Pick-a-Plex App: The Pinnacle of Cinema ExperiencesFlatiron School
 
Play Music...With Your Head: A Theremin App For Everyone
Play Music...With Your Head: A Theremin App For EveryonePlay Music...With Your Head: A Theremin App For Everyone
Play Music...With Your Head: A Theremin App For EveryoneFlatiron School
 
Four Days Out: Quick Itineraries For Last-Minute Dates
Four Days Out: Quick Itineraries For Last-Minute DatesFour Days Out: Quick Itineraries For Last-Minute Dates
Four Days Out: Quick Itineraries For Last-Minute DatesFlatiron School
 
Into to Node.js: Building Fast, Scaleable Network Applications
Into to Node.js: Building Fast, Scaleable Network ApplicationsInto to Node.js: Building Fast, Scaleable Network Applications
Into to Node.js: Building Fast, Scaleable Network ApplicationsFlatiron School
 
What's a Core Image? An Image-Processing Framework on iOS and OS X
What's a Core Image? An Image-Processing Framework on iOS and OS XWhat's a Core Image? An Image-Processing Framework on iOS and OS X
What's a Core Image? An Image-Processing Framework on iOS and OS XFlatiron School
 
Intro to D3: Data-Driven Documents
Intro to D3: Data-Driven DocumentsIntro to D3: Data-Driven Documents
Intro to D3: Data-Driven DocumentsFlatiron School
 

Mehr von Flatiron School (13)

How to Leverage Your Network to Land Your First Job as a Developer
How to Leverage Your Network to Land Your First Job as a DeveloperHow to Leverage Your Network to Land Your First Job as a Developer
How to Leverage Your Network to Land Your First Job as a Developer
 
Pay and Get Paid: How To Integrate Stripe Into Your App
Pay and Get Paid: How To Integrate Stripe Into Your AppPay and Get Paid: How To Integrate Stripe Into Your App
Pay and Get Paid: How To Integrate Stripe Into Your App
 
Pick-a-Plex App: The Pinnacle of Cinema Experiences
Pick-a-Plex App: The Pinnacle of Cinema ExperiencesPick-a-Plex App: The Pinnacle of Cinema Experiences
Pick-a-Plex App: The Pinnacle of Cinema Experiences
 
Play Music...With Your Head: A Theremin App For Everyone
Play Music...With Your Head: A Theremin App For EveryonePlay Music...With Your Head: A Theremin App For Everyone
Play Music...With Your Head: A Theremin App For Everyone
 
Four Days Out: Quick Itineraries For Last-Minute Dates
Four Days Out: Quick Itineraries For Last-Minute DatesFour Days Out: Quick Itineraries For Last-Minute Dates
Four Days Out: Quick Itineraries For Last-Minute Dates
 
Into to Node.js: Building Fast, Scaleable Network Applications
Into to Node.js: Building Fast, Scaleable Network ApplicationsInto to Node.js: Building Fast, Scaleable Network Applications
Into to Node.js: Building Fast, Scaleable Network Applications
 
What's a Core Image? An Image-Processing Framework on iOS and OS X
What's a Core Image? An Image-Processing Framework on iOS and OS XWhat's a Core Image? An Image-Processing Framework on iOS and OS X
What's a Core Image? An Image-Processing Framework on iOS and OS X
 
Intro to D3: Data-Driven Documents
Intro to D3: Data-Driven DocumentsIntro to D3: Data-Driven Documents
Intro to D3: Data-Driven Documents
 
Database Opt
Database Opt Database Opt
Database Opt
 
Citi Bike Finder
Citi Bike FinderCiti Bike Finder
Citi Bike Finder
 
FOMO No Mo'
FOMO No Mo' FOMO No Mo'
FOMO No Mo'
 
JSON overview and demo
JSON overview and demoJSON overview and demo
JSON overview and demo
 
Form Helpers
Form Helpers Form Helpers
Form Helpers
 

Kürzlich hochgeladen

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 

Kürzlich hochgeladen (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 

Creating Ruby Gems

  • 1. CREATING RUBY GEMS BY AMBER TUNNELL AND BEN SHORE Creating Ruby Gems - Tunnell & Shore
  • 2. WHAT IS A GEM? • A RubyGem is a package manager that provides a standardized format for distributing Ruby programs. Popular Gems include: • Gems provide pre-made code to Ruby users, increasing functionality and efficiency • They also allow for “lighter” applications because the Gem code does not need to be a part of the application. Creating Ruby Gems - Tunnell & Shore
  • 3. LET’S CREATE A GEM Use “Bundler” to create the standard directory of files needed for your Gem. Creating Ruby Gems - Tunnell & Shore $ bundle gem your_gem_name This is the Gem directory Bundler will create locally. Let’s look at these files more closely.
  • 4. A LOOK AT SOME KEY FILES This is where you will tell the world what your Gem does, how to install it, and how to use it. Creating Ruby Gems - Tunnell & Shore README.rdoc lib/your_gems_name.rb Gemfile lib/your_gems_name/version.rb This is where your application’s code will live. Your Gem will need a version in order to work at all. Try to follow the Ruby A very minimal file, most of the leg work happens in the gemspec file [next slide].
  • 5. SETTING UP THE GEMSPEC Gem::Specification.new do |spec| spec.name = "your_gem_name" spec.version = gem_name::VERSION spec.authors = ["author’s name"] spec.email = ["author’s email"] spec.summary = %q{SHORT DESC} spec.description = %q{LONG DESC} … spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake" spec.add_runtime_dependency "nokogiri" end Creating Ruby Gems - Tunnell & Shore
  • 6. USING RAKE TO BUILD AND INSTALL • Run to see a list of available rake tasks provided by bundler. You should see: • Run to add the Gem to your local system. • To test for the successful installation, run and see if it appears. • Next hop into IRB and , if it returns true, you are in business. Creating Ruby Gems - Tunnell & Shore $ rake -T rake build # Build your_gem_name-0.0.1.gem into the pkg directory rake install # Build and install your_gem_name-0.0.1.gem into system gems rake release # Creates tag v0.0.1 and build and push your_gem_name-0.0.1.g. $ rake install $ gem list require ‘your_gem_name’
  • 7. RELEASE IT TO THE WORLD • Create an account at RubyGems.org • Make sure you have everything working (you should build some tests) and that your work has been committed • Run • Dude, you are officially the author of a RubyGem! Creating Ruby Gems - Tunnell & Shore $ rake release
  • 8. WE BUILT A GEM • Feel free to download it: A web-scraping gem that provides live news updates related to the High Yield Bond Markets. Anticipating 10+ million downloads this week. Creating Ruby Gems - Tunnell & Shore $ gem install hybondnews
  • 9. ADDITIONAL RESOURCES • RubyGems.org Guides (http://guides.rubygems.org/) • Gem It (http://gemit.us/) Thank You! If you have questions, contact us! Amber - amber.tunnell@flatironschool.com Ben - benjamin.shore@flatironschool.com Creating Ruby Gems - Tunnell & Shore