<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>z_ach (jankjn)</title>
    <link>https://ruby-china.org/z_ach</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>关于 shell 中 $() 捕获的问题</title>
      <description>&lt;p&gt;echo $(ls -l) 的结果会连接多行输出&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;total 16 &lt;span class="nt"&gt;-rw-r--r--&lt;/span&gt; 1 jankin staff 403 Aug 8 07:12 README.md drwxr-xr-x 3 jankin staff 102 Aug 8 07:12 _build drwxr-xr-x 3 jankin staff 102 Aug 8 07:12 config drwxr-xr-x 3 jankin staff 102 Aug 8 07:12 lib &lt;span class="nt"&gt;-rw-r--r--&lt;/span&gt; 1 jankin staff 659 Aug 8 07:12 mix.exs drwxr-xr-x 4 jankin staff 136 Aug 8 07:12 &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;echo "$(ls -l)" 的结果可以正确输出&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;total 16
&lt;span class="nt"&gt;-rw-r--r--&lt;/span&gt;  1 jankin  staff  403 Aug  8 07:12 README.md
drwxr-xr-x  3 jankin  staff  102 Aug  8 07:12 _build
drwxr-xr-x  3 jankin  staff  102 Aug  8 07:12 config
drwxr-xr-x  3 jankin  staff  102 Aug  8 07:12 lib
&lt;span class="nt"&gt;-rw-r--r--&lt;/span&gt;  1 jankin  staff  659 Aug  8 07:12 mix.exs
drwxr-xr-x  4 jankin  staff  136 Aug  8 07:12 &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;有谁知道为什么出现第一种输出么？
(用的 zsh, osx archlinux 都试了)&lt;/p&gt;</description>
      <author>z_ach</author>
      <pubDate>Mon, 08 Aug 2016 10:03:57 +0800</pubDate>
      <link>https://ruby-china.org/topics/30762</link>
      <guid>https://ruby-china.org/topics/30762</guid>
    </item>
    <item>
      <title>[转] 关于 Rack 原生支持 WebSockets</title>
      <description>&lt;p&gt;今天看到的一片文章 &lt;a href="https://bowild.wordpress.com/2016/07/31/the-dark-side-of-the-rack/" rel="nofollow" target="_blank" title=""&gt;The dark side of the Rack and Websockets dreams&lt;/a&gt;
大意是：rack 现在支持 websocket 的方式是使用 hijack api，由应用自己完成 websocket 的处理，有很大的性能浪费，而且由于代码跑在 GIL 里，没法利用多核。他提议在 rack 中增加接口以原生支持 websocket，而且他已经写出了一个 POC(概念实现) &lt;a href="https://github.com/boazsegev/iodine" rel="nofollow" target="_blank" title=""&gt;iodine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ps：作者在 rack 提的 issue &lt;a href="https://github.com/rack/rack/issues/1093" rel="nofollow" target="_blank" title=""&gt;SPECs feature: Websocket / Upgrade support proposal&lt;/a&gt;&lt;/p&gt;</description>
      <author>z_ach</author>
      <pubDate>Fri, 05 Aug 2016 12:02:24 +0800</pubDate>
      <link>https://ruby-china.org/topics/30740</link>
      <guid>https://ruby-china.org/topics/30740</guid>
    </item>
    <item>
      <title>Mac 上 Vagrant 问题 "No Usable default provider could be found for your system"</title>
      <description>&lt;p&gt;在 mac 上装 vagrant(v1.8.4) VirtualBox(5.1.0), 自己用 packer build 了一个 archlinux 的 box，build 和 add 的过程都正常。
vagrant up 的过程报错，完整错误如下&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;No usable default provider could be found for your system.

Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.

The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.

If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;加了 --provider=VirtualBox 参数后报错没有区别。&lt;/p&gt;

&lt;p&gt;有人知道怎么办么 (=ﾟωﾟ) ﾉ&lt;/p&gt;</description>
      <author>z_ach</author>
      <pubDate>Wed, 13 Jul 2016 17:35:19 +0800</pubDate>
      <link>https://ruby-china.org/topics/30516</link>
      <guid>https://ruby-china.org/topics/30516</guid>
    </item>
    <item>
      <title>新手求教，关于 main 对象的一些疑问</title>
      <description>&lt;p&gt;今天发现在顶层可以直接使用 include&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;D&lt;/span&gt;
  &lt;span class="kp"&gt;private&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;hello&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"hello"&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="kp"&gt;include&lt;/span&gt; &lt;span class="no"&gt;D&lt;/span&gt;
&lt;span class="nb"&gt;p&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;class&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ancestors&lt;/span&gt;  &lt;span class="c1"&gt;# [Object, D, Kernel, BasicObject]&lt;/span&gt;
&lt;span class="n"&gt;hello&lt;/span&gt; &lt;span class="c1"&gt;# hello&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后我把 main 对象和 Object 对象在 pry 里比较了一下，发现多出五个私有方法 [:include, :using, :public, :private, :define_method]，好像都是 Module 里的方法
我想问的是，main 的祖先链里并没有 Module，这几个方法是怎么进去的？还有为什么要在 main 里加上这些方法？&lt;/p&gt;</description>
      <author>z_ach</author>
      <pubDate>Tue, 23 Feb 2016 18:07:48 +0800</pubDate>
      <link>https://ruby-china.org/topics/29072</link>
      <guid>https://ruby-china.org/topics/29072</guid>
    </item>
  </channel>
</rss>
