Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in Appendix B. Composition and Coordination #182

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
20 changes: 12 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GEM
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.0.7)
ffi (1.9.8)
ffi (1.15.5)
formatador (0.2.5)
guard (2.12.6)
formatador (>= 0.2.4)
Expand All @@ -40,7 +40,8 @@ GEM
guard-nanoc (1.0.3)
guard (~> 2.8)
nanoc (~> 3.6)
haml (4.0.6)
haml (5.0.0)
temple (>= 0.8.0)
tilt
hitimes (1.2.2)
http_parser.rb (0.6.0)
Expand All @@ -50,16 +51,17 @@ GEM
rb-inotify (>= 0.9)
lumberjack (1.0.9)
method_source (0.8.2)
mini_portile (0.6.2)
mini_portile2 (2.8.0)
multi_json (1.11.0)
nanoc (3.7.4)
cri (~> 2.3)
nanoc-asciidoctor (1.0.1)
asciidoctor (> 0.1, < 2.0)
nanoc (>= 3.6.7, < 4.0.0)
nenv (0.2.0)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
nokogiri (1.13.2)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
notiffany (0.0.6)
nenv (~> 0.1)
shellany (~> 0.0)
Expand All @@ -71,20 +73,22 @@ GEM
pygments.rb (0.6.0)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rack (1.6.1)
racc (1.6.0)
rack (2.2.3)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
redcarpet (3.3.1)
redcarpet (3.5.1)
sass (3.4.9)
sassy-maps (0.4.0)
sass (~> 3.3)
shellany (0.0.1)
slop (3.6.0)
susy (2.2.1)
sass (>= 3.3.0, < 3.5)
temple (0.8.2)
thor (0.19.1)
tilt (2.0.1)
tilt (2.0.10)
timers (4.0.1)
hitimes
yajl-ruby (1.1.0)
Expand Down
2 changes: 1 addition & 1 deletion content/cftbat/appendix-b.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h2>The REPL</h2>
<p class="Body"><span>And of course, you can use </span><code>deftask</code><span> in the REPL as well—it’s just Clojure, after all. The takeaway is that Boot lets you interact with your tasks as Clojure functions, because that’s what they are.</span></p>
<h2>Composition and Coordination</h2>
<p class="BodyFirst">If what you’ve seen so far was all that Boot had to offer, it’d be a pretty swell tool, but it wouldn’t be very different from other build tools. One feature that sets Boot apart is how it lets you compose tasks. For comparison’s sake, here’s an example Rake invocation (Rake is the premier Ruby build tool):</p>
<div class="listingblock"><div class="content"><pre class="pygments highlight"><code data-lang="clojure" class="block"><span class="tok-nv">rake</span> <span class="tok-nv">db</span><span class="tok-ss">:create</span> <span class="tok-nv">d</span><span class="tok-p">{</span><span class="tok-ss">:tag</span> <span class="tok-ss">:a</span>, <span class="tok-ss">:attrs</span> <span class="tok-p">{</span><span class="tok-ss">:href</span> <span class="tok-s">"db:seed"</span><span class="tok-p">}</span>, <span class="tok-ss">:content</span> <span class="tok-p">[</span><span class="tok-s">"b:migra"</span><span class="tok-p">]}</span><span class="tok-nv">te</span> <span class="tok-nv">db</span><span class="tok-ss">:seed</span>
<div class="listingblock"><div class="content"><pre class="pygments highlight"><code data-lang="clojure" class="block"><span class="tok-nv">rake</span> <span class="tok-nv">db</span><span class="tok-ss">:create</span> <span class="tok-nv">d</span><span class="tok-p">{</span><span class="tok-ss">:tag</span> <span class="tok-ss">:a</span>, <span class="tok-ss">:attrs</span> <span class="tok-p">{</span><span class="tok-ss">:href</span> <span class="tok-s">"db:seed"</span><span class="tok-p">}</span>, <span class="tok-ss">:content</span> <span class="tok-p">[</span><span class="tok-s">"b:migrate"</span><span class="tok-p">]}</span><span class="tok-nv"></span> <span class="tok-nv">db</span><span class="tok-ss">:seed</span>
</code></pre></div></div>

<p class="Body">This code will create a database, run migrations on it, and populate it with seed data when run in a Rails project. However, worth noting is that <span>Rake doesn’t provide any way for these tasks to communicate with each other. Specifying multiple tasks is just a convenience, saving you from hav</span>ing to run <code>rake db:create; rake db:migrate; rake db:seed</code>. If you want to access the result of Task A within Task B, the build tool doesn’t help you; you have to manage that coordination yourself. Usually, you’ll do this by shoving the result of Task A into a special place on the filesystem and then making sure Task B reads that special place. This looks like programming with mutable, global variables, and it’s just as brittle.</p>
Expand Down