<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>siky (siky)</title>
    <link>https://ruby-china.org/siky</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>RubySonar：一个 Ruby 静态分析器</title>
      <description>&lt;p&gt;&lt;a href="http://www.yinwang.org/blog-cn/2014/01/28/rubysonar/" rel="nofollow" target="_blank"&gt;http://www.yinwang.org/blog-cn/2014/01/28/rubysonar/&lt;/a&gt;&lt;/p&gt;</description>
      <author>siky</author>
      <pubDate>Sat, 01 Feb 2014 00:56:02 +0800</pubDate>
      <link>https://ruby-china.org/topics/17067</link>
      <guid>https://ruby-china.org/topics/17067</guid>
    </item>
    <item>
      <title>::File.expand_path ('../config/environment',  __FILE__) 是什么意思？</title>
      <description>&lt;p&gt;在 Rails 项目默认生成的 config.ru 是这样的：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# This file is used by Rack-based servers to start the application.&lt;/span&gt;

&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="o"&gt;::&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;expand_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'../config/environment'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="kp"&gt;__FILE__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="no"&gt;Rails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;application&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;其中::是什么意思？只知道作为模块的作用域操作符的用法。。&lt;/p&gt;

&lt;p&gt;在 console 中，运行，&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;expand_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'../config/environment'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="kp"&gt;__FILE__&lt;/span&gt;&lt;span class="p"&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="o"&gt;::&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;expand_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'../config/environment'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="kp"&gt;__FILE__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;返回的是同样的结果&lt;/p&gt;

&lt;p&gt;都是 environment.rb 文件的路径。请问在这里::有什么用处么？&lt;/p&gt;</description>
      <author>siky</author>
      <pubDate>Sat, 04 Jan 2014 20:58:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/16623</link>
      <guid>https://ruby-china.org/topics/16623</guid>
    </item>
  </channel>
</rss>
