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
Using Ruby in a Non-Ruby World
Search
Samuel E. Giddins
March 04, 2015
Technology
86
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Using Ruby in a Non-Ruby World
Samuel E. Giddins
March 04, 2015
More Decks by Samuel E. Giddins
See All by Samuel E. Giddins
Funding Ruby Infrastructure as a Non-Profit
segiddins
0
55
Evolution of Rails within RubyGems.org
segiddins
0
49
The Challenges of Building a Sigstore Client from Scratch
segiddins
0
160
Keeping the Gems Sparkling
segiddins
0
110
A Survey of RubyGems CVEs
segiddins
0
100
Handling 225k requests per second to RubyGems.org
segiddins
0
120
State of the RubyGems 2023
segiddins
0
150
Building Broken Gems
segiddins
0
120
Switching Disciplines as a Tech Lead
segiddins
0
65
Other Decks in Technology
See All in Technology
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
【GCC2026】大規模言語モデルを活用した内製検索サービスの社内展開や業務活用
bandainamcostudios
PRO
0
140
生成 AI の基礎 〜 サンプル実装で学ぶ基本原理
enakai00
7
4.4k
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
6
1.4k
Go 1.27 の標準パッケージに uuid が入った!のでいろいろ喋る / go_127_std_go_uuid
convto
1
150
同じWAFが、攻撃の“形”は弾く── 正当な“形”の不正は通す
kuroneko13
0
220
Reference-Free Image Quality Assessment for Virtual Try-On via Human Feedback
zozotech
PRO
0
540
攻撃と防御で学ぶAI時代のプロダクトセキュリティ演習
recruitengineers
PRO
9
3k
ソフトウェアサプライチェーンの構造的リスクとコンテナ環境の保護
kyohmizu
4
370
[ChatGPT Work LT]事務作業が苦手な人のための バックオフィスの「半」自動化
chimaki_iot
0
310
Goでデータパイプラインを作ろう
sansantech
PRO
1
500
【CEDEC2026】『ウマ娘 プリティーダービー』 英語版のキャラクターの方言や口調をローカライズするための創造的アプローチ
cygames
PRO
2
1.1k
Featured
See All Featured
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
56k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
210
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
How GitHub (no longer) Works
holman
316
150k
Everyday Curiosity
cassininazir
0
280
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Designing for Timeless Needs
cassininazir
1
440
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
540
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
490
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Transcript
Using Ruby in a Non-Ruby World
Samuel Giddins Realm CocoaPods Bundler
Show of hands: Who writes Ruby for a living?
Show of hands: Who uses something built in Ruby every
day?
Let’s name some
Those are some great tools! Do you think their utility
is limited to Ruby developers?
No
I write Ruby every day
I write Ruby every day => I am a Rubyist
Let’s look at some of the tools we use: —
rvm/rbenv/chruby — Bundler — Native extensions
Version Managers
For me: $ rbenv versions | wc -l 13 $
ruby -v 2.2.0p0
For others: $ which ruby /usr/bin/ruby $ ruby -v 2.0.0p353
# And be thankful it's not 1.8.7
Can’t you just update to 2.1.5? Not particularly helpful.
Bundler
Bundler Is wonderful.
But most people want to install a tool once and
forget about it.
Yeah, they should use a Gemfile. But they won’t.
So your gem will be polluting their global namespace.
Native Extensions
They’re such a pain.
Compilation as part of the CocoaPods gem install process is
dead. Long live precompiled gems! — CocoaPods 0.27 and improved installation UX
Not everyone needs to have a compiler installed. Or the
Ruby headers. Or a proper build setup.
Not everyone needs to have a compiler installed. Or the
Ruby headers. Or a proper build setup. And they shouldn't need to
In this ‘developer bubble’ there is no sane Ruby environment
unless you at least build your own Ruby, but preferably including one or more of the following tools: homebrew, RVM, rbenv, and many other alternatives.
And Now For The Fun Part
Let’s get positive.
DSLs
Ruby is awesome for building DSLs.
source 'https://github.com/CocoaPods/Specs.git' target 'iOS' do pod 'Realm' pod 'RestKit', git:
'https://github.com/RestKit/RestKit.git' end
It barely even looks like code!
Pod::Specification.new do |s| s.name = 'Realm' s.version = `sh build.sh
get-version`.chomp end
That definitely is starting to seem more like code.
The difference?
BasicObject.instance_eval # the first # vs Kernel.eval # the second
If someone doesn’t realize they’re writing Ruby, you’ve done a
! job.
— Ruby 1.9 hash syntax - ! — Curly brace
procs & lambdas - " — do...end blocks - ! — Symbol parameters - " — def f(*args); end - !
Hide the Ruby out back.
NoMethodError - undefined method `[]' for #<Xcodeproj::Project::Object::PBXFileReference:0x007fcf522734a8> /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/project.rb:186:in `block in
add_file_reference' /usr/local/Cellar/ruby/2.1.3_1/lib/ruby/2.1.0/pathname.rb:266:in `block in each_filename' /usr/local/Cellar/ruby/2.1.3_1/lib/ruby/2.1.0/pathname.rb:266:in `each' /usr/local/Cellar/ruby/2.1.3_1/lib/ruby/2.1.0/pathname.rb:266:in `each_filename' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/project.rb:184:in `add_file_reference' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer/file_references_installer.rb:168:in `block (2 levels) in add_file_accessors_paths_to_pods_group' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer/file_references_installer.rb:166:in `each' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer/file_references_installer.rb:166:in `block in add_file_accessors_paths_to_pods_group' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer/file_references_installer.rb:162:in `each' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer/file_references_installer.rb:162:in `add_file_accessors_paths_to_pods_group' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer/file_references_installer.rb:103:in `block in add_resources' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/user_interface.rb:110:in `message' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer/file_references_installer.rb:102:in `add_resources' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer/file_references_installer.rb:38:in `install!' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer.rb:486:in `install_file_references' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer.rb:130:in `block in generate_pods_project' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/user_interface.rb:49:in `section' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer.rb:128:in `generate_pods_project' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/installer.rb:96:in `install!' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/command/project.rb:71:in `run_install_with_update' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/command/project.rb:101:in `run' /usr/local/lib/ruby/gems/2.1.0/gems/claide-0.8.1/lib/claide/command.rb:312:in `run' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/lib/cocoapods/command.rb:46:in `run' /usr/local/lib/ruby/gems/2.1.0/gems/cocoapods-0.36.0.rc.1/bin/pod:44:in `<top (required)>' /usr/local/bin/pod:23:in `load' /usr/local/bin/pod:23:in `<main>'
[!] Installation could not proceed because an unexpected object was
found in your project file.
Be Friendly
Sure, these tips are designed to keeps Ruby newcomers happy.
Sure, these tips are designed to keeps Ruby newcomers happy.
But they also make your software much friendlier.
Available now on Speaker Deck. https://speakerdeck.com/segiddins/using-ruby-in-a- non-ruby-world
puts Question.all.map(&:ask?).map(&:answer!)
Samuel Giddins Realm @segiddins