Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
RainChen
@rainchen
VIP
NO. 377 / 2011-12-03

广州
14 Topics / 191 Replies
23 Followers
15 Following
121 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 你选择 Angular 还是 Ember? at January 23, 2014

    #52 楼 @lgn21st 我觉得如果要读完一整本书才能开始使用的一个框架,那成本有点大了(尤其 team 里成员对 js mvc 都没概念时)。 我建议对 js mvc 框架新入门的话,还是可以直接尝试 backbone 的,熟悉后再尝试 Marionette,高阶选手的就看 emberjs(经历过从 0.9.x 到 1.0.0 的升级折腾后,我个人认为,它是要把一个简单的事情做得复杂了)。 另外,backbone 让我喜欢的一个大原因是基于 underscore。

  • [广州] 酷德软件招聘 web 工程师 (已招满,感谢支持) at January 23, 2014

    良心公司,帮顶

  • 2014 Rails Girls 广州站 Ruby 教练招募! at January 07, 2014

    @adevadeh 中文越来越好了 @littlepxy 做主持了吗

  • 双色球组合 ruby 版 (just for fun) at December 30, 2013

    #5 楼 @miclle 去掉了变量牺牲了可读,不过倒是提醒了我 sample 是可以不需要参数的

  • 双色球组合 ruby 版 (just for fun) at December 30, 2013

    #3 楼 @TsingHan 是随机的

  • Enums for Active Record at November 07, 2013

    这个实现太粗糙了点,当你要做 i18n 或者要显示“男”/“女”这样的值时,还是用 gem enumerize 会方便很多

  • 大家都用什么 code review 工具呢? at October 08, 2013

    #3 楼 @bao1018 reject 的话 close PR 不就可以了?修复完可以 reopen 或者发新的 PR

  • [广州] 招聘 Ruby/Rails 开发人员 at September 16, 2013

    #8 楼 @wilask 英文要求至少能无障碍读 rails 官方的 guide,基本的书写也是必须的,我们所有的 tasks, comments 和 code review 都是用英文交流的:)

  • 测试都用 RSpec? at August 22, 2013

    说个八卦 rspec 自己是用 cucumber 来做测试,而 cucumber 是用 rspec 来做测试:)

  • Rails 中不同工程中数据迁移 at August 22, 2013

    历史数据迁移的话,推荐用 squeel 去做历史数据的读取

  • 一小段代码重构 at August 08, 2013

    有意思的题目,应该是做应答机器人之类的吧,按道理应该用责任链模式,不过这是 ruby,可以简单点:

    class WordsParser
      attr_reader :type
      attr_reader :words
    
      def initialize(words)
        @words = words
        @type  = 'other'
    
        methods.grep(/(.*)_parser/).select do |parser_method|
          if send(parser_method)
            @type = parser_method.to_s.split("_parser").first
          end
        end
      end
    
      def silent_parser
        words.nil? || words.strip.empty?
      end
    
      def shout_parser
        words.upcase == words
      end
    
      def question_parser
        words.end_with?("?")
      end
    end
    
    class Bob
      attr_reader :answer
    
      def initialize(words_type)
        @answer = send("#{words_type}_answer")
      end
    
      def silent_answer
        "Fine. Be that way!"
      end
    
      def shout_answer
        "Woah, chill out!"
      end
    
      def question_answer
        "Sure."
      end
    
      def other_answer
        "Whatever."
      end
    end
    
    ["a question?", "something", "WOW", ""].each do |words|
      words = WordsParser.new(words)
      bob = Bob.new(words.type)
      puts %{words: "#{words.words}", type:"#{words.type}", answer: "#{bob.answer}"}
    end
    
    # words: "a question?", type:"question", answer: "Sure."
    # words: "something", type:"other", answer: "Whatever."
    # words: "WOW", type:"shout", answer: "Woah, chill out!"
    # words: "", type:"silent", answer: "Fine. Be that way!"
    
    
  • 让代码审查成为你的团队习惯 at August 08, 2013

    code review 有好的工具配合可以更有效率和更容易实践,github 或 gitlab 的 PR 模式都是非常适合的,特别是他们的 UI 和 dff 的查看非常便利。

  • 用啥来 render json ? at August 07, 2013

    用 grape 的话,推荐直接用 grape-entity 做 json 输出,即方便可以重用又不失灵活性

  • 开发的女孩子伤不起! at August 06, 2013

    楼主不要气馁,看看这个http://www.oschina.net/news/33976/google-jp-programmer-girls

  • 分享 快速运行多个测试 at August 02, 2013

    楼主可以参考 http://railscasts.com/episodes/412-fast-rails-commands?view=asciicast http://railscasts.com/episodes/413-fast-tests

  • User.current 这种用法到底靠谱不靠谱? at August 01, 2013

    这个问题曾经在 rails bestpractices 上有激烈的争论: http://rails-bestpractices.com/posts/47-fetch-current-user-in-models

  • 有哪种程序语言同时拥有原型继承和类继承的特性的么? at July 15, 2013

    #19 楼 @jiyinyiyong 对比 ruby 的 public, private, protected

  • 有哪种程序语言同时拥有原型继承和类继承的特性的么? at July 15, 2013

    #17 楼 @jiyinyiyong 是 protected 不是 private

  • 有哪种程序语言同时拥有原型继承和类继承的特性的么? at July 15, 2013

    #12 楼 @blacktulip 用 JS 我还没找到能实现 protected 成员的方法

  • Sublime Text 3 Beta 向非注册用户开放了! at July 09, 2013

    #22 楼 @blacktulip 优势太多了,这里提到部分 http://www.iplaysoft.com/sublimetext.html

  • Sublime Text 3 Beta 向非注册用户开放了! at July 09, 2013

    #8 楼 @blacktulip st2 出来后一种果断抛弃 textmate 了,确实用过就不会有疑问了

  • 我现在要转行了 at June 20, 2013

    #17 楼 @gazeldx 干巴跌

  • Ruby 的方法调用好像野马 at May 31, 2013

    object_name.method_name()才是策马扬鞭 看不懂,楼主是吐槽 () 可以省略会跟对象的“属性”混淆吗?ruby 没有“属性”这一说法,只有方法,看似属性的,其实都只是其成员变量的读方法。另外,如果是要得到该方法的对象,可以用object_name.method(:method_name),这个只是语言特性,适应就好。

  • Node.js 的 Rails - sails at May 30, 2013

    “能不能用 ruby 写个前端框架啊”楼主,你要的是这个http://opalrb.org/?

  • 大家感觉这份面试题合格不? at May 28, 2013

    才发现有个 python 节点

  • [广州] GZRUBY#12 5 月 15 日 - 晚上 7:30 - Deployment at May 16, 2013

    @william 再次惊艳全场,非常精彩

  • 不选择 Markdown 的理由 at May 06, 2013

    I cannot agree with you more

  • 王垠:程序语言的常见设计错误 (2) - 试图容纳世界 at April 25, 2013

    我觉得他举的例子不对,如果要定义一个人“类”,那就应该定义好该有的基本属性,如头,手等,头可以有大小差异,但不能没有头。但他其实要处理的应该是一个“生物”类,因为长得像人“类”而他自己以为是人”类“了,他现在想给每个遇到的生物”类“都意图加上一个“带帽子”的行为,那肯定会有异常。

  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • Next
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English