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
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
Transcript
25 slides
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
More Decks by mofumofu3n
See All by mofumofu3n
コードリーディングを通じて得られたこと
mofumofu3n
2
1.3k
Other Decks in Programming
See All in Programming
特急いなほ as a Workflow / 20261107jaws-festa-2026-akita-lt
kasacchiful
PRO
0
110
protojson における文字化けの扱い
kazuki1023
0
460
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
440
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
Math.sumPreciseから学ぶ、ECMAScript仕様の数値の種類
syumai
0
110
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
360
祈るテストから、探索するテストへ 〜Lincheckではじめる並行処理テスト〜
yyh_gl
0
430
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
150
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
1.1k
AppFunctionsの内部実装を紐解く
hiroaki404
0
120
Getting Started with Vibe Coding
miccheng
0
250
RaspberryPi 5で軽くはじめるk3sとtailscaleを用いたホームサーバー構築 (1)
nasum
0
440
Featured
See All Featured
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
560
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
340
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
340
Building the Perfect Custom Keyboard
takai
2
970
Claude Code のすすめ
schroneko
67
230k
Marketing to machines
jonoalderson
1
6k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
580
Designing Powerful Visuals for Engaging Learning
tmiket
1
660
Building a Scalable Design System with Sketch
lauravandoore
464
34k