This repository has been archived by the owner on Nov 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
285 lines (276 loc) · 8.64 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html; charset=" http-equiv="Content-Type">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta content="Asciidoctor 1.5.4" name="generator">
<title>Using direnv with ruby</title>
<link href="deck.js/core/deck.core.css" rel="stylesheet">
<link href="deck.js/extensions/scale/deck.scale.css" media="screen" rel="stylesheet">
<link href="deck.js/extensions/menu/deck.menu.css" media="screen" rel="stylesheet">
<link href="deck.js/extensions/navigation/deck.navigation.css" media="screen" rel="stylesheet">
<link href="deck.js/extensions/status/deck.status.css" media="screen" rel="stylesheet">
<link href="deck.js/themes/style/web-2.0.css" media="screen" rel="stylesheet">
<link href="deck.js/themes/transition/horizontal-slide.css" media="screen" rel="stylesheet">
<link href="deck.js/core/print.css" media="print" rel="stylesheet">
<script src="deck.js/modernizr.custom.js"></script>
</head>
<body class="article">
<div class="deck-container">
<section class="slide" id="title-slide">
<h1>Using direnv with ruby</h1>
</section>
<section class="slide" id="_hi">
<h2>Hi</h2>
<div class="paragraph"><p>Jonas Pfenniger Chevalier IRL</p></div>
<div class="paragraph"><p>zimbatm everywhere else: twitter, github, …​</p></div>
<div class="paragraph"><p><a class="bare" href="http://zimbatm.com">http://zimbatm.com</a></p></div>
<div class="paragraph"><p>Works at <span class="image"><img alt="Pusher" src="pusher_logo_dark.png" width="40%"></span></p></div>
</section>
<section class="slide" id="_overview">
<h2>Overview</h2>
<div class="paragraph"><p>25 minutes</p></div>
<div class="ulist">
<ul>
<li>presenting direnv</li>
<li>how to use with ruby</li>
<li>and 12factor apps</li>
</ul>
</div>
</section>
<section class="slide" id="_context">
<h2>Context</h2>
<div class="ulist">
<ul>
<li>shell</li>
<li>prompt</li>
<li>environment variables</li>
</ul>
</div>
</section>
<section class="slide" id="_enter_direnv">
<h2>Enter direnv</h2>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code>brew install direnv
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
exec bash</code></pre>
</div>
</div>
<div class="paragraph"><p>supports bash, zsh, fish, tcsh and more</p></div>
<div class="paragraph"><p>packages for homebrew, debian, archlinux and nixos. or just grab the binary.</p></div>
</section>
<section class="slide" id="_how_it_works">
<h2>How it works</h2>
<div class="paragraph"><p>hook into shell</p></div>
<div class="paragraph"><p><code>eval "direnv export <shell>"</code> executed before every prompt</p></div>
<div class="paragraph"><p>load <code>.envrc</code> in bash if found</p></div>
</section>
<section class="slide" id="_security_model">
<h2>Security model</h2>
<div class="paragraph"><p><code>~/.config/direnv/allowed/$(hash(path + .envrc content))</code></p></div>
</section>
<section class="slide" id="_basic_usage">
<h2>Basic usage</h2>
<div class="ulist">
<ul>
<li>cd into directory, loads env</li>
<li>cd out, unloads env</li>
</ul>
</div>
</section>
<section class="slide" id="_the_stdlib">
<h2>The stdlib</h2>
<div class="paragraph"><p>injected into the bash <code>.envrc</code> context</p></div>
<div class="ulist">
<ul>
<li>PATH_add</li>
<li>load_prefix</li>
<li>dotenv</li>
<li>source_env / source_up</li>
<li>layout</li>
<li>use</li>
<li>…​</li>
</ul>
</div>
<div class="paragraph"><p><code>man direnv-stdlib</code></p></div>
<div class="paragraph"><p><code>direnv stdlib | less</code></p></div>
</section>
<section class="slide" id="_extend_the_stdlib">
<h2>Extend the stdlib</h2>
<div class="paragraph"><p>Write your own in <code>~/.direnvrc</code></p></div>
</section>
<section class="slide" id="_build_your_own_adventure_wruby_version_switcher">
<h2>Build your own adventure^Wruby version switcher</h2>
<div class="paragraph"><p><code>ruby-install ruby 1.9.3</code></p></div>
<div class="paragraph"><p><code>~/.direnvrc</code></p></div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="bash language-bash">use_ruby() {
load_prefix "$HOME/.rubies/ruby-$1"
}</code></pre>
</div>
</div>
<div class="paragraph"><p><code>.envrc</code></p></div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code>use ruby 1.9.3-p551</code></pre>
</div>
</div>
</section>
<section class="slide" id="_small_improvements">
<h2>Small improvements</h2>
<div class="paragraph"><p><code>~/.direnvrc</code></p></div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="bash language-bash">use_ruby() {
load_prefix "$HOME/.rubies/$1"
layout ruby
}
ruby-version() {
use ruby ruby-"$(< .ruby-version)"
}</code></pre>
</div>
</div>
<div class="paragraph"><p><code>.envrc</code></p></div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code>ruby-version
dotenv</code></pre>
</div>
</div>
</section>
<section class="slide" id="_git_config">
<h2>Git config</h2>
<div class="paragraph"><p>How to avoid having <code>.direnv/</code> listed in git</p></div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code>$ git config core.excludesfile ~/.gitignore_global</code></pre>
</div>
</div>
</section>
<section class="slide" id="_future">
<h2>Future</h2>
<div class="ulist">
<ul>
<li>multiple profiles, <code>direnv switch</code></li>
<li>dependency change-tracking</li>
<li>layout auto</li>
</ul>
</div>
</section>
<section class="slide" id="_questions">
<h2>Questions ?</h2>
<div class="paragraph"><p><a class="bare" href="http://direnv.net">http://direnv.net</a></p></div>
<div class="paragraph"><p><a class="bare" href="https://github.com/direnv/direnv-and-ruby-talk">https://github.com/direnv/direnv-and-ruby-talk</a></p></div>
<div class="paragraph"><p><a class="bare" href="http://zimbatm.com">http://zimbatm.com</a></p></div>
</section>
<div aria-role="navigation">
<a class="deck-prev-link" href="#" title="Previous">←</a>
<a class="deck-next-link" href="#" title="Next">→</a>
</div>
<p aria-role="status" class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
</div>
<script src="deck.js/jquery.min.js"></script>
<script src="deck.js/core/deck.core.js"></script>
<script src="deck.js/extensions/scale/deck.scale.js"></script>
<script src="deck.js/extensions/menu/deck.menu.js"></script>
<script src="deck.js/extensions/navigation/deck.navigation.js"></script>
<script src="deck.js/extensions/status/deck.status.js"></script>
<script>
(function($, deck, undefined) {
$.deck.defaults.keys['previous'] = [8, 33, 37, 39];
$.deck.defaults.keys['next'] = [13, 32, 34, 39];
$.extend(true, $[deck].defaults, {
countNested: false
});
$.deck('.slide');
})(jQuery, 'deck');
</script>
<style>
.slide.canvas-image {
-moz-background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
background-size: cover;
display: -moz-box;
display: -webkit-box;
display: -ms-box;
display: box;
-moz-box-orient: vertical;
-webkit-box-orient: vertical;
-ms-box-orient: vertical;
box-orient: vertical;
-moz-box-align: start;
-webkit-box-align: start;
-ms-box-align: start;
box-align: start;
-moz-box-pack: start;
-webkit-box-pack: start;
-ms-box-pack: start;
box-pack: start;}
.bottom-left {
left: 1%;
bottom: 20%; }
.top-left {
left: 1%;
top: 20%; }
.bottom-right {
right: 1%;
bottom: 20%; }
.top-right {
right: 1%;
top: 20%; }
.center-up {
right: 50%;
top: 1%;
}
.center-down {
right: 50%;
bottom: 1%;
}
.canvas-image .canvas-caption p {
text-align: center;
padding-top: 0;
padding: 0;
-moz-transform: none;
-webkit-transform: none;
-o-transform: none;
-ms-transform: none;
transform: none;
display: inline;
position: absolute;
background-color: rgba(0, 0, 0, 0.7);
font-weight: bold;
font-size: 58px;
-webkit-box-shadow: 2px 2px 2px #000;
-moz-box-shadow: 2px 2px 2px #000;
box-shadow: 2px 2px 2px #000;
padding: 1rem;
color: white; }
kbd.keyseq { color: #555555; }
kbd:not(.keyseq) {
display: inline-block;
color: #222222;
font-size: 0.7em;
line-height: 1.4;
background-color: #F7F7F7;
border: 1px solid #ccc;
-webkit-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px white inset;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px white inset;
margin: -0.15em 0.15em 0 0.15em;
padding: 0.2em 0.6em;
vertical-align: middle;
white-space: nowrap;
}
kbd kbd:first-child { margin-left: 0; }
kbd kbd:last-child { margin-right: 0; }
</style>
</body>
</html>