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
1
61
Gemas en ruby
Charla sobre gemas en ruby
Angel Celis Botto
August 14, 2015
Tweet
Share
More Decks by Angel Celis Botto
See All by Angel Celis Botto
Liftit Sttorage
angelbotto
0
42
Growth optional
angelbotto
0
150
Infiniteloops bogota-ruby-meetup
angelbotto
0
56
Cheers presentation
angelbotto
0
77
Pitch Desk
angelbotto
1
150
Landmoda pitch
angelbotto
0
63
LandModa - Manual de Identidad Corporativa
angelbotto
1
71
Raffi krikorian twitter timelines at scale
angelbotto
1
150
Beu desk pith june 2013
angelbotto
0
140
Other Decks in Programming
See All in Programming
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
0
2k
登壇は dynamic! な営みである / speech is dynamic
da1chi
0
350
What's new in Spring Modulith?
olivergierke
1
160
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
3
220
オープンソースソフトウェアへの解像度🔬
utam0k
16
3k
その面倒な作業、「Dart」にやらせませんか? Flutter開発者のための業務効率化
yordgenome03
1
130
3年ぶりにコードを書いた元CTOが Claude Codeと30分でMVPを作った話
maikokojima
0
560
開発生産性を上げるための生成AI活用術
starfish719
3
1.4k
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
230
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
500
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
170
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
3
560
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Building an army of robots
kneath
306
46k
Optimizing for Happiness
mojombo
379
70k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Writing Fast Ruby
sferik
629
62k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
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