<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/xml.xsl" type="text/xsl"?><feed xmlns="http://www.w3.org/2005/Atom">
  <title>nulog, NULL::something : out of the headphone &gt; 2005 &gt; January &gt; 12</title>
  <link href="http://lowreal.net/logs/2005/01/12"/>
  <icon>http://lowreal.net/img/banner.png</icon>
  <link rel="self" type="application/atom+xml" href="http://lowreal.net/logs/2005/01/12.atom"/>
  <link rel="alternate" type="application/xhtml+xml" href="http://lowreal.net/logs/2005/01/12.xhtml"/>
  <updated>2005-01-12T22:21:34+09:00</updated>
  <author>
    <name>cho45(砂糖)</name>
  </author>
  <id>http://lowreal.net/2005/01/12</id>
  <entry>
    <title>ソレっぽさ</title>
    <link rel="alternate" type="text/html" href="http://lowreal.net/logs/2005/01/12/1.html"/>
    <link rel="alternate" type="application/xml+xhtml" href="http://lowreal.net/logs/2005/01/12/1.xhtml"/>
    <updated>2005-01-12T03:27:34+09:00</updated>
    <published>2005-01-12T03:27:34+09:00</published>
    <id>http://lowreal.net/2005/01/12/1</id>
    <category term="life"/>
    <category term="thinking"/>
    <content type="xhtml" xml:base="http://lowreal.net/">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>一番重要なのは雰囲気で、それが実際にありえるかどうかは大した問題じゃない。とはいえ最低限のリアリティは必要。まぁ結局場合によるけれど……</p>
        <p>さて、ニ段落目を書いては消し、書いては消し、結局うまく文章化できなかった。こういうのが多いな。</p>
      </div>
    </content>
  </entry>
  <entry>
    <title>chokan 再実装</title>
    <link rel="alternate" type="text/html" href="http://lowreal.net/logs/2005/01/12/2.html"/>
    <link rel="alternate" type="application/xml+xhtml" href="http://lowreal.net/logs/2005/01/12/2.xhtml"/>
    <updated>2005-01-12T22:21:34+09:00</updated>
    <published>2005-01-12T22:21:34+09:00</published>
    <id>http://lowreal.net/2005/01/12/2</id>
    <category term="prog"/>
    <category term="ruby"/>
    <category term="irc"/>
    <content type="xhtml" xml:base="http://lowreal.net/">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p><abbr title="Internet Relay Chat">IRC</abbr> BOT を作り直し。RICE 使うことにする。</p>
        <p>プラグインのロード方法を変えた。新しい無名のモジュールを作ってその中で実行してクラスのインスタンスを得るようにする。そうすれば空間が汚れないし <abbr title="Garbage Collect">GC</abbr> 的にも嬉しいっぽい。たぶん。</p>
        <pre class="Ruby" title="PluginManager#load">    def load(klass_name)
        filename = klass2file(klass_name)

        mod = Module.new
        mod.module_eval(File.open("#{dir}/#{filename}") {|f| f.read}, filename)

        c = nil
        begin
            c = mod.const_get(klass_name)
        rescue NameError
            raise ClassNotFoundError.new("#{dir}/#{filename} must include #{klass_name} class")
        end

        # @klass (new に渡した上位クラス) を継承していなかったらエラー
        if c &lt; @klass
            @plugins[klass_name] = {
                :instance =&gt; c.new,
                :loaded   =&gt; Time.now,
            }
        else
            raise NotInheritAbstractClassError.new("The class #{klass_name} must inherit #{@klass}")
        end

        klass_name
    end
</pre>
        <p>Abstract っていうのはなんか違う気がする。</p>
      </div>
    </content>
  </entry>
</feed>
