Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Crystalでツールを作ってみた
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
mofumofu3n
June 22, 2018
Programming
1.4k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Crystalでツールを作ってみた
mofumofu3n
June 22, 2018
More Decks by mofumofu3n
See All by mofumofu3n
コードリーディングを通じて得られたこと
mofumofu3n
2
1.3k
Other Decks in Programming
See All in Programming
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
120
contenteditable と日本語入力に向き合う
colorful12
0
170
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
210
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
490
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
120
残高管理から台帳サービスへの進化
artoy
0
170
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
34
16k
Java 27新機能 / Java 27 new features
kishida
2
200
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
190
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
140
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
130
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
GraphQLとの向き合い方2022年版
quramy
50
15k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
The SEO Collaboration Effect
kristinabergwall1
1
590
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Believing is Seeing
oripsolob
1
240
Mind Mapping
helmedeiros
1
390
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Designing for humans not robots
tammielis
254
26k
Transcript
Crystal でツールを作ってみた Crystal でツールを作ってみた @mofumofu3n
自己紹介 自己紹介
Tatsuya Tanaka(@mofumofu3n) トラベルブック株式会社 今はRuby 、昔はAndroid Crystal 始めました
さっきまで沖縄にいました! さっきまで沖縄にいました!
Crystal 0.25.0 リリース Crystal 0.25.0 リリース
reveal.cr の紹介 reveal.cr の紹介 https://github.com/mofumofu3n/reveal.cr https://github.com/mofumofu3n/reveal.cr
reveal.js はHTML やMarkdown で記述したファイル をプレゼンテーションにできるライブラリ reveal.js を簡単に使えるようにしたCrystal 製のツー ル yusukebe
さん作の をCrystal で書いてみた revealgo
使い方 使い方 マークダウンファイル(index.md) を指定して起動 ポート指定 テーマの変更 $ revealcr index.md Open
http://127.0.0.1:4000 $ revealcr -p 8080 index.md Open http://127.0.0.1:8080 $ revealcr -t solarized Open http://127.0.0.1:4000
仕組み 仕組み reveal.js はサブモジュールとして取り込み 指定されたmarkdown ファイルの名前をreveal.js 用 のテンプレートに埋め込み ローカルにhttp サーバーを立ち上げる
<section data-markdown=" ファイル名" ...>
使った標準API 使った標準API ecr le http/server option_parser
ハマったポイント ハマったポイント
1. Crystal アップデート 1. Crystal アップデート
http/server の実装方法 http/server の実装方法 0.24.0 まで 0.24.0 まで require "http/server"
HTTP::Server.new("0.0.0.0", 8080, [ HTTP::StaticFileHandler.new("."), ]).listen
0.25.0 から 0.25.0 から require "http/server" server = HTTP::Server.new([ HTTP::StaticFileHandler.new("."),
]) server.bind "127.0.0.1", 8080 # <- リファレンス通りに書いたがエラーになる server.listen
2. ドキュメントが間違ってた 2. ドキュメントが間違ってた
server.bind "127.0.0.1", 8080 https://crystal-lang.org/api/0.25.0/HTTP/Server.html https://crystal-lang.org/api/0.25.0/HTTP/Server.html server.bind_tcp "127.0.0.1", 8080 https://crystal-lang.org/api/master/HTTP/Server.html https://crystal-lang.org/api/master/HTTP/Server.html
3. option_parser の使い方 3. option_parser の使い方
$ revealcr -p 8080 # 8080 を受け取りたい
OptionParser.parse! do |parser| parser.on("-p", "--port", "port with running.") do |v|
port = v end end OptionParser.parse! do |parser| # 第二引数で= 以降を書かないと値が受け取れない parser.on("-p PORT", "--port=PORT", "port with running.") do |v| port = v end end
4. デバック方法 4. デバック方法
lldb でデッバックできた。けど、変数ウォッチ出来 ない。。 gdb も試したけど、Mac OS だとうまく動かない
皆さんどうやってデバックしていますか? 皆さんどうやってデバックしていますか?
良かったポイント 良かったポイント
Ruby のシンタックスと似てるから入りやすい 型( ・∀・) イイ!! 複数の型が指定できるのに少し戸惑った 言語でライブラリの作成やパッケージマネージャー をサポートしてる
宣伝 宣伝 エンジニア絶賛募集中です! https://www.wantedly.com/companies/travelbook