Acme-CPANModulesBundle-Import-PerlDancerAdvent-2018

 view release on metacpan or  search on metacpan

devdata/http_advent.perldancer.org_2018_13  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> The Twelve Days of Dancer | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>

devdata/http_advent.perldancer.org_2018_14  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> Dancer Survey Result Recap | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>

devdata/http_advent.perldancer.org_2018_15  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> Dancer2::Plugin::Paginator - Born Again | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>

devdata/http_advent.perldancer.org_2018_16  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> Using Minion in Dancer Apps | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>

devdata/http_advent.perldancer.org_2018_17  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> Dancer and Email | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>

devdata/http_advent.perldancer.org_2018_18  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> Customizing and extending your Dancer2 application generation | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>

devdata/http_advent.perldancer.org_2018_19  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> Logging with Dancer2::Logger::Log4perl | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>

devdata/http_advent.perldancer.org_2018_20  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> Testing Dancer with Test::Mojo | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>

devdata/http_advent.perldancer.org_2018_20  view on Meta::CPAN

  -&gt;content_type_like(qr[text/plain])
  -&gt;content_is('hello world');</pre>

<p>Each of the above method calls is a test.
The first, <code>get_ok</code>, builds a transaction and requests the resource.
Since the url is relative, it is handled by the app (if we wanted we could request and web resource too using a fully qualified url).
The transaction is stored in the tester object (<code>$t</code>) and all following tests will check it until it is replaced by the next request.</p>
<p>The remaining tests are reasonably self-explanatory, we check that the response status was 200, that we got a content type header that we expected and that its content is as we expect.
The content has already been utf-8 decoded, and the script has implicitly <code>use utf8</code>, so if you expected unicode, you can compare them easily.
The tests return the tester object so chaining is possible, making for visually clean sets of tests.</p>
<p>The next test is similar but this one uses the standard <a href="https://mojolicious.org/perldoc/Mojo/UserAgent">Mojo::UserAgent</a> style request generation to build a query string naming Santa for our greeting.
The tests are all the same except of course that it checks that the content greets Santa.</p>
<pre class="prettyprint">$t-&gt;get_ok('/text', form =&gt; { name =&gt; 'santa' })
  -&gt;status_is(200)
  -&gt;content_type_like(qr[text/plain])
  -&gt;content_is('hello santa');</pre>

<p>Moving on we request the data endpoint, both without and with a query, then similarly test the responses.</p>
<pre class="prettyprint">$t-&gt;get_ok('/data')
  -&gt;status_is(200)
  -&gt;content_type_like(qr[application/json])

devdata/http_advent.perldancer.org_2018_21  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> Spam and bot prevention without the use of CAPTCHAs | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>

devdata/http_advent.perldancer.org_2018_22  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> Parameter testing with Dancer2::Plugin::ParamTypes | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>

devdata/http_advent.perldancer.org_2018_23  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> Dancer2::Logger::Console::Colored | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>

devdata/http_advent.perldancer.org_2018_23  view on Meta::CPAN

    Console::Colored:
      colored_regex:
       - re: "customer number \d+"
         color: "bold red"</pre>

<p>This will find customer numbers according to the pattern and make them bold and red. You can supply
a regular expression pattern and a color setting.</p>
<img src="/images/2018/23/log-2.png">

<p>Note that there is a list under the <code>colored_regex</code> key. This means you can actually have
multiple patterns. Even really simple ones that make <code>print</code> style debugging easy
and attractive.</p>
<pre class="prettyprint"># config.yml
engines:
  logger:
    Console::Colored:
      colored_regex:
       - re: "customer number \d+"
         color: "bold red"
       - re: "\bhere\b"
         color: "white on_green"</pre>

devdata/http_advent.perldancer.org_2018_24  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> What's next for Dancer? (looking into the future) | PerlDancer Advent Calendar</title>
<link rel="stylesheet" href="/css/style.css" />
<link rel="alternate" type="application/rss+xml" title="All Articles " href="/feed/2018" /> 


<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">/* <![CDATA[ */
    !window.jQuery && document.write('<script src="/javascripts/jquery.js"><\/script>')
/* ]]> */</script>

<!-- Prettyfy -->
<link href="/css/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/javascripts/prettify.js"></script>

</head>
<body onload="prettyPrint()">
<div id="page">

<div id="sidebar">
<a href="/" class="homelink">Dancer Advent Calendar</a><br />

<p>



( run in 0.849 second using v1.01-cache-2.11-cpan-49f99fa48dc )