Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Wyatt Pan
@wppurking
高级会员
第 2443 位会员 / 2012-06-06

[email protected]
长沙
18 篇帖子 / 439 条回帖
13 关注者
0 正在关注
62 收藏
GitHub Public Repos
  • ocserv-docker 609

    用于初始化 ocserv 的 Dockfile 脚本

  • hutch-schedule 5

    Add ActiveJob integration and Schedule Message publish to Hutch

  • event 2

    RabbitMQ message handle in Go. like hutch in ruby.

  • spapi 1

    spapi generate

  • clickhouse-cluster-demo 1

    用来了解 clickhouse cluster 的例子

  • maven-repos 0

    为没有提供 maven repo 的提供 lib

  • amazon-sp-api 0

    Amazon Selling Partner JAVA SDK SP API

  • manage-huo-baby 0

    管货宝-功能齐备的零担(专线)物流业务平台

  • tuic-docker 0

  • hutch-schedule-demo 0

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Rails 开发中的中文问题 at 2013年02月22日

    Magic_encoding

  • 有人使用 Facets 这个 Gem 吗? at 2013年02月22日

    @iBachue 谢谢,我也有同样的感觉,大多用 activesupport ...

  • Ruby China 有 QQ 群吗? at 2013年02月21日

    @ruchee 我们还有将思维导图说成 "树图"

  • 我承认自己真的是 out 了,求教↖键在哪里 at 2013年02月21日

    我到现在 Mac 上的 option(alt) 与 shift 还老弄混..

  • 想写一个网络抓取数据的程序,该怎么写 rspec 测试? at 2013年02月21日

    @neverlandxy_naix You are right. 我弄混了,多谢指正。:-)

  • Rspec and Rails Gem at 2013年02月19日

    今天心血来潮看了 CodeSchool 的 Creating Ruby Gems 然后中间有讲到 testing gem

  • 比 ack 更快更好用的东东:the silver searcher at 2013年02月19日

    报告~ 已经用 ag 替换掉了 grep ;)

  • Rails 同一台服务器配置不同的环境 at 2013年02月19日

    @ashchan 用 Nginx 搭建两个 vhost 是使用 Passenger 吗?用 puma/thin 之类不同 RACK_ENV 相同端口应该会冲突吧?

  • 如何才能使用 RubyMine 找到并阅读 ruby 源码 at 2013年02月19日

    @youfeis 的确,MRI 是 C 语言实现的 Ruby 解释器,我们一般都是安装 Ruby 是安装的编译好的二进制文件不需要源代码了。RubyMine 里面基本上是看的是 ruby 代码,object.rb 中的方法也就是个 stub. 不过你可以查看 ruby doc ,例如用 Dash 看 doc

    然后跑到 github 上去看 object.c 源码..

    我用 RubyMine 更多的是看各种 Ruby gem 的实现代码,例如:

  • 可能是最酷的 github-page at 2013年02月19日

    超级超级酷!!

  • Mongoid 中的 key 是什么意思? at 2013年02月19日

    额,我在 Mongoid Doc 中没找到 key , 还有 references_many 也没在 Mongoid Relation 中找到... 是不是用了老版本的 API ?

  • 想写一个网络抓取数据的程序,该怎么写 rspec 测试? at 2013年02月19日

    @AlphaLiu Ruby 元编程的扁平作用域

  • Rails Mailer 問題求救 at 2013年02月18日

    @xdxie 额,好吧。其实我会 diff 一下两份 raw data , 看看会不会有差别。突然我想到了 Gmail 强大的 Spam 过滤。

  • Rails Mailer 問題求救 at 2013年02月18日

    @xdxie 然后你比较比较通过手动发送的邮件,与通过 Rails Mailer 发送的邮件他们会有什么差别吗?Gmail 里面有一个 Show original 可以看到发送邮件的所有信息。外面看不出来,就只能看具体参数信息了。

  • Rspec and Rails Gem at 2013年02月18日

    @hellolucky123 哈哈,我发现我也这样折腾过.

  • 让 ruby 5 秒之后执行一个任务 at 2013年02月18日

    可以看看 timers, 也是 Celluloid 中用到了。不过实现也是 sleep, 代码上使用方便点。

    require 'timers'
    timers = Timers.new
    timers.after(5) { puts 'do something' }
    timers.wait # 5s 后 puts...
    

    其实我是上次看 Sidekiq 的 scheduled.rb 找到 Celluloid , 然后再到 timers gem..

  • Rspec and Rails Gem at 2013年02月18日

    @hellolucky123 这个可以理解成脱离 Rails 使用 Rspec 吗?因为在 github 上,看到很多 gem 都会带上一个 spec/ 目录,用 Rspec 测试 Gem . 例 Celluloid

  • Rails Mailer 問題求救 at 2013年02月18日

    你可以先手动发送一封邮件到 [email protected] 邮箱,看看是否会成功自动转发。

    邮件成功发送到 edu.tw 邮箱了,Rails Mailer 的工作也就做完了 - -||

  • 如何知道一个类定义完了? at 2013年02月17日

    @xjz19901211 :) 不要忘记测试 . 测试很重要。

  • 如何知道一个类定义完了? at 2013年02月17日

    @xjz19901211 换个方式,直接从 A 类处理了子类 include 的 module 的方法。感觉有点暴力啊,如果真要这么做一定要让所有单元测试跑通才行啊。

    class A
    
      class << self
        # class macro 用于可动态调整, 例如
        # B.class_eval do
        #   include M2
        #   check_super :m2_b
        # end 
        # B.new.m2_b # m2-b
        #
        def check_super(method_name)
          # 根据 method_name 查询所有的 module 的第一个 instance_method, 如果存在, 并且 self 不是 A 这个父类的话, 就使用 module 中的 method_name
          first_module_method = self.included_modules.map { |_module| _module.instance_method(method_name) if _module.instance_methods(false).include?(method_name) }.first
          self.send(:remove_method, method_name) if self != A and first_module_method
        end
    
        def method_added(method_name)
          check_super(method_name)
        end
      end
    end
    
    module M
      def a
        puts 'm-a'
      end
    end
    
    class B < A
      include M
    
      def a
        puts 'b-a'
      end
    end
    
    B.new.a # m-a
    
  • 如何知道一个类定义完了? at 2013年02月17日

    @xjz19901211 不知道我的理解是否正确。

    require 'active_support/core_ext'
    
    module M
     # 可以不需要 Concern 转而使用 self.included(mod) 加 mod.send(..) 处理
      extend ActiveSupport::Concern
    
      included do
        alias_method :ori_a, :a
        remove_method :a
      end
    
      def a
        puts 'm-a'
      end
    end
    
    class A
    end
    
    class B < A
    
      def a
        puts 'b-a'
      end
    
      # 因为需要 B 先有 a 方法, 才能够在 Module 中处理 a 方法.
      # 如果是动态 include  那应该没有问题.
      include M
    end
    
    b_klass = B.new
    b_klass.a # m-a
    b_klass.ori_a # b-a
    
  • 比 linode 更好用的 vps 一个月只需要 5 美元 at 2013年02月16日

    @ttt 马甲君好,马甲君再见。

    DigitalOcean 相比 Linode , 我还是会选 Linode.

    • 价格是按照小时收费,每个月有收费上限 (也就是月费).
    • VPS Power Off 仍然需要收费,需要制作一个 Snapshot. Delete 掉 VPS 才会停止收费。
    • 4GB RAM 只有 2 vCore 有点吝啬.(有其原因)
    • 原来网络是免费的,现在网络收费了。速度时而很好,时而很糟。
    • 相比其他 SSD 硬盘的 VPS, (IO) 性能不算好。可进 serverbear.com 看看
    • 价格相对入门比较便宜。(不过针对 512MB 的,我会选择 heroku 或 appfog 了)
    • server setup 很快。
    • DigitalOcean 服务器还挺稳定

    试用过后的感受,现在已经没有使用了。

  • Teahour.fm 第 3 期,除夕特别版发布 :-) at 2013年02月09日

    哇~ 终于等到了~

  • 除夕夜你还看春晚? at 2013年02月09日

    春晚已经没有吸引力啦

  • Teahour.fm (Nil Podcast) 第 2 期发布 :) at 2013年02月05日

    意犹未尽 :)

  • 如何在 Rails development 模式下开启多线程并行处理 at 2013年02月04日

    #4 楼 @iBachue 是不是 development.rb 文件中没有设置 config.threadsafe! 呢?你还可以参考一下这篇文章

  • 求 rubymine 用户来介绍 at 2013年02月02日

    #2 楼 @cxh116 你可以关掉全自动 Code Completion, 很慢应该是在不停的计算字符补全上,关掉以后,需要补全的时候手动 Code Completion 就好了。正常使用不会影响写代码的速度。

  • [暂停,详见帖子内容] OSChina 蛇年新春巨献:JetBrains 开发工具全场 2 折! at 2013年01月31日

    非常值,比"世界末日"那一次还给力。

  • 上一页
  • 1
  • 2
  • …
  • 10
  • 11
  • 12
  • 13
  • 14
  • 下一页
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English