<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>msg7086 (msg7086)</title>
    <link>https://ruby-china.org/msg7086</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>这种喷子为什么不 Ban 不删？</title>
      <description>&lt;p&gt;&lt;a href="https://ruby-china.org/topics/37986" rel="nofollow" target="_blank"&gt;https://ruby-china.org/topics/37986&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;从主题帖开始普及错误的知识，被指出错误以后非但打死不承认，还出口成脏，可见家教极差。&lt;/p&gt;

&lt;p&gt;Stackoverflow 上原样的帖子都有，我怕他连谷歌都不会，资料全帮他查了贴出来，也不愿意读。依我之见，这样的人简直是程序员之耻。&lt;/p&gt;

&lt;p&gt;就因为隔壁 v2ex 里新入会员喷子一堆才转战 Ruby China 的，没想到这里也有这种人。管理员不管一下的吗？&lt;/p&gt;

&lt;p&gt;（还是说打算把他的帖子挂在外面，让人看到他的 ID 就知道他是个喷子？倒也不是不行啦。听说是杭州华三 H3C 公司的工程师？）&lt;/p&gt;</description>
      <author>msg7086</author>
      <pubDate>Wed, 16 Jan 2019 02:00:46 +0800</pubDate>
      <link>https://ruby-china.org/topics/38007</link>
      <guid>https://ruby-china.org/topics/38007</guid>
    </item>
    <item>
      <title>手动部署依赖 ENV 存储配置的项目，ENV 怎么放？</title>
      <description>&lt;p&gt;拿到手一个新项目，全程依赖环境变量传配置（甚至 RSA 证书）。本来放在 heroku 上的，现在扔到一个独服上跑。Systemd 起 Puma。&lt;/p&gt;

&lt;p&gt;项目用到 Cron Sidekiq，偶尔要用 Rails c 进数据库瞎瘠薄改数据，所以需要 ENV 对这 4 样东西同时起效。&lt;/p&gt;

&lt;p&gt;试过放在 Systemd service unit 里，但是 Rails console 就没法利用到了。试了 dotenv-rails，好像还行？&lt;/p&gt;

&lt;p&gt;大佬们还有什么别的做法可以参考吗。&lt;/p&gt;</description>
      <author>msg7086</author>
      <pubDate>Fri, 02 Nov 2018 01:59:58 +0800</pubDate>
      <link>https://ruby-china.org/topics/37720</link>
      <guid>https://ruby-china.org/topics/37720</guid>
    </item>
    <item>
      <title>Rails --api 和 --webpack=vue</title>
      <description>&lt;p&gt;一起用的时候，放 vue 的空白 Landing 页应该放在哪呢。&lt;/p&gt;

&lt;p&gt;如果放在 public/index.html 的话，script 标签会拿不到 digest 地址。&lt;/p&gt;

&lt;p&gt;放在 view 下的话，是新建一个空白 controller 放个空白页么？&lt;/p&gt;

&lt;p&gt;大家一般是怎么处理这个问题的？&lt;/p&gt;</description>
      <author>msg7086</author>
      <pubDate>Wed, 18 Apr 2018 04:43:59 +0800</pubDate>
      <link>https://ruby-china.org/topics/35471</link>
      <guid>https://ruby-china.org/topics/35471</guid>
    </item>
    <item>
      <title>Vue.js + Rails 的设计问题</title>
      <description>&lt;p&gt;手头有个 Toy project，本来是纯 Rails 项目，大概就首页，列表，内容，这种典型的博客式网站。
现在打算用 Vue.js 练练手改成 SPA，可以学习下 JavaScript。&lt;/p&gt;

&lt;p&gt;抓了 vuejs-rails 的文档看了许久，突然意识到，要用 vue-router 好像要禁用 Rails 自己的路由才行？
要把流量全部导到 SPA 的 HTML 页面上，然后再让 JavaScript 去读地址栏再路由？&lt;/p&gt;

&lt;p&gt;你们玩这种前端框架的时候（不限于 Vue），都是怎么玩的呢？&lt;/p&gt;

&lt;p&gt;← 前端菜鸟，亿脸懵逼。&lt;/p&gt;</description>
      <author>msg7086</author>
      <pubDate>Fri, 30 Sep 2016 10:10:03 +0800</pubDate>
      <link>https://ruby-china.org/topics/31209</link>
      <guid>https://ruby-china.org/topics/31209</guid>
    </item>
    <item>
      <title>隔壁 V 站的号被封了</title>
      <description>&lt;p&gt;昨晚被人盗号拿来不知道发了一堆什么 SQL 代码，我自己发现了，于是赶紧改了密码举报了自己，今天就被封了……&lt;/p&gt;

&lt;p&gt;用这个号登录的直接封 IP 3 天，累觉不爱……&lt;/p&gt;

&lt;p&gt;然而现在想混 R 站的时候发现网站天天刷不开……&lt;/p&gt;</description>
      <author>msg7086</author>
      <pubDate>Mon, 07 Dec 2015 22:54:53 +0800</pubDate>
      <link>https://ruby-china.org/topics/28308</link>
      <guid>https://ruby-china.org/topics/28308</guid>
    </item>
    <item>
      <title>[求助] RSpec  测试用例代码重用时的 Stacktrace 美化</title>
      <description>&lt;p&gt;比如我有个测试用例文件，内容是（伪代码）&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# testcases.rb&lt;/span&gt;
&lt;span class="n"&gt;good_cases&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="p"&gt;},&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="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;bad_cases&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后 spec 文件里则生成对应的测试代码（伪代码）&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# something_spec.rb&lt;/span&gt;
&lt;span class="n"&gt;describe&lt;/span&gt; &lt;span class="n"&gt;something&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;good_cases&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="s2"&gt;"blah blah &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;to&lt;/span&gt; &lt;span class="n"&gt;be_what&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;那么问题来了。测试出错的时候，stacktrace 总是会指向 &lt;code&gt;something_spec.rb[1:1:5]&lt;/code&gt;。如何才能手工篡改使其指向 &lt;code&gt;testcases.rb:10&lt;/code&gt; 呢？&lt;/p&gt;

&lt;p&gt;我知道 &lt;code&gt;__FILE__&lt;/code&gt; 和 &lt;code&gt;__LINE__&lt;/code&gt;，然而并不知道怎样塞给 RSpec。&lt;/p&gt;</description>
      <author>msg7086</author>
      <pubDate>Sat, 03 Oct 2015 05:16:58 +0800</pubDate>
      <link>https://ruby-china.org/topics/27544</link>
      <guid>https://ruby-china.org/topics/27544</guid>
    </item>
    <item>
      <title>[炒冷饭] Rails 进程监视，你的选择是？</title>
      <description>&lt;p&gt;目标机器 Ubuntu 12.04 LTS，不能使用 Systemd。&lt;/p&gt;

&lt;p&gt;所以大致就是这么几个选择&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;monit&lt;/li&gt;
&lt;li&gt;supervised&lt;/li&gt;
&lt;li&gt;god&lt;/li&gt;
&lt;li&gt;系统自带 upstart&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;主要监视 unicorn（独立运行的 unicorn），需要崩溃时自动重启；以及将来可能用来监视 puppet agent 和 apache，看是不是死锁吃满 CPU 什么的。&lt;/p&gt;

&lt;p&gt;你的选择是？以及理由？&lt;/p&gt;</description>
      <author>msg7086</author>
      <pubDate>Wed, 12 Aug 2015 05:29:00 +0800</pubDate>
      <link>https://ruby-china.org/topics/26883</link>
      <guid>https://ruby-china.org/topics/26883</guid>
    </item>
    <item>
      <title>如何优雅地部署 Rails 项目到大量客户服务器，并且让客户手动更新版本？</title>
      <description>&lt;h2 id="背景"&gt;背景&lt;/h2&gt;
&lt;p&gt;有两个 Rails 项目，一个是主应用，另一个是管理界面（改一些系统配置，升级主应用，etc）。&lt;/p&gt;

&lt;p&gt;原先的系统全程 puppet 管理，管理界面直接覆盖文件，主应用则是自动更新 git 库。管理界面的后台去找 git tag 再显示在界面上由用户点击后 git checkout 到指定版本。&lt;/p&gt;

&lt;p&gt;用户的话，就假定有 50 个客户公司，每个公司 1 台设备好了。&lt;/p&gt;

&lt;p&gt;现在打算翻新整个部署流程，用 mina 来部署 Rails 应用。&lt;/p&gt;
&lt;h2 id="问题"&gt;问题&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;管理界面本来是由 puppet 直接覆盖到客户机上的。如果改用 mina 合适吗？有没有可能批量部署？
（这个不需要征得客户同意就可以更新）&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;主应用是先由 puppet 更新到 git，再由管理界面用户自己选定版本签出。如果改用 mina 的话要怎么实现呢？
我初步只想到可以先由 puppet 签出到客户服务器上，然后再由客户从本地 git 目录 mina 部署到本地 web 目录。&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;你们怎么看？&lt;/p&gt;</description>
      <author>msg7086</author>
      <pubDate>Fri, 17 Jul 2015 23:58:26 +0800</pubDate>
      <link>https://ruby-china.org/topics/26549</link>
      <guid>https://ruby-china.org/topics/26549</guid>
    </item>
    <item>
      <title>基于 Rails 1.X 的核心项目的重构？</title>
      <description>&lt;p&gt;接手一个公司核心项目，初版代码是 2007 年开发的，用的是 Rails 1.X，没有测试也没有 Gemfile，代码量 2 万行不到。后端有其他语言逻辑（API），前端基于 Flex（也是 2007 年技术），所以只作中间层 API，使用 XML 通讯（以后可能会改 JSON，还没确定）。&lt;/p&gt;

&lt;p&gt;现在公司打算重构到现代版本，升级到 Ruby 2 Rails 4，加入测试覆盖，以后可能会把 Flex 也换掉。&lt;/p&gt;

&lt;p&gt;那么问题来了。应该如何逐步重构？（或者应该直接推翻了新建项目再移植原有功能？）&lt;/p&gt;</description>
      <author>msg7086</author>
      <pubDate>Wed, 03 Jun 2015 23:20:32 +0800</pubDate>
      <link>https://ruby-china.org/topics/25873</link>
      <guid>https://ruby-china.org/topics/25873</guid>
    </item>
  </channel>
</rss>
