
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>tmux | monolog</title>
	<atom:link href="https://blog.monora.me/tag/tmux/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.monora.me</link>
	<description>monora log #=&#62; ものろーぐ</description>
	<lastBuildDate>Sun, 24 May 2020 16:40:27 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.1</generator>
<site xmlns="com-wordpress:feed-additions:1">21279848</site>	<item>
		<title>shotgun じゃなくて rerun を使おうという話</title>
		<link>https://blog.monora.me/2016/03/use-rerun-with-tmux-not-shotgun/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-rerun-with-tmux-not-shotgun</link>
		
		<dc:creator><![CDATA[きょんたん]]></dc:creator>
		<pubDate>Sat, 26 Mar 2016 19:32:48 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[rerun]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[tmux]]></category>
		<guid isPermaLink="false">http://blog.monora.me/?p=1351</guid>

					<description><![CDATA[<p>Ruby で Rack アプリケーションを書いているときに、コード変更したら自動的にサーバー再起動したいという話。 今までは shotgun でやっていたのだけれど、これは毎回リクエストする度に変更の有無に関係なくサーバ [&#8230;]</p>
The post <a href="https://blog.monora.me/2016/03/use-rerun-with-tmux-not-shotgun/">shotgun じゃなくて rerun を使おうという話</a> first appeared on <a href="https://blog.monora.me">monolog</a>.]]></description>
										<content:encoded><![CDATA[<p>Ruby で Rack アプリケーションを書いているときに、コード変更したら自動的にサーバー再起動したいという話。</p>
<p>今までは <a href="https://github.com/rtomayko/shotgun" target="_blank" rel="noopener noreferrer">shotgun</a> でやっていたのだけれど、これは毎回リクエストする度に変更の有無に関係なくサーバーを立ち上げ直すので、遅いという欠点があった。<br />
副次的な問題として、<a href="https://github.com/charliesome/better_errors" target="_blank" rel="noopener noreferrer">better_errors</a> で REPL が無効になるという欠点があった。(レスポンスを返すとそのコンテキストを捨ててしまうから?)</p>
<p>ずっと前からどうにかならないかなーと思っていたのでググったら <a href="https://github.com/alexch/rerun" target="_blank" rel="noopener noreferrer">rerun</a> というものを見つけた。<br />
Rack とか関係なくもっと汎用的なやつで、ファイル変更検知してサーバー上げ直すぞ! みたいなプロダクトらしい。</p>
<p>入れたら下のような感じで使える。便利。</p>
<p><code>RACK_ENV=development rerun -- rackup -o 127.0.0.1<br />
</code></p>
<p>調子に乗って通知有効化するぞ! というノリで <a href="https://github.com/julienXX/terminal-notifier" target="_blank" rel="noopener noreferrer">terminal-notifier</a> を入れてみたらサーバーが上がらなくなった。何事かと思ったら tmux 上で使おうとすると一癖あるらしく、<a href="https://github.com/julienXX/terminal-notifier/issues/115" target="_blank" rel="noopener noreferrer">こういうIssue </a>が立っていたので適当に読んだら解決した。</p>
<p>要するに、<code>brew</code> なりなんなりで、<code>reattach-to-user-namespace</code> をインストールして、<code>.tmux.conf</code> に下を書き加えるという話。</p>
<pre>
set -g default-command "which reattach-to-user-namespace &gt; /dev/null &amp;&amp; reattach-to-user-namespace -l $SHELL || $SHELL -l"</pre>
<p>再起動に掛かる時間が体感で倍ぐらいになったけれど、<code>better_errors</code>使えることで圧倒的効率アップみたいなところがあるので、トータルで幸福度が向上した気がする。</p>The post <a href="https://blog.monora.me/2016/03/use-rerun-with-tmux-not-shotgun/">shotgun じゃなくて rerun を使おうという話</a> first appeared on <a href="https://blog.monora.me">monolog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1351</post-id>	</item>
	</channel>
</rss>
