<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>kooder (bob)</title>
    <link>https://ruby-china.org/kooder</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>alias new_name old_name 中的参数能用变量吗？</title>
      <description>&lt;p&gt;比如，&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;alias&lt;/span&gt; &lt;span class="ss"&gt;:old_plus&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;的用法是正确的，但是，如果&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;old&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;
&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="ss"&gt;:old_plus&lt;/span&gt;
&lt;span class="k"&gt;alias&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;old&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;就会报错。
请教大家，谢谢。&lt;/p&gt;</description>
      <author>kooder</author>
      <pubDate>Wed, 20 Sep 2017 15:31:20 +0800</pubDate>
      <link>https://ruby-china.org/topics/34204</link>
      <guid>https://ruby-china.org/topics/34204</guid>
    </item>
    <item>
      <title>no implicit conversion of nil into String (TypeError)</title>
      <description>&lt;p&gt;在 irb 2.2.6 里面输入如下代码（摘自《元编程》）&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Fixnum&lt;/span&gt;
  &lt;span class="k"&gt;alias&lt;/span&gt; &lt;span class="ss"&gt;:old_plus&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;+&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;old_plus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;old_plus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;发现会报以下错误，
in `block in expand_prompt': no implicit conversion of nil into String (TypeError)&lt;/p&gt;

&lt;p&gt;请教大家，谢谢！&lt;/p&gt;</description>
      <author>kooder</author>
      <pubDate>Tue, 19 Sep 2017 11:50:45 +0800</pubDate>
      <link>https://ruby-china.org/topics/34175</link>
      <guid>https://ruby-china.org/topics/34175</guid>
    </item>
    <item>
      <title>如何查看某个 method 的属性？</title>
      <description>&lt;p&gt;比如，想查看某个 method 是 instance method 还是 class method，是 private 还是 public，除了用 Object 提供的类似调用 Object.instance_methods.grep /xxx/ 的方法间接查找外，有没有针对 method 本身的方法，可以详细的查看某个 method 的属性？&lt;/p&gt;

&lt;p&gt;谢谢。&lt;/p&gt;</description>
      <author>kooder</author>
      <pubDate>Sun, 17 Sep 2017 21:57:57 +0800</pubDate>
      <link>https://ruby-china.org/topics/34154</link>
      <guid>https://ruby-china.org/topics/34154</guid>
    </item>
    <item>
      <title>ruby 中 == ?. 的用法解释</title>
      <description>&lt;p&gt;请教以下代码块中的 &lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;?.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;表示什么意思？谢谢。&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;searchpath&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
   &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;FileTest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;directory?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;?.&lt;/span&gt;
       &lt;span class="no"&gt;Find&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prune&lt;/span&gt;       &lt;span class="c1"&gt;# Don't look any further into this directory.&lt;/span&gt;
     &lt;span class="k"&gt;else&lt;/span&gt;
       &lt;span class="k"&gt;next&lt;/span&gt;
     &lt;span class="k"&gt;end&lt;/span&gt;
   &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;代码出处链接 &lt;a href="https://www.ibm.com/developerworks/aix/library/au-rubysysadmin/index.html" rel="nofollow" target="_blank"&gt;https://www.ibm.com/developerworks/aix/library/au-rubysysadmin/index.html&lt;/a&gt;&lt;/p&gt;</description>
      <author>kooder</author>
      <pubDate>Thu, 07 Sep 2017 19:51:54 +0800</pubDate>
      <link>https://ruby-china.org/topics/34056</link>
      <guid>https://ruby-china.org/topics/34056</guid>
    </item>
    <item>
      <title>从 C 中调用 ruby，发现找不到 -lruby</title>
      <description>&lt;p&gt;参考链接 &lt;a href="http://silverhammermba.github.io/emberb/embed/" rel="nofollow" target="_blank"&gt;http://silverhammermba.github.io/emberb/embed/&lt;/a&gt; 中的做法进行编译，&lt;/p&gt;

&lt;p&gt;gcc -I/usr/include/ruby-2.4.0 -I/usr/include/ruby-2.4.0/x86_64-linux -lruby&lt;/p&gt;

&lt;p&gt;发现 -lruby 时找不到对应的库，这个库在哪里可以获取呢？&lt;/p&gt;

&lt;p&gt;谢谢！&lt;/p&gt;

&lt;p&gt;本地用的是 ruby 1.8，ubuntu 12.04 32-bit&lt;/p&gt;</description>
      <author>kooder</author>
      <pubDate>Sat, 22 Apr 2017 17:21:22 +0800</pubDate>
      <link>https://ruby-china.org/topics/32848</link>
      <guid>https://ruby-china.org/topics/32848</guid>
    </item>
  </channel>
</rss>
