Skip to content

Commit

Permalink
deploy: ed5811c
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed Nov 2, 2023
1 parent a97104f commit df16bac
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .build
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ dist/merriweather-latin-ext-300-normal-K6L27CZ5.woff2
dist/merriweather-vietnamese-300-italic-EHHNZPUO.woff2
dist/merriweather-vietnamese-300-normal-U376L4Z4.woff2
dist/remixicon-NKANDIL5.woff2
dist/search_data-9D1F71A6.js
dist/search_data-A44BFA9F.js
dist/sidebar_items-F49CEDA1.js
expression_language.html
gatherers.html
Expand Down
6 changes: 3 additions & 3 deletions Wanda.DataCase.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ <h1 class="signature" translate="no">errors_on(changeset)</h1>

<section class="docstring">

<p>A helper that transforms changeset errors into a map of messages.</p><pre><code class="makeup elixir" translate="no"><span class="n">assert</span><span class="w"> </span><span class="p" data-group-id="6549406268-1">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="n">changeset</span><span class="p" data-group-id="6549406268-1">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Accounts</span><span class="o">.</span><span class="n">create_user</span><span class="p" data-group-id="6549406268-2">(</span><span class="p" data-group-id="6549406268-3">%{</span><span class="ss">password</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;short&quot;</span><span class="p" data-group-id="6549406268-3">}</span><span class="p" data-group-id="6549406268-2">)</span><span class="w">
</span><span class="n">assert</span><span class="w"> </span><span class="s">&quot;password is too short&quot;</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="n">errors_on</span><span class="p" data-group-id="6549406268-4">(</span><span class="n">changeset</span><span class="p" data-group-id="6549406268-4">)</span><span class="o">.</span><span class="n">password</span><span class="w">
</span><span class="n">assert</span><span class="w"> </span><span class="p" data-group-id="6549406268-5">%{</span><span class="ss">password</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6549406268-6">[</span><span class="s">&quot;password is too short&quot;</span><span class="p" data-group-id="6549406268-6">]</span><span class="p" data-group-id="6549406268-5">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">errors_on</span><span class="p" data-group-id="6549406268-7">(</span><span class="n">changeset</span><span class="p" data-group-id="6549406268-7">)</span></code></pre>
<p>A helper that transforms changeset errors into a map of messages.</p><pre><code class="makeup elixir" translate="no"><span class="n">assert</span><span class="w"> </span><span class="p" data-group-id="8746109171-1">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="n">changeset</span><span class="p" data-group-id="8746109171-1">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Accounts</span><span class="o">.</span><span class="n">create_user</span><span class="p" data-group-id="8746109171-2">(</span><span class="p" data-group-id="8746109171-3">%{</span><span class="ss">password</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;short&quot;</span><span class="p" data-group-id="8746109171-3">}</span><span class="p" data-group-id="8746109171-2">)</span><span class="w">
</span><span class="n">assert</span><span class="w"> </span><span class="s">&quot;password is too short&quot;</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="n">errors_on</span><span class="p" data-group-id="8746109171-4">(</span><span class="n">changeset</span><span class="p" data-group-id="8746109171-4">)</span><span class="o">.</span><span class="n">password</span><span class="w">
</span><span class="n">assert</span><span class="w"> </span><span class="p" data-group-id="8746109171-5">%{</span><span class="ss">password</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8746109171-6">[</span><span class="s">&quot;password is too short&quot;</span><span class="p" data-group-id="8746109171-6">]</span><span class="p" data-group-id="8746109171-5">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">errors_on</span><span class="p" data-group-id="8746109171-7">(</span><span class="n">changeset</span><span class="p" data-group-id="8746109171-7">)</span></code></pre>
</section>
</section>
<section class="detail" id="setup_sandbox/1">
Expand Down
Binary file modified Wanda.epub
Binary file not shown.

Large diffs are not rendered by default.

48 changes: 45 additions & 3 deletions gatherers.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hack_on_wanda.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ <h2 id="requirements" class="section-heading">
</a>
<span class="text">Ensure Compatibility with asdf</span>
</h3>
<p><a href="https://asdf-vm.com/guide/introduction.html">asdf</a> allows using specific versions of programming language tools that are known to be compatible with the project, rather than relying on the version that's installed globally on the host system.</p><p>In order to use asdf, follow the official <a href="https://asdf-vm.com/guide/getting-started.html">asdf getting started guide</a>.</p><p>Install all required asdf plugins from <a href="/.tool-versions">.tool-versions</a> inside the web repository.</p><pre><code class="makeup elixir" translate="no"><span class="n">cut</span><span class="w"> </span><span class="o">-</span><span class="n">d</span><span class="sc">&#39; &#39;</span><span class="w"> </span><span class="o">-</span><span class="n">f1</span><span class="w"> </span><span class="o">.</span><span class="n">tool</span><span class="o">-</span><span class="n">versions</span><span class="o">|</span><span class="n">xargs</span><span class="w"> </span><span class="o">-</span><span class="n">i</span><span class="w"> </span><span class="n">asdf</span><span class="w"> </span><span class="n">plugin</span><span class="w"> </span><span class="n">add</span><span class="w"> </span><span class="p" data-group-id="2401201916-1">{</span><span class="p" data-group-id="2401201916-1">}</span></code></pre><p>Set up the asdf environment</p><pre><code class="makeup elixir" translate="no"><span class="n">asdf</span><span class="w"> </span><span class="n">install</span></code></pre><h2 id="development-environment" class="section-heading">
<p><a href="https://asdf-vm.com/guide/introduction.html">asdf</a> allows using specific versions of programming language tools that are known to be compatible with the project, rather than relying on the version that's installed globally on the host system.</p><p>In order to use asdf, follow the official <a href="https://asdf-vm.com/guide/getting-started.html">asdf getting started guide</a>.</p><p>Install all required asdf plugins from <a href="/.tool-versions">.tool-versions</a> inside the web repository.</p><pre><code class="makeup elixir" translate="no"><span class="n">cut</span><span class="w"> </span><span class="o">-</span><span class="n">d</span><span class="sc">&#39; &#39;</span><span class="w"> </span><span class="o">-</span><span class="n">f1</span><span class="w"> </span><span class="o">.</span><span class="n">tool</span><span class="o">-</span><span class="n">versions</span><span class="o">|</span><span class="n">xargs</span><span class="w"> </span><span class="o">-</span><span class="n">i</span><span class="w"> </span><span class="n">asdf</span><span class="w"> </span><span class="n">plugin</span><span class="w"> </span><span class="n">add</span><span class="w"> </span><span class="p" data-group-id="3413532009-1">{</span><span class="p" data-group-id="3413532009-1">}</span></code></pre><p>Set up the asdf environment</p><pre><code class="makeup elixir" translate="no"><span class="n">asdf</span><span class="w"> </span><span class="n">install</span></code></pre><h2 id="development-environment" class="section-heading">
<a href="#development-environment" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
Expand Down
8 changes: 4 additions & 4 deletions readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,14 @@ <h1>
</h3>
<p>Often times knowing the returned value of the gathered facts is not a trivial thing, more during the implementation of new checks.</p><p>To better debug the fact gathering process and the returned values, the <code class="inline">facts</code> subcommand of <code class="inline">trento-agent</code> is a really useful tool. This command helps to see in the target itself what the gathered fact looks like. This is specially interesting when the returned value is a complex object or the target under test is modified and the check developer wants to see how this affects the gathered fact.</p><p>The command can be used as:</p><pre><code class="makeup elixir" translate="no"><span class="o">.</span><span class="o">/</span><span class="n">trento</span><span class="o">-</span><span class="n">agent</span><span class="w"> </span><span class="n">facts</span><span class="w"> </span><span class="n">gather</span><span class="w"> </span><span class="o">--</span><span class="n">gatherer</span><span class="w"> </span><span class="n">corosync</span><span class="o">.</span><span class="n">conf</span><span class="w"> </span><span class="o">--</span><span class="n">argument</span><span class="w"> </span><span class="n">totem</span><span class="o">.</span><span class="n">token</span><span class="w">
</span><span class="c1"># To see the currently available gatherers and their names</span><span class="w">
</span><span class="c1"># ./trento-agent facts list</span></code></pre><p>Which would return the next where the <code class="inline">Value</code> is the available value in the written check:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="1466399726-1">{</span><span class="w">
</span><span class="c1"># ./trento-agent facts list</span></code></pre><p>Which would return the next where the <code class="inline">Value</code> is the available value in the written check:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="6316756973-1">{</span><span class="w">
</span><span class="ss">&quot;Name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;totem.token&quot;</span><span class="p">,</span><span class="w">
</span><span class="ss">&quot;CheckID&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="p">,</span><span class="w">
</span><span class="ss">&quot;Value&quot;</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="1466399726-2">{</span><span class="w">
</span><span class="ss">&quot;Value&quot;</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6316756973-2">{</span><span class="w">
</span><span class="ss">&quot;Value&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">30000</span><span class="w">
</span><span class="p" data-group-id="1466399726-2">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="6316756973-2">}</span><span class="p">,</span><span class="w">
</span><span class="ss">&quot;Error&quot;</span><span class="p">:</span><span class="w"> </span><span class="n">null</span><span class="w">
</span><span class="p" data-group-id="1466399726-1">}</span></code></pre><h2 id="adding-new-checks" class="section-heading">
</span><span class="p" data-group-id="6316756973-1">}</span></code></pre><h2 id="adding-new-checks" class="section-heading">
<a href="#adding-new-checks" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
Expand Down
2 changes: 1 addition & 1 deletion search.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ <h1>

<div class="loading"><div></div><div></div><div></div><div></div></div>
</div>
<script src="dist/search_data-9D1F71A6.js"></script>
<script src="dist/search_data-A44BFA9F.js"></script>
<footer class="footer">
<p>

Expand Down
6 changes: 3 additions & 3 deletions specification.html
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,12 @@ <h1>
</span><span class="o">-</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="n">bar_expectation</span><span class="w">
</span><span class="ss">expect</span><span class="p">:</span><span class="w"> </span><span class="n">facts</span><span class="o">.</span><span class="n">bar</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">values</span><span class="o">.</span><span class="n">expected_bar</span></code></pre></li><li><p>Pipe the expression language functions vertically in order to provide a better visual output of the code.<br/>So this:</p><pre><code class="makeup elixir" translate="no"><span class="ss">expectations</span><span class="p">:</span><span class="w">
</span><span class="o">-</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="n">some_expectation</span><span class="w">
</span><span class="ss">expect</span><span class="p">:</span><span class="w"> </span><span class="n">facts</span><span class="o">.</span><span class="n">foo</span><span class="o">.</span><span class="n">find</span><span class="p" data-group-id="7251359867-1">(</span><span class="o">|</span><span class="n">item</span><span class="o">|</span><span class="w"> </span><span class="n">item</span><span class="o">.</span><span class="n">id</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;super&quot;</span><span class="p" data-group-id="7251359867-1">)</span><span class="o">.</span><span class="n">properties</span><span class="o">.</span><span class="n">find</span><span class="p" data-group-id="7251359867-2">(</span><span class="o">|</span><span class="n">prop</span><span class="o">|</span><span class="w"> </span><span class="n">prop</span><span class="o">.</span><span class="n">name</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;good&quot;</span><span class="p" data-group-id="7251359867-2">)</span><span class="o">.</span><span class="n">value</span></code></pre><p>would be:</p><pre><code class="makeup elixir" translate="no"><span class="ss">expectations</span><span class="p">:</span><span class="w">
</span><span class="ss">expect</span><span class="p">:</span><span class="w"> </span><span class="n">facts</span><span class="o">.</span><span class="n">foo</span><span class="o">.</span><span class="n">find</span><span class="p" data-group-id="6128264542-1">(</span><span class="o">|</span><span class="n">item</span><span class="o">|</span><span class="w"> </span><span class="n">item</span><span class="o">.</span><span class="n">id</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;super&quot;</span><span class="p" data-group-id="6128264542-1">)</span><span class="o">.</span><span class="n">properties</span><span class="o">.</span><span class="n">find</span><span class="p" data-group-id="6128264542-2">(</span><span class="o">|</span><span class="n">prop</span><span class="o">|</span><span class="w"> </span><span class="n">prop</span><span class="o">.</span><span class="n">name</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;good&quot;</span><span class="p" data-group-id="6128264542-2">)</span><span class="o">.</span><span class="n">value</span></code></pre><p>would be:</p><pre><code class="makeup elixir" translate="no"><span class="ss">expectations</span><span class="p">:</span><span class="w">
</span><span class="o">-</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="n">some_expectation</span><span class="w">
</span><span class="ss">expect</span><span class="p">:</span><span class="w"> </span><span class="o">|</span><span class="w">
</span><span class="n">facts</span><span class="o">.</span><span class="n">foo</span><span class="w">
</span><span class="o">.</span><span class="n">find</span><span class="p" data-group-id="7258705856-1">(</span><span class="o">|</span><span class="n">item</span><span class="o">|</span><span class="w"> </span><span class="n">item</span><span class="o">.</span><span class="n">id</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;super&quot;</span><span class="p" data-group-id="7258705856-1">)</span><span class="o">.</span><span class="n">properties</span><span class="w">
</span><span class="o">.</span><span class="n">find</span><span class="p" data-group-id="7258705856-2">(</span><span class="o">|</span><span class="n">prop</span><span class="o">|</span><span class="w"> </span><span class="n">prop</span><span class="o">.</span><span class="n">name</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;good&quot;</span><span class="p" data-group-id="7258705856-2">)</span><span class="o">.</span><span class="n">value</span></code></pre><blockquote><p>Note: Keep in mind that some functions such as <code class="inline">sort</code> and <code class="inline">drain</code> run in-place modifications, so they cannot be piped.</p></blockquote></li></ul>
</span><span class="o">.</span><span class="n">find</span><span class="p" data-group-id="8361667259-1">(</span><span class="o">|</span><span class="n">item</span><span class="o">|</span><span class="w"> </span><span class="n">item</span><span class="o">.</span><span class="n">id</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;super&quot;</span><span class="p" data-group-id="8361667259-1">)</span><span class="o">.</span><span class="n">properties</span><span class="w">
</span><span class="o">.</span><span class="n">find</span><span class="p" data-group-id="8361667259-2">(</span><span class="o">|</span><span class="n">prop</span><span class="o">|</span><span class="w"> </span><span class="n">prop</span><span class="o">.</span><span class="n">name</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;good&quot;</span><span class="p" data-group-id="8361667259-2">)</span><span class="o">.</span><span class="n">value</span></code></pre><blockquote><p>Note: Keep in mind that some functions such as <code class="inline">sort</code> and <code class="inline">drain</code> run in-place modifications, so they cannot be piped.</p></blockquote></li></ul>
<div class="bottom-actions">
<div class="bottom-actions-item">

Expand Down

0 comments on commit df16bac

Please sign in to comment.