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
1年かけてgemを1つ作りました
Search
Kunihiko Ito
April 19, 2014
Programming
3
1.5k
1年かけてgemを1つ作りました
大江戸Ruby会議04 で発表したスライド
http://regional.rubykaigi.org/oedo04/
Kunihiko Ito
April 19, 2014
Tweet
Share
More Decks by Kunihiko Ito
See All by Kunihiko Ito
データでふりかえるToyama.rb #100 2024
kunitoo
0
42
富山Ruby会議01 をふりかえる
kunitoo
0
59
Using Ractor
kunitoo
0
170
introduction neo4j
kunitoo
0
160
vim operation and my hotkey
kunitoo
0
170
Introduction Neo4j oblove calendar
kunitoo
0
1.4k
アジャイルソフトウェア開発の概要と現場での実践
kunitoo
0
2.1k
Introduction of neo4j
kunitoo
0
1.9k
Ruby 2.3 のてざわり
kunitoo
2
470
Other Decks in Programming
See All in Programming
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
380
MUSUBIXとは
nahisaho
0
140
Fluid Templating in TYPO3 14
s2b
0
130
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
480
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
180
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
280
2026年 エンジニアリング自己学習法
yumechi
0
140
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
750
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
Featured
See All Featured
Accessibility Awareness
sabderemane
0
57
Building the Perfect Custom Keyboard
takai
2
690
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
What does AI have to do with Human Rights?
axbom
PRO
0
2k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
110
Game over? The fight for quality and originality in the time of robots
wayneb77
1
120
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
280
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
130
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Transcript
大江戸Ruby会議 04 1年かけて1つのgemを作りました 伊藤 邦彦 永和システムマネジメント
はじめに 発表する機会をいただき ありがとうございます
自己紹介 Kunihiko Ito @kunitoo Asakusa.rb歴: 約1年半 rgitlog を作ってます
今日話すこと Asakusa.rb でやっていること 作ったgemのこと
Asakusa.rb でやっている こと 上野会場のドアを開けたり 他の人の話を聞いたり 写経したり gem を作ったり
上野で会場のドアを開けたり ドア番をお願いされたのが Meet up に参加するきっかけ
他の人の話を聞いたり 会話の単語が分からない 調べながら会話を聞く 少しずつ慣れて話が分かるよう になった
写経したり Rails Tutorial Rails Guides RubyGems Guides
gem を作ったり 自己紹介するときに話せる代表 作がほしい なにを作るか考えるところから 始めた
作ったgem
rgitlog rails アプリの git log をブラウ ザで見ることができます
Insatall 以下を変更するだけ Gemfile config/routes.rb
Gemfile gem 'rgitlog' 次に % bundle
config/routes.rb mount Rgitlog::Engine, at: '/rgitlog'
Usage
rgitlogができるまで やりたいこと探し gitを扱うライブラリ探し
rgitlogができるまで やりたいこと探し gitを扱うライブラリ探し
やりたいこと 開発中に以前のバージョンの見 た目が気になることがあった 動作確認中はブラウザだけで完 結したい git checkout したくない
これからやりたいこと ブランチを選択して checkout したい diff を見れるようにしたい 見た目をかっこよくしたい
rgitlogができるまで やりたいこと探し gitを扱うライブラリ探し
最初のバージョン mojombo/grit mojombo/grit はRuby 2.0で動 かなかった gitlabhq/grit フォークを使用
grit での git log 取得 Repo.new('path/to/my/repository').commits
watchしていたらある日 “Grit is no longer maintained. Check out rugged” Pull
Request が 118 close された
rugged での git log 取得 Rugged::Repository.new('path/to/my/repository').head.log
rugged での git log 取得 Rugged::Repository.new('path/to/my/repository').head.log reflog 取得されます
正解 repo = Rugged::Repository.new('path/to/my/repository') repo.walk(repo.last_commit) 気付くのに数ヶ月かかりました orz
rgitlog リリースまで 作りたいと思ってから約1年 実はとっても簡単に作れます
rgitlogの作り方 今から作ります! 時間ありますよね?
rails plugin new $ rails plugin new rgitlog --mountable -O
-B $ cd rgitlog $ bundle --local
Add rugged rgitlog.gemspec s.add_dependency "rugged"
generate controller $ rails g controller rgitlog index
Controller require_dependency "rgitlog/application_controller" require 'rugged' module Rgitlog class RgitlogController <
ApplicationController def index path = Rugged::Repository.discover(Dir.pwd) repo = Rugged::Repository.new(path) @commits = repo.walk(repo.last_commit).to_a end end end
View <h1>commits</h1> <ul> <% @commits.each do |commit| %> <li><%= commit.message
%></li> <% end %> </ul>
Routes root to: 'rgitlog#index'
完成 慣れると10分くらいで作れるように なる
まとめ Asakusa.rbに通いこつこつと続け ていれば、 1年かかったことが20分でできるよ うになります