<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Ddl1st (ddl1st)</title>
    <link>https://ruby-china.org/Ddl1st</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>爬虫福利 rest-tor</title>
      <description>&lt;p&gt;&lt;a href="https://github.com/plusor/rest-tor" rel="nofollow" target="_blank"&gt;https://github.com/plusor/rest-tor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rest-tor&lt;/code&gt; 是一个基于 &lt;a href="https://www.torproject.org/projects/torbrowser.html.en" rel="nofollow" target="_blank" title=""&gt;tor&lt;/a&gt; 的代理服务
它可以无限制的变更 IP 去请求目标服务器&lt;/p&gt;

&lt;p&gt;目前只是测试版本，等有时间再优化&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rest-tor&lt;/code&gt; 依赖于第三方 &lt;code&gt;gem&lt;/code&gt; 有&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;activesupport&lt;/li&gt;
&lt;li&gt;nokogiri&lt;/li&gt;
&lt;li&gt;redis-objects&lt;/li&gt;
&lt;li&gt;rest-client&lt;/li&gt;
&lt;li&gt;socksify&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="依赖的第三方包有"&gt;依赖的第三方包有&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;tor&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="安装第三方包"&gt;安装第三方包&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Mac OS:  brew isntall tor&lt;/li&gt;
&lt;li&gt;Ubuntu: apt-get install tor&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="USEAGE"&gt;USEAGE&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Tor.request&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Tor.request&lt;/code&gt; 类似于 &lt;code&gt;RestClient::Request.execute&lt;/code&gt;, 接受的参数有：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;method&lt;/code&gt; | 默认 &lt;code&gt;get&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;url&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;payload&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;header&lt;/code&gt; 或 &lt;code&gt;headers&lt;/code&gt; (默认的 &lt;code&gt;User-Agent&lt;/code&gt; 会使用常量 Tor::USER_AGENT)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mobile&lt;/code&gt; | 默认为 &lt;code&gt;false&lt;/code&gt;, 如果为 &lt;code&gt;true&lt;/code&gt;, 则使用移动端的 &lt;code&gt;User-Agent&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;proxy&lt;/code&gt; 默认使用 tor 代理，如果为 &lt;code&gt;false&lt;/code&gt; 则不使用代理。可以自定义代理如：&lt;code&gt;proxy: 'http://127.0.0.1:8888'&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;raw&lt;/code&gt; 默认为 &lt;code&gt;true&lt;/code&gt;, 结果等同于 &lt;code&gt;Nokogiri::HTML(req.body)&lt;/code&gt;, 如果为 false, 则返回 &lt;code&gt;req.body&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;format&lt;/code&gt; | &lt;code&gt;html&lt;/code&gt;, &lt;code&gt;json&lt;/code&gt;, &lt;code&gt;string&lt;/code&gt; 如果没有指定&lt;code&gt;format&lt;/code&gt;则根据 &lt;code&gt;raw&lt;/code&gt; 的值 &lt;code&gt;true&lt;/code&gt; : &lt;code&gt;html&lt;/code&gt;, &lt;code&gt;false&lt;/code&gt; : &lt;code&gt;string&lt;/code&gt;. 处理结果为对应的格式&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mode&lt;/code&gt; | 默认为 &lt;code&gt;:default&lt;/code&gt;, 根据每个 &lt;code&gt;tor&lt;/code&gt;实例请求成功 (RestClient 请求没报错的情况下) 的数量排序，选择成功数最高的那个实例。可选 &lt;code&gt;:order&lt;/code&gt;,  根据端口号进行排序。&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;可以自定义&lt;code&gt;mode&lt;/code&gt;&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Tor&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Dispatcher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;register&lt;/span&gt; &lt;span class="ss"&gt;:custom&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="no"&gt;Tor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort_by&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="n"&gt;tor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_success&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="no"&gt;Tor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;url: &lt;/span&gt;&lt;span class="s1"&gt;'...'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;mode: :custom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;

&lt;p&gt;在调用&lt;code&gt;Tor.request&lt;/code&gt;时，会占用 tor 实例，如果是多线程并发执行，且没有多余的 tor 实例可用，系统则会自动初始化一个新的实例。&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Tor.init&lt;/code&gt; 会自动初始化 &lt;code&gt;10&lt;/code&gt; 个 &lt;code&gt;tor 实例&lt;/code&gt;.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Tor.stop(port)&lt;/code&gt; 关闭 &lt;code&gt;tor&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Tor.clear&lt;/code&gt; 关闭所有 &lt;code&gt;tor&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Tor.store.all&lt;/code&gt; 查看所有 &lt;code&gt;tor&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;当 tor 实例失败次数到一定数量后，会自动重启 tor 实例，&lt;a href="https://github.com/plusor/rest-tor/blob/master/lib/rest_tor/strategy/restart.rb" rel="nofollow" target="_blank"&gt;https://github.com/plusor/rest-tor/blob/master/lib/rest_tor/strategy/restart.rb&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="TODO"&gt;TODO&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;添加测试&lt;/li&gt;
&lt;li&gt;代码优化&lt;/li&gt;
&lt;li&gt;添加配置项&lt;/li&gt;
&lt;li&gt;可自定义重启策略&lt;/li&gt;
&lt;li&gt;集成 Mechanize&lt;/li&gt;
&lt;/ul&gt;

&lt;hr&gt;

&lt;p&gt;最后欢迎拍砖和贡献代码&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Sun, 17 Dec 2017 10:47:09 +0800</pubDate>
      <link>https://ruby-china.org/topics/34719</link>
      <guid>https://ruby-china.org/topics/34719</guid>
    </item>
    <item>
      <title>Rails for Bug</title>
      <description>&lt;ul&gt;
&lt;li&gt;Rails 5+&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ActionController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Parameters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;

&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:settings&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"¶&amp;nbsp;(iüª7¶×»ö¾¼k{ï½{ï"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:settings&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:dig&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# =&amp;gt; ?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Mon, 10 Jul 2017 20:39:49 +0800</pubDate>
      <link>https://ruby-china.org/topics/33450</link>
      <guid>https://ruby-china.org/topics/33450</guid>
    </item>
    <item>
      <title>为什么都说 Devise 很慢?</title>
      <description>&lt;p&gt;我用 &lt;code&gt;ab&lt;/code&gt; 测试用了和没用 &lt;code&gt;Devise&lt;/code&gt; 的结果，感觉没多大区别呀？&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Wed, 26 Aug 2015 21:06:18 +0800</pubDate>
      <link>https://ruby-china.org/topics/27094</link>
      <guid>https://ruby-china.org/topics/27094</guid>
    </item>
    <item>
      <title>用户输入特殊字符保存到数据库后提示 invalid byte sequence in UTF-8</title>
      <description>&lt;p&gt;ruby 2.2.1
rails 4.2.1.rc4
mysql 5.5&lt;/p&gt;

&lt;p&gt;用户在输入特殊字符保存到数据库之后，通过页面访问报错 &lt;code&gt;invalid byte sequence in UTF-8&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;通过日志可以看到，用户输入的特殊字符被转码了 &lt;code&gt;\xED\xA0\xBD&lt;/code&gt;, 而且值也存到数据库了。但是在显示出来的时候就报错.
User-Agent &lt;code&gt;"Mozilla/5.0 (Linux; U; Android 4.1.2; zh-cn; Coolpad 5891Q Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"&lt;/code&gt;&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Wed, 19 Aug 2015 15:00:24 +0800</pubDate>
      <link>https://ruby-china.org/topics/26981</link>
      <guid>https://ruby-china.org/topics/26981</guid>
    </item>
    <item>
      <title>用 Goliath 或 sinatra-synchrony 可能会遇到啥坑?</title>
      <description>&lt;p&gt;想用 Goliath 来重写 API 服务，提前绕些坑。咨询下各位有什么建议？&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Sun, 16 Aug 2015 21:40:55 +0800</pubDate>
      <link>https://ruby-china.org/topics/26950</link>
      <guid>https://ruby-china.org/topics/26950</guid>
    </item>
    <item>
      <title>命令行版的'浏览器'</title>
      <description>&lt;p&gt;&lt;a href="http://blog.envylabs.com/post/62718536773/remote-pairing-and-browser-sharing-with-tmux" rel="nofollow" target="_blank"&gt;http://blog.envylabs.com/post/62718536773/remote-pairing-and-browser-sharing-with-tmux&lt;/a&gt;&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Tue, 08 Oct 2013 22:55:40 +0800</pubDate>
      <link>https://ruby-china.org/topics/14597</link>
      <guid>https://ruby-china.org/topics/14597</guid>
    </item>
    <item>
      <title>Web Console </title>
      <description>&lt;p&gt;&lt;a href="https://github.com/rails/web-console" rel="nofollow" target="_blank"&gt;https://github.com/rails/web-console&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;这样的话感觉是不是方便很多？&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Fri, 27 Sep 2013 22:44:16 +0800</pubDate>
      <link>https://ruby-china.org/topics/14442</link>
      <guid>https://ruby-china.org/topics/14442</guid>
    </item>
    <item>
      <title>Mad Dog 域名不能转移吗??</title>
      <description>&lt;p&gt;续费完之后发现不能转移域名，这是个坑吗？&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Thu, 11 Jul 2013 08:22:53 +0800</pubDate>
      <link>https://ruby-china.org/topics/12416</link>
      <guid>https://ruby-china.org/topics/12416</guid>
    </item>
    <item>
      <title>升级 Gitlabhq 到 5.0+ 请确保自己有足够的时间解决问题</title>
      <description>&lt;p&gt;折腾了一晚上，最终选择降到 5.0 
为了解决一个小 bug 升级到 5.1,5.1 又有 bug 升级到 5.3, 这下坏了，无法 push 了。&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Fri, 05 Jul 2013 02:00:11 +0800</pubDate>
      <link>https://ruby-china.org/topics/12255</link>
      <guid>https://ruby-china.org/topics/12255</guid>
    </item>
    <item>
      <title>Gitlab 怎么集成 GitlabCI. </title>
      <description>&lt;p&gt;&lt;code&gt;Gitlab&lt;/code&gt; v5.0.1-3-g951273f
&lt;code&gt;GitlabCI&lt;/code&gt;  v2.0.0-2-g74c831f
在&lt;code&gt;Merge Requests&lt;/code&gt;中，怎么集成 GitlabCI.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Accept Merge Request&lt;/code&gt;下面咋看不到 &lt;code&gt;CI build passed for ...&lt;/code&gt;
&lt;img src="//l.ruby-china.com/photo/1442e2e091badb1a80fa8c13bec455bf.png" title="" alt=""&gt;&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;&lt;a href="http://blog.gitlab.org/gitlab-4-release/" rel="nofollow" target="_blank"&gt;http://blog.gitlab.org/gitlab-4-release/&lt;/a&gt;
&lt;img src="http://blog.gitlab.org/images/4_0/gitlab_project_mr.png" title="" alt="Alt text here"&gt;&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Sun, 09 Jun 2013 11:22:51 +0800</pubDate>
      <link>https://ruby-china.org/topics/11603</link>
      <guid>https://ruby-china.org/topics/11603</guid>
    </item>
    <item>
      <title>Mozilla 提供免费手机，旨在提升 Firefox OS 的 App 开发者热情 </title>
      <description>&lt;p&gt;&lt;a href="http://cn.engadget.com/2013/05/10/mozilla-free-phones-firefox-os/" rel="nofollow" target="_blank"&gt;http://cn.engadget.com/2013/05/10/mozilla-free-phones-firefox-os/&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Mozilla 已经发布了 Firefox OS 智能手机操作系统，当然一个操作系统能否在市场中生存下来，并且得到消费者的认可，App 的质量和数量至关重要。为了推动这个新平台的 App 能够迅速增长，Mozilla 打算赠送 Geeksphone Keon 手机给开发者。流程很简单，开发者先要向官方提供想要制作的 App 概述或者是想要移植到 Firefox OS 的软件介绍，如果得到 Mozilla 的审核通过，那么就有免费的手机可以拿了。&lt;/p&gt;

&lt;p&gt;Geeksphone Keon 机型的规格我们不烦再回顾下，其采用了 3.5 吋 HVGA 屏幕，1GHz Snapdragon S1 处理器，512MB RAM 和一个 300 万像素的后置相机。这个免费送机的活动在这个月底结束，先到先得直到送完为止。所以如果你想参与这个活动的话，赶紧到 Mozilla 官方网站提交相关资料吧。&lt;/p&gt;
&lt;/blockquote&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Sun, 12 May 2013 12:38:22 +0800</pubDate>
      <link>https://ruby-china.org/topics/10913</link>
      <guid>https://ruby-china.org/topics/10913</guid>
    </item>
    <item>
      <title> 一行代码，浏览器变临时编辑器</title>
      <description>&lt;blockquote&gt;
&lt;p&gt;"程序员 Jose Jesus Perez Aguinaga 在 CoderWall 分享了一个小技巧：在浏览器地址栏中输入一行代码：&lt;code&gt;data:text/html, &amp;lt;html contenteditable&amp;gt;&lt;/code&gt; ，回车即可把浏览器变临时编辑器（需要浏览器支持 HTML5 属性 contenteditable）。不少程序员受 Jose 的启发，开始对这行代码&lt;a href="http://blog.jobbole.com/32823/" rel="nofollow" target="_blank" title=""&gt;加工改造&lt;/a&gt;，比如改成支持 Ruby 语法高亮的&lt;a href="https://gist.github.com/4666256" rel="nofollow" target="_blank" title=""&gt;编辑器&lt;/a&gt;……"&lt;/p&gt;
&lt;/blockquote&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Wed, 30 Jan 2013 19:55:02 +0800</pubDate>
      <link>https://ruby-china.org/topics/8495</link>
      <guid>https://ruby-china.org/topics/8495</guid>
    </item>
    <item>
      <title>使用 Ruby on Rails 和 Eclipse 开发 iPhone 应用程序</title>
      <description>&lt;hr&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://www.ibm.com/developerworks/cn/opensource/os-eclipse-iphoneruby1/index.html" rel="nofollow" target="_blank" title=""&gt;第一部分&lt;/a&gt; 讨论了如何设置服务器以检测和为 Mobile Safari 提供替代内容。所选用的机制（并不是惟一的实现方法）涉及创建伪 MIME 类型，匹配用户代理字符串和使用 Rails 的 respond_to 机制。&lt;/li&gt;
&lt;/ul&gt;

&lt;hr&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://www.ibm.com/developerworks/cn/opensource/os-eclipse-iphoneruby2/index.html" rel="nofollow" target="_blank" title=""&gt;第二部分&lt;/a&gt; 探究了可能为 iPhone 或 iPod touch 创建的实际内容。使用 iUI 库作为确保 Web 应用程序遵循 Apple 的界面外观指南的机制。得到的应用程序很像是原生的 iPhone 应用程序。该文章介绍了如何创建向下展开的列表结构，类似于 iPhone 的原生邮件应用程序。Apple 建议使用这种结构，因为这种结构易于浏览并且尺寸较小，即使使用较慢的 Edge 网络连接，也可以快速下载。&lt;/li&gt;
&lt;/ul&gt;

&lt;hr&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://www.ibm.com/developerworks/cn/opensource/os-eclipse-iphoneruby3/index.html?ca=drs-" rel="nofollow" target="_blank" title=""&gt;第三部分&lt;/a&gt;介绍当用户浏览到列表结构末尾而应用程序实际上还需要显示一些内容时，应当如何执行操作。iUI 给内容及表单布局提供一些有用功能。本文还介绍一些为应用程序提供特别改进的功能，例如，捕捉用户电话的旋转以及添加显示在 iPhone 主屏幕中的图标。&lt;/li&gt;
&lt;/ul&gt;

&lt;hr&gt;

&lt;p&gt;内容有点老...&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Sat, 26 Jan 2013 12:10:02 +0800</pubDate>
      <link>https://ruby-china.org/topics/8382</link>
      <guid>https://ruby-china.org/topics/8382</guid>
    </item>
    <item>
      <title>魅族 CEO 骂人,元芳 你怎么看</title>
      <description>&lt;p&gt;&lt;img src="//l.ruby-china.com/photo/835480cc03d09ce2101ed57130343283.jpeg" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://bbs.meizu.com/viewthread.php?tid=4238116&amp;amp;page=1#pid98868616" rel="nofollow" target="_blank" title=""&gt;原文地址&lt;/a&gt;&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Thu, 17 Jan 2013 17:22:49 +0800</pubDate>
      <link>https://ruby-china.org/topics/8139</link>
      <guid>https://ruby-china.org/topics/8139</guid>
    </item>
    <item>
      <title>Ruby 中 双冒号"::" 的功能</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Foo&lt;/span&gt;

  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Bar&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;class&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;FooBar&lt;/span&gt;
     &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nc"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;method1&lt;/span&gt;
       &lt;span class="s2"&gt;"method1"&lt;/span&gt;
     &lt;span class="k"&gt;end&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;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Foo&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Bar&lt;/span&gt;
&lt;span class="no"&gt;FooBar&lt;/span&gt;
&lt;span class="no"&gt;FooBar&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;method1&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"method1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;那一般的方法用 &lt;code&gt;.&lt;/code&gt; 来调用只是个人喜好或约定？&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Thu, 10 Jan 2013 12:54:34 +0800</pubDate>
      <link>https://ruby-china.org/topics/7932</link>
      <guid>https://ruby-china.org/topics/7932</guid>
    </item>
    <item>
      <title>不错的网站，对于 Ruby 来讲</title>
      <description>&lt;p&gt;&lt;a href="http://phrogz.net" rel="nofollow" target="_blank"&gt;http://phrogz.net&lt;/a&gt;&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Fri, 28 Sep 2012 15:49:30 +0800</pubDate>
      <link>https://ruby-china.org/topics/5806</link>
      <guid>https://ruby-china.org/topics/5806</guid>
    </item>
    <item>
      <title>谁能介绍款游戏手柄？</title>
      <description>&lt;p&gt;突然想玩小时候小霸王上的游戏。淘宝上看很多不是按键不灵就是太难按。昨天买了个，用了下就摔了。按的太难受了。&lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Tue, 18 Sep 2012 17:25:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/5614</link>
      <guid>https://ruby-china.org/topics/5614</guid>
    </item>
    <item>
      <title>网站备案方会提供敏感词库吗？  </title>
      <description>&lt;p&gt;刚看到有人做的 google 敏感词&lt;a href="https://gist.github.com/2849163" rel="nofollow" target="_blank"&gt;https://gist.github.com/2849163&lt;/a&gt;   &lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Wed, 06 Jun 2012 18:27:53 +0800</pubDate>
      <link>https://ruby-china.org/topics/3696</link>
      <guid>https://ruby-china.org/topics/3696</guid>
    </item>
    <item>
      <title>Safari 打开关闭的标签页</title>
      <description>&lt;p&gt;现在才发现原来是 cmd+z   找白天没找着  &lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Mon, 07 May 2012 19:17:21 +0800</pubDate>
      <link>https://ruby-china.org/topics/3136</link>
      <guid>https://ruby-china.org/topics/3136</guid>
    </item>
    <item>
      <title>打印机套打实现方法</title>
      <description>&lt;p&gt;1.把单据做成 html 格式，然后调整 css.
2.扫描一份单据，然后做成页面的背景图，进行定位.
3.做成 PDF 格式的，比较好控制页面位置，以后可以做多种单据的套打，但是要下载再来打，每次都要存在服务器上。&lt;/p&gt;

&lt;p&gt;大家可否讨论下你们的实现方式？ &lt;/p&gt;</description>
      <author>Ddl1st</author>
      <pubDate>Sat, 28 Apr 2012 11:41:29 +0800</pubDate>
      <link>https://ruby-china.org/topics/2957</link>
      <guid>https://ruby-china.org/topics/2957</guid>
    </item>
  </channel>
</rss>
