As I get started with ruby, one of the things I’ve noticed is that
ruby’s documentation could be a bit better.  However, I discovered that
this four line ruby script will give your documentation for your
server’s installed gems:

1<br />2<br />3<br />4<br /></pre></td><td class="code"><pre class="ruby ruby" style="font-family: monospace;"><span style="color: rgb(0, 128, 0); font-style: italic;">#!/usr/bin/env ruby</span><br /><span style="color: rgb(204, 0, 102); font-weight: bold;">require</span> <span style="color: rgb(153, 102, 0);">"rubygems/server"</span><br />options = <span style="color: rgb(0, 102, 0); font-weight: bold;">{</span>:gemdir <span style="color: rgb(0, 102, 0); font-weight: bold;">=></span> Gem.<span style="color: rgb(153, 0, 204);">dir</span>, <span style="color: rgb(255, 51, 51); font-weight: bold;">:port</span> <span style="color: rgb(0, 102, 0); font-weight: bold;">=></span> <span style="color: rgb(0, 102, 102);">4242</span>, <span style="color: rgb(255, 51, 51); font-weight: bold;">:daemon</span> <span style="color: rgb(0, 102, 0); font-weight: bold;">=></span> <span style="color: rgb(0, 0, 255); font-weight: bold;">true</span><span style="color: rgb(0, 102, 0); font-weight: bold;">}</span><br /><span style="color: rgb(102, 102, 255); font-weight: bold;">Gem::Server</span>::run<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span>options<span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>
Advertisements