<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div class="" style=""><span class="" style="">Hey,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class=""><span class="" style=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class=""><span class="" style="">Looks pretty good, any chance we could get a patch via github :&nbsp;<a href="https://github.com/perl-catalyst/catalyst-runtime" class="" style="">perl-catalyst/catalyst-runtime</a>?</span></div><div style="width:450px; font-family: 'Georgia',
 'Times', 'Times New Roman', 'serif';" contenteditable="false" id="enhancrCard_0" class="link-enhancr-attachment link-enhancr-element"><table class="link-enhancr-element" cellspacing="0" cellpadding="0" style="width:450px; height:170px; position: relative; margin-top:5px; margin-bottom: 5px; display: block;"><tbody><tr class="link-enhancr-element"><td colspan="6" class="link-enhancr-element" style="height: 1px; background-color: #e5e5e5;"><div class="link-enhancr-element" style="height: 1px; background-color: #e5e5e5;"></div></td></tr><tr class="link-enhancr-element"><td rowspan="2" class="link-enhancr-element" style="width: 1px; background-color: #e5e5e5;"><div class="link-enhancr-element" style="width: 1px; background-color: #e5e5e5;"></div></td><td class="link-enhancr-element" rowspan="2" style="vertical-align: middle; width: 168px; height: 168px; background-color: #000000;"><div class="link-enhancr-element" style="width: 168px;" align="center"><a
 href="https://github.com/perl-catalyst/catalyst-runtime" class="link-enhancr-card-urlWrapper link-enhancr-element" style="text-decoration: none !important; color: #000000 !important;"><img alt="image" src="https://avatars0.githubusercontent.com/u/2287815?s=400" class="link-enhancr-thumbnail-image link-enhancr-element" width="168" height="168" style="display: block; margin: auto;"></a></div></td><td rowspan="2" class="link-enhancr-element" style="width: 1px; background-color: #e5e5e5;"><div class="link-enhancr-element" style="width: 1px; background-color: #e5e5e5;"></div></td><td class="link-enhancr-element" colspan="2" style="width: 100%; vertical-align: middle; font-family: 'Georgia', 'Times', 'Times New Roman', 'serif';"><div class="link-enhancr-text-part link-enhancr-element" style="line-height:16.5px; background-color: #ffffff; height: 130px; width: 279px;"><div class="link-enhancr-element" style="word-wrap: break-word; padding: 7px 20px 0px
 14px;"><span class="link-enhancr-element icon  icon-shrink link-enhancr-toggle"></span><span class="link-enhancr-element icon icon-close link-enhancr-delete"></span><a href="https://github.com/perl-catalyst/catalyst-runtime" class="link-enhancr-card-urlWrapper link-enhancr-element" style="text-decoration: none !important; color: #000000 !important;"><span class="link-enhancr-element link-enhancr-card-title" style="margin: 0; font-weight: normal;margin-bottom: 4px; font-size: 18px; line-height: 21px; max-height: 43px; color: #000000; overflow: hidden !important; display: inline-block;">perl-catalyst/catalyst-runtime</span></a><div style="font-size: 13px; line-height: 20px; color: #999999; max-height: 81px; font-family: 'Georgia', 'Times', 'Times New Roman', 'serif';overflow: hidden;" class="link-enhancr-card-description link-enhancr-element">catalyst-runtime - The Elegant MVC Web Application Framework</div></div></div></td><td
 class="link-enhancr-element" rowspan="2" style="width: 1px; background-color: #e5e5e5;"><div class="link-enhancr-element" style="width: 1px; background-color: #e5e5e5;"></div></td></tr><tr><td class="link-enhancr-element" style="width: 100%; vertical-align: middle; font-family: 'Arial', 'Helvetica Neue', 'Helvetica', 'sans-serif';"><div class="link-enhancr-element" style="font-size: 0pt; padding: 7px 20px 9px 15px;"><a href="https://github.com/perl-catalyst/catalyst-runtime" class="link-enhancr-card-url link-enhancr-element" style="color: black; text-decoration: none !important;cursor:pointer !important;" target="_blank"><span class="link-enhancr-element link-enhancr-view-on" style="display: inline-block; line-height: 11px; max-width: 179px; min-width: 119px; overflow: hidden; max-height: 13px; word-break: break-all;"><span class="link-enhancr-element link-enhancr-mobile-no-resize" style="vertical-align:middle; font-size: 9px; line-height: 11px; color:
 #999999; -moz-text-size-adjust: none; -ms-text-size-adjust: none; -webkit-text-size-adjust:none; text-size-adjust:none;">View on <span style="font-weight: bold" class="link-enhancr-view-on-domain">github.com</span></span></span></a></div></td><td class="link-enhancr-element" style="vertical-align: middle; width: 100px; font-family: 'Arial', 'Helvetica Neue', 'Helvetica', 'sans-serif';"><div class="link-enhancr-element link-enhancr-preview-wrapper" style="padding: 9px 20px 12px 0px; max-width: 100px; min-width: 80px; overflow: hidden; text-align: right; line-height: 11px; max-height: 13px; font-size: 0pt;"><span class="link-enhancr-element link-enhancr-preview-by link-enhancr-mobile-no-resize" style="vertical-align:middle; font-size: 9px; line-height: 11px; color: #999999; -moz-text-size-adjust: none; -ms-text-size-adjust: none; -webkit-text-size-adjust:none; text-size-adjust:none;">Preview by Yahoo</span></div></td></tr><tr
 class="link-enhancr-element"><td class="link-enhancr-element" colspan="6" style="height: 1px; background-color: #e5e5e5;"><div class="link-enhancr-element" style="height: 1px; background-color: #e5e5e5;"></div></td></tr></tbody></table></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class=""><span class="" style=""><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class=""><span class="" style="">It just makes it easier for me to track changes and accountability. &nbsp;Thanks! &nbsp;--John</span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica
 Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;" class=""> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;" class=""> <div dir="ltr" class="" style=""> <font size="2" face="Arial" class="" style=""> On Monday, May 26, 2014 11:19 PM, Louis Erickson &lt;lerickson@rdwarf.net&gt; wrote:<br class="" style=""> </font> </div>  <br class="" style=""><br class="" style=""> <div class="" style=""><div id="yiv0842961301" class="" style=""><div class="" style=""><div class="" style="">I found a minor bug in Catalyst today. &nbsp;It showed up in our development environment, and made me crazy trying to track it down.</div><div class="" style=""><br class="" style=""></div><div class="" style="">If you have a MyApp::Script::Server class, when you run myapp_server.pl, it will sometimes miss checking the values for MYAPP_PORT and MYAPP_RELOAD from the environment.</div><div
 class="" style=""><br class="" style=""></div><div class="" style="">It's the "sometimes" that made this hard to sort out.</div><div class="" style=""><br class="" style=""></div><div class="" style="">As far as I can tell, the values from the constructor to the Server object are being set up in a different order. &nbsp;Sometimes application_name is set up before port or reload, in which case the right app-specific environment variables are checked. &nbsp;Sometimes port or reload (or both) are set up before application_name is initialized, and in those cases 'MyApp' isn't sent to env_value, so the MYAPP variant of the environment block isn't checked.</div><div class="" style=""><br class="" style=""></div><div class="" style="">I never did figure out what caused the order to be different. &nbsp;I can guess wildly, but don't really know for sure.</div><div class="" style=""><br class="" style=""></div><div class="" style="">The solution - already used in
 one of the accessors in Catalyst::Script::Server - is to make port and reload lazy, so application_name will always be set before they're called. &nbsp;Any of the accessors that use env_value in their default should be lazy so you can depend on application_name. &nbsp;It's a trivial change.</div><div class="" style=""><br class="" style=""></div><div class="" style="">It did break one of the tests, though, as the test uses direct hash access to test retrieved values. &nbsp;For, as far as I can tell, no good reason. &nbsp;Changing the test to a method call fixes it.</div><div class="" style=""><br class="" style=""></div><div class="" style="">I couldn't figure out how to write a test to trigger this every time, so I have no idea how I'd write a test to prove it's really fixed.</div><div class="" style=""><br class="" style=""></div><div class="" style="">Here, as requested on the web site, are diffs. &nbsp;If there's a better way to get them to you, I
 do have this checked out in git and could push them someplace or something.</div><div class="" style=""><br class="" style=""></div><div class="" style="">Let me know and I'll be happy to do so, so no one else has to spend half a day scratching their head over this one.</div><div class="" style=""><br class="" style=""></div><div class="" style=""><div style="margin:0px;font-family:Menlo;" class="">diff -u -b lib/Catalyst/Script/Server-orig.pm lib/Catalyst/Script/Server.pm&nbsp;</div><div style="margin:0px;font-family:Menlo;" class="">--- lib/Catalyst/Script/Server-orig.pm<span class="" style="white-space:pre;">        </span>2014-05-26 20:03:00.000000000 -0700</div><div style="margin:0px;font-family:Menlo;" class="">+++ lib/Catalyst/Script/Server.pm<span class="" style="white-space:pre;">        </span>2014-05-26 20:02:23.000000000 -0700</div><div style="margin:0px;font-family:Menlo;" class="">@@ -37,6 +37,7 @@</div><div style="margin:0px;font-family:Menlo;"
 class="">&nbsp;&nbsp; &nbsp; cmd_aliases &nbsp; =&gt; 'p',</div><div style="margin:0px;font-family:Menlo;" class="">&nbsp;&nbsp; &nbsp; isa &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 'Int',</div><div style="margin:0px;font-family:Menlo;" class="">&nbsp;&nbsp; &nbsp; is&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 'ro',</div><div style="margin:0px;font-family:Menlo;" class="">+&nbsp; &nbsp; lazy&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 1,</div><div style="margin:0px;font-family:Menlo;" class="">&nbsp;&nbsp; &nbsp; default &nbsp; &nbsp; &nbsp; =&gt; sub {</div><div style="margin:0px;font-family:Menlo;" class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Catalyst::Utils::env_value(shift-&gt;application_name, 'port') || 3000</div><div style="margin:0px;font-family:Menlo;" class="">&nbsp;&nbsp; &nbsp; },</div><div style="margin:0px;font-family:Menlo;" class="">@@ -107,6 +108,7 @@</div><div style="margin:0px;font-family:Menlo;" class="">&nbsp;&nbsp; &nbsp; cmd_aliases
 &nbsp; =&gt; 'r',</div><div style="margin:0px;font-family:Menlo;" class="">&nbsp;&nbsp; &nbsp; isa &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 'Bool',</div><div style="margin:0px;font-family:Menlo;" class="">&nbsp;&nbsp; &nbsp; is&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 'ro',</div><div style="margin:0px;font-family:Menlo;" class="">+&nbsp; &nbsp; lazy&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 1,</div><div style="margin:0px;font-family:Menlo;" class="">&nbsp;&nbsp; &nbsp; default &nbsp; &nbsp; &nbsp; =&gt; sub {</div><div style="margin:0px;font-family:Menlo;" class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Catalyst::Utils::env_value(shift-&gt;application_name, 'reload') || 0;</div><div style="margin:0px;font-family:Menlo;" class="">&nbsp;&nbsp; &nbsp; },</div></div><div style="margin:0px;font-family:Menlo;" class=""><br class="" style=""></div><div style="margin:0px;font-family:Menlo;" class=""><div style="margin:0px;" class="">diff -u -b
 t/aggregate/unit_core_script_server-orig.t t/aggregate/unit_core_script_server.t&nbsp;</div><div style="margin:0px;" class="">--- t/aggregate/unit_core_script_server-orig.t<span class="" style="white-space:pre;">        </span>2014-05-26 20:13:25.000000000 -0700</div><div style="margin:0px;" class="">+++ t/aggregate/unit_core_script_server.t<span class="" style="white-space:pre;">        </span>2014-05-26 20:13:34.000000000 -0700</div><div style="margin:0px;" class="">@@ -151,7 +151,7 @@</div><div style="margin:0px;min-height:21px;" class="">&nbsp;<br class="" style=""></div><div style="margin:0px;" class="">&nbsp;&nbsp; &nbsp; ## Check a few args</div><div style="margin:0px;" class="">&nbsp;&nbsp; &nbsp; is_deeply $app-&gt;{ARGV}, $argstring;</div><div style="margin:0px;" class="">-&nbsp; &nbsp; is $app-&gt;{port}, '3000';</div><div style="margin:0px;" class="">+&nbsp; &nbsp; is $app-&gt;port, '3000';</div><div style="margin:0px;" class="">&nbsp;&nbsp; &nbsp;
 is($app-&gt;{background}, 1);</div><div style="margin:0px;" class="">&nbsp;}</div><div style="margin:0px;min-height:21px;" class="">&nbsp;<br class="" style=""></div><div class="" style=""><br class="" style=""></div><div class="" style=""><br class="" style=""></div></div><div style="margin:0px;font-family:Menlo;" class=""><br class="" style=""></div><div class="" style=""><br class="" style=""></div></div></div><br class="" style="">_______________________________________________<br class="" style="">Catalyst-dev mailing list<br class="" style=""><a ymailto="mailto:Catalyst-dev@lists.scsys.co.uk" href="mailto:Catalyst-dev@lists.scsys.co.uk" class="" style="">Catalyst-dev@lists.scsys.co.uk</a><br class="" style=""><a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev" target="_blank" class="" style="">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev</a><br class="" style=""><br class="" style=""><br class=""
 style=""></div>  </div> </div>  </div> </div></body></html>