rabbit-slide-unasuke-rubykaigi-2022 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rabbit +1 -0
- data/README.rd +24 -0
- data/Rakefile +17 -0
- data/config.yaml +25 -0
- data/img/aioquic.png +0 -0
- data/img/background.png +0 -0
- data/img/background_plain.png +0 -0
- data/img/bench_result.png +0 -0
- data/img/icon_face.jpeg +0 -0
- data/img/kwik.png +0 -0
- data/img/msgpack-ruby.png +0 -0
- data/img/pixiv_ruby_music_mixin.png +0 -0
- data/img/quic-go.png +0 -0
- data/img/quic_initial_packet_reading_1.png +0 -0
- data/img/quic_initial_packet_reading_2.png +0 -0
- data/img/quic_initial_packet_reading_3.png +0 -0
- data/img/quic_initial_packet_reading_4.png +0 -0
- data/img/quic_initial_packet_reading_5.png +0 -0
- data/img/quic_initial_packet_reading_6.png +0 -0
- data/img/quiche.png +0 -0
- data/img/talk_2021.png +0 -0
- data/img/title_background_logo_center.png +0 -0
- data/pdf/rubykaigi-2022-slide.pdf +0 -0
- data/slide.rab +378 -0
- data/theme.rb +111 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ddc84c9fd7a2417f61ad285f71cd65f46d2b3f7528c4d116efbd35f392e7fc02
|
4
|
+
data.tar.gz: 4e5f4a89cfd7d0d7b72b5ded2af19b31eb0690c45b4c8726d6fe914791bf93f9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 45fd641033d6ae1af37db849e3c5153506330b6a9b89aa5514f9cc77ba4adaf4f1244f0d4203de7816fa1afb59b2cf88742061e9a779b9ec8bc730b77f00680b
|
7
|
+
data.tar.gz: f229f3fdbccb51fe6a9f9074e510f381c3786a6ca00f9faa8e4c8fb1c456de1014ff63126708110793575d618c100f80abfb69adbf246e0ecc2581132a6b9517
|
data/.rabbit
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--size 1200,675 slide.rab
|
data/README.rd
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
= Do Pure Ruby Dream of Encrypted Binary Protocol?
|
2
|
+
|
3
|
+
https://rubykaigi.org/2022/presentations/yu_suke1994.html
|
4
|
+
|
5
|
+
== 作者向け
|
6
|
+
|
7
|
+
=== 表示
|
8
|
+
|
9
|
+
rake
|
10
|
+
|
11
|
+
=== 公開
|
12
|
+
|
13
|
+
rake publish
|
14
|
+
|
15
|
+
== 閲覧者向け
|
16
|
+
|
17
|
+
=== インストール
|
18
|
+
|
19
|
+
gem install rabbit-slide-unasuke-rubykaigi-2022
|
20
|
+
|
21
|
+
=== 表示
|
22
|
+
|
23
|
+
rabbit rabbit-slide-unasuke-rubykaigi-2022.gem
|
24
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require "rabbit/task/slide"
|
2
|
+
|
3
|
+
# Edit ./config.yaml to customize meta data
|
4
|
+
|
5
|
+
spec = nil
|
6
|
+
Rabbit::Task::Slide.new do |task|
|
7
|
+
spec = task.spec
|
8
|
+
# spec.files += Dir.glob("doc/**/*.*")
|
9
|
+
# spec.files -= Dir.glob("private/**/*.*")
|
10
|
+
# spec.add_runtime_dependency("rabbit-theme-YOUR-THEME")
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Tag #{spec.version}"
|
14
|
+
task :tag do
|
15
|
+
sh("git", "tag", "-a", spec.version.to_s, "-m", "Publish #{spec.version}")
|
16
|
+
sh("git", "push", "--tags")
|
17
|
+
end
|
data/config.yaml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
id: rubykaigi-2022
|
3
|
+
base_name: slide
|
4
|
+
tags:
|
5
|
+
- ruby
|
6
|
+
- quic
|
7
|
+
- rubykaigi
|
8
|
+
presentation_date: 2022-09-09
|
9
|
+
presentation_start_time:
|
10
|
+
presentation_end_time:
|
11
|
+
version: 1.0.0
|
12
|
+
licenses: ['MIT']
|
13
|
+
slideshare_id:
|
14
|
+
speaker_deck_id:
|
15
|
+
ustream_id:
|
16
|
+
vimeo_id:
|
17
|
+
youtube_id:
|
18
|
+
author:
|
19
|
+
markup_language: :rd
|
20
|
+
name: unasuke
|
21
|
+
email: yusuke1994525@gmail.com
|
22
|
+
rubygems_user: unasuke
|
23
|
+
slideshare_user:
|
24
|
+
speaker_deck_user:
|
25
|
+
source_code_uri: "https://github.com/unasuke/rubykaigi-2022"
|
data/img/aioquic.png
ADDED
Binary file
|
data/img/background.png
ADDED
Binary file
|
Binary file
|
Binary file
|
data/img/icon_face.jpeg
ADDED
Binary file
|
data/img/kwik.png
ADDED
Binary file
|
Binary file
|
Binary file
|
data/img/quic-go.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/img/quiche.png
ADDED
Binary file
|
data/img/talk_2021.png
ADDED
Binary file
|
Binary file
|
Binary file
|
data/slide.rab
ADDED
@@ -0,0 +1,378 @@
|
|
1
|
+
= Do Pure Ruby Dreams Encrypted Binary Protocol?
|
2
|
+
|
3
|
+
: author
|
4
|
+
unasuke (Yusuke Nakamura)
|
5
|
+
: content-source
|
6
|
+
RubyKaigi 2022
|
7
|
+
: date
|
8
|
+
2022-09-09
|
9
|
+
: theme
|
10
|
+
theme
|
11
|
+
|
12
|
+
= Self introduction
|
13
|
+
|
14
|
+
* Name: unasuke (Yusuke Nakamura)
|
15
|
+
* Work: freelance Web app developer @ Tokyo
|
16
|
+
* Rails app developer (mainly)
|
17
|
+
* Itamae gem maintainer, Kaigi on Rails Organizer
|
18
|
+
* (('tag:x-small')) GitHub ((<URL:https://github.com/unasuke>))
|
19
|
+
* (('tag:x-small')) Mastodon ((<URL:https://mstdn.unasuke.com/@unasuke>))
|
20
|
+
* (('tag:x-small')) Twitter ((<URL:https://twitter.com/yu_suke1994>))
|
21
|
+
|
22
|
+
|
23
|
+
# image
|
24
|
+
# src = img/icon_face.jpeg
|
25
|
+
# relative_width = 24
|
26
|
+
# align = right
|
27
|
+
# relative_margin_right = -8
|
28
|
+
# relative_margin_top = 33
|
29
|
+
|
30
|
+
# = [AD] Day.3 : Ruby Music Mixin 2022 by pixiv Inc.
|
31
|
+
#
|
32
|
+
# # image
|
33
|
+
# # src = img/pixiv_ruby_music_mixin.png
|
34
|
+
# # relative_width = 30
|
35
|
+
|
36
|
+
|
37
|
+
= At first, do PureRuby Dream of Encrypted Binary Protocol?
|
38
|
+
|
39
|
+
(('tag:x-large')) A: There is a harsh reality. 😭
|
40
|
+
|
41
|
+
= A brief explanation of what QUIC is
|
42
|
+
|
43
|
+
* QUIC: standarized at 2021 by RFC 9000 etc
|
44
|
+
* Using UDP for communication
|
45
|
+
|
46
|
+
: TCP
|
47
|
+
low efficiency, high reliability
|
48
|
+
|
49
|
+
: UDP
|
50
|
+
high efficiency, low reliability → faster than TCP
|
51
|
+
|
52
|
+
= Did you remember my last year talk about QUIC?
|
53
|
+
|
54
|
+
# image
|
55
|
+
# src = img/talk_2021.png
|
56
|
+
# relative_width = 70
|
57
|
+
|
58
|
+
(('tag:x-small'))(('tag:center'))
|
59
|
+
((<URL:https://slide.rabbit-shocker.org/authors/unasuke/rubykaigi-takeout-2021/>))
|
60
|
+
|
61
|
+
= Ractor, I dropped out
|
62
|
+
|
63
|
+
It's too difficult.Because...
|
64
|
+
|
65
|
+
* Implementating communication protorol is very hard work
|
66
|
+
* debugging code using Ractor is very hard in now
|
67
|
+
* debug.gem, I hope it will be a savior in the future...
|
68
|
+
|
69
|
+
Try to solve two problems in one time is difficult.
|
70
|
+
|
71
|
+
→ I gave up to use Ractor in first implementation 😇
|
72
|
+
|
73
|
+
= It's a binary protocol
|
74
|
+
message like that
|
75
|
+
|
76
|
+
# enscript javascript
|
77
|
+
{ "message": "Hello!", "kind": "greet" }
|
78
|
+
|
79
|
+
parse it by ruby
|
80
|
+
|
81
|
+
# enscript ruby
|
82
|
+
require "json"
|
83
|
+
request = JSON.parse('{ "message": "Hello!", "kind": "greet" }')
|
84
|
+
pp request["message"] # => "Hello!"
|
85
|
+
|
86
|
+
= It's a binary protocol
|
87
|
+
QUIC message
|
88
|
+
|
89
|
+
c000000001088394c8f03e5157080000449e7b9aec34d1b1c98dd7689fb8ec11
|
90
|
+
d242b123dc9bd8bab936b47d92ec356c0bab7df5976d27cd449f63300099f399
|
91
|
+
1c260ec4c60d17b31f8429157bb35a1282a643a8d2262cad67500cadb8e7378c
|
92
|
+
8eb7539ec4d4905fed1bee1fc8aafba17c750e2c7ace01e6005f80fcb7df6212
|
93
|
+
30c83711b39343fa028cea7f7fb5ff89eac2308249a02252155e2347b63d58c5
|
94
|
+
457afd84d05dfffdb20392844ae812154682e9cf012f9021a6f0be17ddd0c208
|
95
|
+
4dce25ff9b06cde535d0f920a2db1bf362c23e596d11a4f5a6cf3948838a3aec
|
96
|
+
4e15daf8500a6ef69ec4e3feb6b1d98e610ac8b7ec3faf6ad760b7bad1db4ba3
|
97
|
+
...
|
98
|
+
|
99
|
+
|
100
|
+
= It's a binary protocol
|
101
|
+
Reading QUIC message (same as last year's slide)
|
102
|
+
|
103
|
+
# image
|
104
|
+
# src = img/quic_initial_packet_reading_1.png
|
105
|
+
# relative_width = 70
|
106
|
+
|
107
|
+
= It's a binary protocol
|
108
|
+
Reading QUIC message (same as last year's slide)
|
109
|
+
|
110
|
+
# image
|
111
|
+
# src = img/quic_initial_packet_reading_2.png
|
112
|
+
# relative_width = 70
|
113
|
+
|
114
|
+
= It's a binary protocol
|
115
|
+
Reading QUIC message (same as last year's slide)
|
116
|
+
|
117
|
+
# image
|
118
|
+
# src = img/quic_initial_packet_reading_3.png
|
119
|
+
# relative_width = 70
|
120
|
+
|
121
|
+
= It's a binary protocol
|
122
|
+
Reading QUIC message (same as last year's slide)
|
123
|
+
|
124
|
+
# image
|
125
|
+
# src = img/quic_initial_packet_reading_4.png
|
126
|
+
# relative_width = 70
|
127
|
+
|
128
|
+
= It's a binary protocol
|
129
|
+
Reading QUIC message (same as last year's slide)
|
130
|
+
|
131
|
+
# image
|
132
|
+
# src = img/quic_initial_packet_reading_5.png
|
133
|
+
# relative_width = 70
|
134
|
+
|
135
|
+
= It's a binary protocol
|
136
|
+
Reading QUIC message (same as last year's slide)
|
137
|
+
|
138
|
+
# image
|
139
|
+
# src = img/quic_initial_packet_reading_6.png
|
140
|
+
# relative_width = 70
|
141
|
+
|
142
|
+
= It's a binary protocol
|
143
|
+
Convert to bit-by-bit representation
|
144
|
+
|
145
|
+
# enscript ruby
|
146
|
+
"Hello".unpack1("B*")
|
147
|
+
# => "0100100001100101011011000110110001101111"
|
148
|
+
|
149
|
+
|
150
|
+
= It's a binary protocol
|
151
|
+
Oops!
|
152
|
+
|
153
|
+
# enscript ruby
|
154
|
+
|
155
|
+
data = "Hello".unpack1("B*")
|
156
|
+
# ...snip...
|
157
|
+
data.unpack1("B*") # unpack twice!
|
158
|
+
# => "001100000011000100110000001100000011000100110....
|
159
|
+
|
160
|
+
I wasted a lot of time because of this mistake. 🕖
|
161
|
+
|
162
|
+
= How are the other language implementations
|
163
|
+
Look around some QUIC impletemtations
|
164
|
+
|
165
|
+
* kwik (Java)
|
166
|
+
* quic-go (Go)
|
167
|
+
* cloudflare/quiche (Rust)
|
168
|
+
* aioquic (Python)
|
169
|
+
|
170
|
+
= kwik (Java) : QUIC impletemtations
|
171
|
+
# image
|
172
|
+
# src = img/kwik.png
|
173
|
+
# relative_width = 100
|
174
|
+
|
175
|
+
(('tag:xx-small'))
|
176
|
+
((<URL:https://github.com/ptrd/kwik/blob/d1c52e6ac3/src/main/java/net/luminis/quic/packet/QuicPacket.java#L89>))
|
177
|
+
|
178
|
+
= quic-go (Go) : QUIC impletemtations
|
179
|
+
# image
|
180
|
+
# src = img/quic-go.png
|
181
|
+
# relative_width = 100
|
182
|
+
|
183
|
+
(('tag:xx-small'))
|
184
|
+
((<URL:https://github.com/lucas-clemente/quic-go/blob/66f6fe0b711bc/packet_unpacker.go#L29-L34>))
|
185
|
+
|
186
|
+
= cloudflare/quiche (Rust) : QUIC impletemtations
|
187
|
+
# image
|
188
|
+
# src = img/quiche.png
|
189
|
+
# relative_width = 100
|
190
|
+
|
191
|
+
(('tag:xx-small'))
|
192
|
+
((<URL:https://github.com/cloudflare/quiche/blob/3131c0d37/octets/src/lib.rs#L329-L336>))
|
193
|
+
|
194
|
+
= aioquic (Python) : QUIC impletemtations
|
195
|
+
# image
|
196
|
+
# src = img/aioquic.png
|
197
|
+
# relative_width = 70
|
198
|
+
|
199
|
+
(('tag:xx-small'))
|
200
|
+
((<URL:https://github.com/aiortc/aioquic/blob/c758b4d936/src/aioquic/quic/packet.py#L477-L481>))
|
201
|
+
|
202
|
+
= back to the Ruby
|
203
|
+
* Those languages have Byte specific class or types
|
204
|
+
* but Ruby is not
|
205
|
+
* but we can use String or array of Integer
|
206
|
+
|
207
|
+
I would like to see a binary protocol implementation by Ruby that already exists.
|
208
|
+
|
209
|
+
→ MessagePack!
|
210
|
+
|
211
|
+
= msgpack/msgpack-ruby
|
212
|
+
MessagePack is an efficient binary serialization format.
|
213
|
+
|
214
|
+
((<URL:https://msgpack.org>))
|
215
|
+
|
216
|
+
= msgpack/msgpack-ruby
|
217
|
+
# image
|
218
|
+
# src = img/msgpack-ruby.png
|
219
|
+
# relative_width = 80
|
220
|
+
|
221
|
+
(('tag:xx-small'))
|
222
|
+
((<URL:https://github.com/msgpack/msgpack-ruby/blob/0775a9a6a5/ext/msgpack/unpacker.c#L75-L85>))
|
223
|
+
|
224
|
+
|
225
|
+
= compare languages
|
226
|
+
benchmaek for bytes manipulation (AWS c5.large Ubuntu 22.04)
|
227
|
+
|
228
|
+
# image
|
229
|
+
# src = img/bench_result.png
|
230
|
+
# relative_width = 65
|
231
|
+
|
232
|
+
= compare String and array of Integer
|
233
|
+
|
234
|
+
$ bundle exec ruby main.rb
|
235
|
+
Warming up --------------------------------------
|
236
|
+
hello_world_upcase_string 848.029k i/s - 872.655k times in 1.029039s (1.18μs/i)
|
237
|
+
hello_world_upcase_integer 1.268M i/s - 1.291M times in 1.018188s (788.58ns/i)
|
238
|
+
Calculating -------------------------------------
|
239
|
+
hello_world_upcase_string 861.605k i/s - 2.544M times in 2.952730s (1.16μs/i)
|
240
|
+
hello_world_upcase_integer 1.285M i/s - 3.804M times in 2.961585s (778.48ns/i)
|
241
|
+
|
242
|
+
Comparison:
|
243
|
+
hello_world_upcase_integer : 1284551.4 i/s
|
244
|
+
hello_world_upcase_string : 861605.1 i/s - 1.49x slower
|
245
|
+
|
246
|
+
= How to prevent mistake?
|
247
|
+
|
248
|
+
# enscript ruby
|
249
|
+
|
250
|
+
class UnpackedString < String
|
251
|
+
def unpack1()
|
252
|
+
raise RuntimeError
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
= It's an encrypted protocol
|
257
|
+
|
258
|
+
# image
|
259
|
+
# src = img/quic_initial_packet_reading_2.png
|
260
|
+
# relative_width = 70
|
261
|
+
|
262
|
+
= It's an encrypted protocol
|
263
|
+
|
264
|
+
compare String and array of Integer (re)
|
265
|
+
|
266
|
+
$ bundle exec ruby main.rb
|
267
|
+
Warming up --------------------------------------
|
268
|
+
hello_world_upcase_string 848.029k i/s - 872.655k times in 1.029039s (1.18μs/i)
|
269
|
+
hello_world_upcase_integer 1.268M i/s - 1.291M times in 1.018188s (788.58ns/i)
|
270
|
+
Calculating -------------------------------------
|
271
|
+
hello_world_upcase_string 861.605k i/s - 2.544M times in 2.952730s (1.16μs/i)
|
272
|
+
hello_world_upcase_integer 1.285M i/s - 3.804M times in 2.961585s (778.48ns/i)
|
273
|
+
|
274
|
+
Comparison:
|
275
|
+
hello_world_upcase_integer : 1284551.4 i/s
|
276
|
+
hello_world_upcase_string : 861605.1 i/s - 1.49x slower
|
277
|
+
|
278
|
+
= It's an encrypted protocol
|
279
|
+
leading "0" gone
|
280
|
+
|
281
|
+
# enscript ruby
|
282
|
+
|
283
|
+
"01001".to_i(16) # => 4097
|
284
|
+
"01001".to_i(16).to_s(16) # => "1001"
|
285
|
+
|
286
|
+
= XOR between String
|
287
|
+
|
288
|
+
# enscript ruby
|
289
|
+
|
290
|
+
def xor(a, b)
|
291
|
+
a.unpack("C*").zip(b.unpack("C*")).map do |x, y|
|
292
|
+
x ^ y
|
293
|
+
end.pack("C*")
|
294
|
+
end
|
295
|
+
|
296
|
+
= It's an encrypted protocol
|
297
|
+
|
298
|
+
# enscript ruby
|
299
|
+
|
300
|
+
data[0] = [(data[0].unpack1('H*').to_i(16) ^
|
301
|
+
(mask[0].unpack1('H*').to_i(16) & 0x0f)).to_s(16)].pack("H*")
|
302
|
+
|
303
|
+
# https://www.rfc-editor.org/rfc/rfc9001#figure-6
|
304
|
+
pn_length = (data[0].unpack1('H*').to_i(16) & 0x03) + 1
|
305
|
+
|
306
|
+
packet_number =
|
307
|
+
(data[pn_offset...pn_offset+pn_length].unpack1("H*").to_i(16) ^
|
308
|
+
mask[1...1+pn_length].unpack1("H*").to_i(16)).to_s(16)
|
309
|
+
|
310
|
+
# fill zero because leading "0" gone
|
311
|
+
data[pn_offset...pn_offset+pn_length] =
|
312
|
+
[("0" * (pn_length * 2 - packet_number.length)) + packet_number].pack("H*")
|
313
|
+
self.class.new(data, protected: false).tap {|p| p.parse}
|
314
|
+
|
315
|
+
Remove Initial packet protection
|
316
|
+
|
317
|
+
= XOR between byte (Python)
|
318
|
+
|
319
|
+
# enscript Python
|
320
|
+
|
321
|
+
bytes([aa ^ bb for aa, bb in zip(a, b)])
|
322
|
+
|
323
|
+
(('tag:xx-small'))
|
324
|
+
((<URL:https://programming-idioms.org/idiom/238/xor-byte-arrays/4146/python>))
|
325
|
+
|
326
|
+
= What should we do?
|
327
|
+
If there is no constraint for "Pure Ruby"...
|
328
|
+
|
329
|
+
* Write extension library by system programming language
|
330
|
+
* C or Rust
|
331
|
+
* Rust is popular
|
332
|
+
* ((<URL:https://github.com/rubygems/rubygems/pull/5613>))
|
333
|
+
* "Add support for bundle gem --rust command"
|
334
|
+
|
335
|
+
= QUIC, Some headers and many frames
|
336
|
+
* two type of headers
|
337
|
+
* long header, short header
|
338
|
+
* 20 types of frames
|
339
|
+
* padding, ping, ack, etc...
|
340
|
+
|
341
|
+
= QUIC, Some headers and many frames
|
342
|
+
|
343
|
+
# enscript ruby
|
344
|
+
|
345
|
+
private def find_frame_type(frame)
|
346
|
+
case [frame[0..7]].pack("B*")
|
347
|
+
when "\x00"
|
348
|
+
:padding
|
349
|
+
when "\x01"
|
350
|
+
:ping
|
351
|
+
when "\x02".."\x03"
|
352
|
+
:ack
|
353
|
+
# ......
|
354
|
+
|
355
|
+
Is it time for pattern matching? (This is a bad case. Too simple.)
|
356
|
+
|
357
|
+
= But, I'm negative about introducing special class for bytes data
|
358
|
+
* It may break the existing code base
|
359
|
+
* Ruby has 20+ years of history
|
360
|
+
* "Bytes" is a very common noun, especially computer science
|
361
|
+
* "bytes" gem was already taken 😏
|
362
|
+
|
363
|
+
So...
|
364
|
+
|
365
|
+
* Use another name of the String class
|
366
|
+
* Create own helper methods of bit operation
|
367
|
+
* Create extension library (if absolutely necessary)
|
368
|
+
|
369
|
+
= Conclusion
|
370
|
+
* handling/manipulating binary data in Ruby is hard
|
371
|
+
* than other languages that support bytes data as standard
|
372
|
+
* bit operation is slow
|
373
|
+
* should convert data on encrypt/decrypt operations
|
374
|
+
|
375
|
+
Why did I choose the "Pure Ruby" way?
|
376
|
+
|
377
|
+
* To avoid problems coming from ractor or multithreading
|
378
|
+
* Problems will appear near future...maybe...🤔
|
data/theme.rb
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
@default_foreground ||= @foreground
|
2
|
+
@default_background ||= @background
|
3
|
+
@default_shadow_color ||= @shadow_color
|
4
|
+
|
5
|
+
rubykaigi_color = '#2c2c31'
|
6
|
+
rubykaigi_purple = '#41414f'
|
7
|
+
@default_font = 'Poppins'
|
8
|
+
@font_family = find_font_family(@default_font)
|
9
|
+
@bold_font = @default_font
|
10
|
+
@bold_font_family = find_font_family(@bold_font)
|
11
|
+
@monospace_font = 'HackGen'
|
12
|
+
@monospace_font_family = find_font_family(@monospace_font)
|
13
|
+
|
14
|
+
@default_item1_mark_color = rubykaigi_purple
|
15
|
+
@default_item2_mark_color = rubykaigi_purple
|
16
|
+
|
17
|
+
@xxxx_large_font_size = screen_size(10 * Pango::SCALE)
|
18
|
+
@xxx_large_font_size = screen_size(8 * Pango::SCALE)
|
19
|
+
@xx_large_font_size = screen_size(6 * Pango::SCALE)
|
20
|
+
@x_large_font_size = screen_size(4.5 * Pango::SCALE)
|
21
|
+
@large_font_size = screen_size(4 * Pango::SCALE)
|
22
|
+
@normal_font_size = screen_size(3.5 * Pango::SCALE)
|
23
|
+
@small_font_size = screen_size(3.2 * Pango::SCALE)
|
24
|
+
@x_small_font_size = screen_size(3 * Pango::SCALE)
|
25
|
+
@xx_small_font_size = screen_size(2.8 * Pango::SCALE)
|
26
|
+
@xxx_small_font_size = screen_size(2.5 * Pango::SCALE)
|
27
|
+
@script_font_size = @x_small_font_size
|
28
|
+
@large_script_font_size = @small_font_size
|
29
|
+
@x_large_script_font_size = @large_font_size
|
30
|
+
@title_slide_title_font_size = @xxx_large_font_size
|
31
|
+
|
32
|
+
@block_quote_fill_color = "#f8f8f8"
|
33
|
+
@preformatted_fill_color = "#f8f8f8"
|
34
|
+
@default_headline_line_color = rubykaigi_color
|
35
|
+
@description_term_line_color = @default_headline_line_color
|
36
|
+
|
37
|
+
@title_slide_background_image = 'img/title_background_logo_center.png'
|
38
|
+
@slide_background_image = 'img/background.png'
|
39
|
+
|
40
|
+
# set_foreground(@default_foreground)
|
41
|
+
# set_background(@default_background)
|
42
|
+
|
43
|
+
add_image_path("ruby-images")
|
44
|
+
include_theme("default-icon")
|
45
|
+
include_theme("default-title-text")
|
46
|
+
include_theme("default-text")
|
47
|
+
include_theme("default-title-slide")
|
48
|
+
include_theme("default-slide")
|
49
|
+
include_theme("default-item-mark")
|
50
|
+
include_theme("default-method-list")
|
51
|
+
include_theme("default-preformatted")
|
52
|
+
include_theme("default-block-quote")
|
53
|
+
include_theme("default-foot-text")
|
54
|
+
include_theme("default-description")
|
55
|
+
include_theme("image")
|
56
|
+
include_theme("table")
|
57
|
+
include_theme("newline-in-slides")
|
58
|
+
include_theme("per-slide-background-color")
|
59
|
+
include_theme("background-image-toolkit")
|
60
|
+
include_theme("per-slide-background-image")
|
61
|
+
include_theme("body-background-image")
|
62
|
+
include_theme("tag")
|
63
|
+
include_theme("syntax-highlighting")
|
64
|
+
include_theme("default-comment")
|
65
|
+
|
66
|
+
include_theme("title-slide-background-image")
|
67
|
+
include_theme("slide-background-image")
|
68
|
+
|
69
|
+
match(TitleSlide, Title) do |titles|
|
70
|
+
titles.padding_top = @space * 28
|
71
|
+
titles.prop_set("size", screen_size(4.9 * Pango::SCALE))
|
72
|
+
titles.prop_set("weight", "SemiBold")
|
73
|
+
end
|
74
|
+
|
75
|
+
match(Slide, HeadLine) do |heads|
|
76
|
+
heads.prop_set("size", @large_font_size)
|
77
|
+
heads.prop_set("weight", "bold")
|
78
|
+
end
|
79
|
+
|
80
|
+
match(TitleSlide) do |slides|
|
81
|
+
# slides.margin_left = 900
|
82
|
+
slides.vertical_centering = true
|
83
|
+
slides.prop_set("foreground", rubykaigi_color)
|
84
|
+
slides.prop_set("weight", "SemiBold")
|
85
|
+
end
|
86
|
+
|
87
|
+
match(TitleSlide, Subtitle) do |subtitle|
|
88
|
+
subtitle.margin_top = -20
|
89
|
+
subtitle.prop_set("weight", "normal")
|
90
|
+
subtitle.prop_set("size", @large_font_size)
|
91
|
+
end
|
92
|
+
match(TitleSlide, Author) do |author|
|
93
|
+
author.margin_top = 25
|
94
|
+
author.prop_set("weight", "normal")
|
95
|
+
end
|
96
|
+
match(TitleSlide, Place) do |place|
|
97
|
+
place.prop_set("weight", "normal")
|
98
|
+
place.prop_set("size", @small_font_size)
|
99
|
+
end
|
100
|
+
match(TitleSlide, Date) do |date|
|
101
|
+
date.prop_set("weight", "normal")
|
102
|
+
end
|
103
|
+
match(TitleSlide, ContentSource) do |cs|
|
104
|
+
cs.prop_set("weight", "normal")
|
105
|
+
end
|
106
|
+
match(TitleSlide, "*") do |elems|
|
107
|
+
elems.horizontal_centering = true
|
108
|
+
end
|
109
|
+
match(Slide) do |slide|
|
110
|
+
slide.prop_set("foreground", rubykaigi_color)
|
111
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rabbit-slide-unasuke-rubykaigi-2022
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- unasuke
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-09-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rabbit
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.2
|
27
|
+
description: https://rubykaigi.org/2022/presentations/yu_suke1994.html
|
28
|
+
email:
|
29
|
+
- yusuke1994525@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".rabbit"
|
35
|
+
- README.rd
|
36
|
+
- Rakefile
|
37
|
+
- config.yaml
|
38
|
+
- img/aioquic.png
|
39
|
+
- img/background.png
|
40
|
+
- img/background_plain.png
|
41
|
+
- img/bench_result.png
|
42
|
+
- img/icon_face.jpeg
|
43
|
+
- img/kwik.png
|
44
|
+
- img/msgpack-ruby.png
|
45
|
+
- img/pixiv_ruby_music_mixin.png
|
46
|
+
- img/quic-go.png
|
47
|
+
- img/quic_initial_packet_reading_1.png
|
48
|
+
- img/quic_initial_packet_reading_2.png
|
49
|
+
- img/quic_initial_packet_reading_3.png
|
50
|
+
- img/quic_initial_packet_reading_4.png
|
51
|
+
- img/quic_initial_packet_reading_5.png
|
52
|
+
- img/quic_initial_packet_reading_6.png
|
53
|
+
- img/quiche.png
|
54
|
+
- img/talk_2021.png
|
55
|
+
- img/title_background_logo_center.png
|
56
|
+
- pdf/rubykaigi-2022-slide.pdf
|
57
|
+
- slide.rab
|
58
|
+
- theme.rb
|
59
|
+
homepage: https://slide.rabbit-shocker.org/authors/unasuke/rubykaigi-2022/
|
60
|
+
licenses:
|
61
|
+
- MIT
|
62
|
+
metadata: {}
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options: []
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
requirements: []
|
78
|
+
rubygems_version: 3.3.7
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: Do Pure Ruby Dream of Encrypted Binary Protocol?
|
82
|
+
test_files: []
|