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
Crystalでツールを作ってみた
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
mofumofu3n
June 22, 2018
Programming
2
1.3k
Crystalでツールを作ってみた
mofumofu3n
June 22, 2018
Tweet
Share
More Decks by mofumofu3n
See All by mofumofu3n
コードリーディングを通じて得られたこと
mofumofu3n
2
1.3k
Other Decks in Programming
See All in Programming
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
CSC307 Lecture 02
javiergs
PRO
1
780
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
AI時代の認知負荷との向き合い方
optfit
0
160
Oxlintはいいぞ
yug1224
5
1.4k
CSC307 Lecture 01
javiergs
PRO
0
690
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
790
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
180
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
CSC307 Lecture 09
javiergs
PRO
1
840
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
160
Accessibility Awareness
sabderemane
0
56
Leo the Paperboy
mayatellez
4
1.4k
Deep Space Network (abreviated)
tonyrice
0
64
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
57
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
The Curse of the Amulet
leimatthew05
1
8.7k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
220
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
140
The browser strikes back
jonoalderson
0
420
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
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