Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Gemas en ruby
Search
Angel Celis Botto
August 14, 2015
Programming
67
1
Share
Gemas en ruby
Charla sobre gemas en ruby
Angel Celis Botto
August 14, 2015
More Decks by Angel Celis Botto
See All by Angel Celis Botto
Liftit Sttorage
angelbotto
0
46
Growth optional
angelbotto
0
150
Infiniteloops bogota-ruby-meetup
angelbotto
0
60
Cheers presentation
angelbotto
0
82
Pitch Desk
angelbotto
1
160
Landmoda pitch
angelbotto
0
67
LandModa - Manual de Identidad Corporativa
angelbotto
1
84
Raffi krikorian twitter timelines at scale
angelbotto
1
160
Beu desk pith june 2013
angelbotto
0
150
Other Decks in Programming
See All in Programming
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
120
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
2.9k
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
530
GitHub Copilot CLIのいいところ
htkym
2
1.2k
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.3k
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
130
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
600
Oxlintのカスタムルールの現況
syumai
5
970
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.2k
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
3.1k
inferと仲良くなる10分間
ryokatsuse
1
350
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
11k
Featured
See All Featured
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
210
ラッコキーワード サービス紹介資料
rakko
1
3.5M
Automating Front-end Workflow
addyosmani
1370
210k
GraphQLとの向き合い方2022年版
quramy
50
15k
Speed Design
sergeychernyshev
33
1.8k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1.1k
Amusing Abliteration
ianozsvald
1
190
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.6k
We Have a Design System, Now What?
morganepeng
55
8.2k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
320
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
410
Transcript
Ruby Gems
Angel Botto Founder Landmoda Inc github.com/angelbotto twitter/bottico botti.co
¿QUE ES UNA GEMA? Ruby Gems - ¿Que es una
gema?
Ruby Gems - Comando gem Comando gem $ gem search
rails --------------> Buscar gemas $ gem install rails --------------> Instalar gemas $ gem list --------------> Listar gemas instaladas $ gem uninstall rails --------------> Remover gemas
Ruby Gems - ¿para que sirven las gema ? ¿para
que sirven las gemas? > Simplificar funciones complejas. > Crear aplicaciones para la linea de comandos. > Facilitar el uso de una aplicacion publica. > Reusar codigo en una o varias aplicaciones.
¿COMO CREAR UNA GEMA? Ruby Gems - ¿Que es una
gema?
Ruby Gems - dale un buen nombre Dale un buen
nombre ☝ > Underscore para gemas de multiples palabras $ gem hola_mundo ----------------> HolaMundo > Dashes para extensiones $ gem rails-hola_mundo ----------------> Rails::HolaMundo > Asegurate que el nombre este disponible $ gem query --remote --name-matches ‘^rails$’ $ gem query —rn ‘^rails$’
Ruby Gems - Creemos una gema Creemos una gema $
gem install bundler create rails_girls/Gemfile create rails_girls/Rakefile create rails_girls/LICENSE.txt create rails_girls/README.md create rails_girls/.gitignore create rails_girls/rails_girls.gemspec create rails_girls/lib/rails_girls.rb create rails_girls/lib/rails_girls/version.rb $ bundle gem rails_girls
Ruby Gems - Gemfile & Rakefile Gemfile & Rakefile Gemfile
source 'https://rubygems.org' gemspec Rakefile require "bundler/gem_tasks" $ rake -T rake build rake install rake release
Ruby Gems - *.gemspec *.gemspec rails_girls.gemspec Gem::Specification.new do |spec| spec.name
= "rails_girls" spec.version = RailsGirls::VERSION spec.authors = ["angelbotto"] spec.email = ["
[email protected]
"] #.… Referencias de especificaciones: https://30k.co/hj
Ruby Gems - Primero las pruebas TDD Primero las pruebas
TDD require 'minitest/autorun' require 'rails_girls' class RailsGirlsTest < Minitest::Test def test_hi_without_name assert_equal "Hola !!", RailsGirls.hi end def test_with_name assert_equal "Hola Angel!!", RailsGirls.hi('Angel') end end test/test_rails_girls.rb
Ruby Gems - Un poco de codigo Un poco de
codigo lib/rails_girls.rb require "rails_girls/version" module RailsGirls def self.hi(name = nil) "Hola #{name}!!".strip end end
Ruby Gems - Que tal un ejecutable Que tal un
ejecutable $ ruby -I lib ./bin/rails_girls Hola !! $ ruby -I lib ./bin/rails_girls Angel Hola Angel!! #!/usr/bin/env ruby require ‘rails_girls’ puts RailsGirls.hi(ARGV[0]) mkdir bin touch bin/rails_girls chmod a+x bin/rails_girls
¿COMO PUBLICO MI GEMA? Ruby Gems - ¿Como publico mi
gema?
Ruby Gems - rubyGems.org rubyGems.org $ open http://rubygems.org/users/new $ rake
release $ gem push pkg/rails_girls-0.0.1.gem $ gem install rails_girls
RECURSOS ADICIONALES Ruby Gems - recursos adicionales Asciicasts: https://30k.co/hk RubyGems:
https://30k.co/hl
¿PREGUNTAS? Ruby Gems - ¿preguntas?
Ruby Gems - gracias GRACIAS