Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Fred Wu
@fredwu
高级会员
第 188 位会员 / 2011-11-23

墨尔本
109 篇帖子 / 836 条回帖
156 关注者
0 正在关注
0 收藏
https://fredwu.me/
GitHub Public Repos
  • crawler 952

    A high performance web crawler / scraper in Elixir.

  • angel_nest 774

    Project code name: Angel Nest. :)

  • opq 269

    Elixir queue! A simple, in-memory queue with worker pooling and rate limiting in Elixir.

  • stemmer 153

    An English (Porter2) stemming implementation in Elixir.

  • jquery-inline-confirma... 53

    Inline Confirmation plugin for jQuery. One of the less obtrusive ways of implementing confirmatio...

  • dotfiles 18

    My dotfiles

  • README-xplor 10

    Fred @ Xplor - how to work with me.

  • yield.rb 5

    Aggregated token amounts and values. Supports ApeBoard, YieldWatch, Binance, CoinGecko and more.

  • advent_of_code_2018 4

    https://adventofcode.com/2018/about

  • fredwu.me-v3 3

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • [上海][2011 年 11 月 29 日] RubyTuesday 活动 at 2011年11月25日

    请问上海的 RubyTuesday 是每个月一次吗?还是不定时的?:)

  • Rails 怎么排好 HTML 代码 at 2011年11月25日

    #15 楼 @southwolf 嘿嘿,乘新手刚入门时就抓进来调教,这样才能壮大 Slim 的用户群啊,啊哈哈哈(邪恶的笑~~)

  • 扯 Rails 开发环境暴慢的原因 at 2011年11月25日

    #1 楼 @night_song @huacnlee

    https://github.com/thedarkone/rails-dev-boost

  • Rails 怎么排好 HTML 代码 at 2011年11月25日

    #10 楼 @lgn21st

    Textmate: https://github.com/fredwu/ruby-slim-tmbundle Vim: https://github.com/bbommarito/vim-slim

  • Rails 怎么排好 HTML 代码 at 2011年11月25日

    或者可以使用 Slim,自动生成漂亮的 HTML,嘿嘿 http://slim-lang.com/

  • Test::Unit 还是 Rspec at 2011年11月25日

    #18 楼 @cqpx Capybara 1.0 开始就内置了 Steak 的功能了,不需要用 Steak 了。

    但是,我不推荐这么用。如果是要 BDD 的话,应当用 Cucumber。两年前我也很讨厌 Cucumber,然后那时候的项目都用的 Steak。现在才开始体会到正确的使用 Cucumber,是非常高效的。

  • Test::Unit 还是 Rspec at 2011年11月25日

    #15 楼 @Rei 我还是不能理解你把 RSpec 和 Cucumber 混一起说的逻辑…… 你在顶楼只是提到 RSpec 和 Test::Unit,为什么突然把 Cucumber 牵扯进来呢?RSpec 那本书谈到 Cucumber 和这个帖子的主题貌似没有关系吧?

  • Test::Unit 还是 Rspec at 2011年11月25日

    #11 楼 @Rei “强烈反感 Rspec 的是因为 Cucumber”这个。。。-__-# 这样的说法岂不是和因为 Cucumber 所以强烈反感 ruby 是一样的道理……

  • Test::Unit 还是 Rspec at 2011年11月25日

    我在早前一个帖子里回复过,我在这里再回复一下——

    我一般写 library,用 MiniTest(Test::Unit)。写应用程序,用 RSpec,主要是 RSpec 的 DSL 比 Test::Unit 要简练。当然,MiniTest 有个 Spec 的库可以用,不过我几乎没怎么用过,不知道是否支持 shared examples/context。

  • Test::Unit 还是 Rspec at 2011年11月25日

    RSpec 部分是我加的。

    Test::Unit 如何简单的实现 Rspec 里的 shared examples 和 shared context?

  • Code smell in Ruby-China code base at 2011年11月25日

    可以用 Newrelic 帮助查找程序的性能瓶颈。

  • 求 Textmate 推荐配色 Theme at 2011年11月24日

    我一直用 Twilight.

  • Code smell in Ruby-China code base at 2011年11月24日

    另外,其实刚开始开发这个社区系统就用上那么多 cache,本身也是一个 smell (premature optimisation). :P 咳咳,我比较洁癖一点,哈,见谅见谅~~

  • Code smell in Ruby-China code base at 2011年11月24日

    #27 楼 @dave 是的,呵呵。

  • 求 Gem,有没有支持发 attachment 的 Amazon SES 服务的 Gem at 2011年11月24日

    貌似 aws-ses 支持用 send_raw_email 自己加 MIME-TYPE,gem 还没有专门的 api。

  • 求 Gem,有没有支持发 attachment 的 Amazon SES 服务的 Gem at 2011年11月24日

    #5 楼 @huacnlee 哦,看错了,那就是这个:https://github.com/drewblas/aws-ses

  • 求 Gem,有没有支持发 attachment 的 Amazon SES 服务的 Gem at 2011年11月24日

    CarrierWave: https://github.com/jnicklas/carrierwave

  • Code smell in Ruby-China code base at 2011年11月24日

    另外提个小建议:用户的 ID 集最好写'user_ids',因为'uids'一般是用来表示 unique ids 的。:)

  • Code smell in Ruby-China code base at 2011年11月24日

    Topic#user_readed? 初步重构完毕:https://github.com/fredwu/ruby-china/commit/5f02b50749f6df945e1478f2106e78eeb68ce51d

    重构需要一步一步慢慢来。

  • Code smell in Ruby-China code base at 2011年11月24日

    先对代码其他地方做了些微调整: https://github.com/huacnlee/ruby-china/pull/35/files

    出去跑一圈步回来后继续重构……

  • Code smell in Ruby-China code base at 2011年11月24日

    我正在加测试,一会儿我会重构一下然后提交 pull request。:)

  • 大家觉得有没有必要把者也的功能移植到这个社区? at 2011年11月24日

    #13 楼 @lgn21st 找到这个:http://blog.linkibol.com/2010/05/07/how-to-build-a-popularity-algorithm-you-can-be-proud-of/

  • 大家觉得有没有必要把者也的功能移植到这个社区? at 2011年11月24日

    另外,可以给用户模型加个 karma 值。karma 越高的加成越多。

  • 大家觉得有没有必要把者也的功能移植到这个社区? at 2011年11月24日

    #1 楼 @huacnlee 可以写个新的 ranking 算法。给特定节点的帖子和/或特定用户的帖子加成。

  • 访问数据,46% 的人都用 Mac 啊! at 2011年11月24日

    啊,我的 blog(http://fredwu.me/ ),mac 用户 40%,win 用户 38%,linux 用户 20%……

  • 关于测试, 有什么好的建议吗? at 2011年11月24日

    #12 楼 @cqpx

    在 https://github.com/huacnlee/ruby-china/pull/9/files#L6R47 里:

    这些登录步骤都是重复的——

    And 点击"登录"
    And 在"用户名"输入"sergey"
    And 在"密码"输入"sergeywonttellyou"
    And 点击"登陆"
    

    这些都应该放在一个 step definition 里。

    
    RSpec/Test::Unit/MiniTest用来测试程序的逻辑。
    
    Cucumber用来模拟用户使用你的程序的流程。 
    
  • 针对初学者,大家一起来搞点事吧 at 2011年11月24日

    #2 楼 @southwolf

    我的 Angel Nest 项目应该算是比较适合新手学习的—— https://github.com/fredwu/angel_nest

  • 关于测试, 有什么好的建议吗? at 2011年11月24日

    Cucumber 原本是写给产品人员看的,或是说,产品人员或测试人员可以写 Cucumber 用来制定程序的逻辑。

    但是,产品和测试写出来的 Cucumber steps 都不是很 dry,非常难维护。即便是一些经验不多的开发人员,也写不好 Cucumber 的 steps。

    用 Cucumber 做 acceptance tests 的用意是,features/scenarios 本身不应该包含任何 implementation 的逻辑——如果页面上的 UI 有更动,你应当修改 step definition,而非 features。

    比方说,如果要测试用户登录。很多人会这么写:

    Given I'm on the hompage
    When I click the "login" link
    Then I should see "User Login"
    Then I fill in "username" with "test"
    Then I fill in "password" with "test"
    Then I click the "login" button
    Then I should see "Welcome test! You're logged in."
    

    类似这样的 feature 很难维护。如果登录的逻辑变动了,你需要修改很多地方。

    比较正确的写法是——

    Given I'm on the homepage
    Then I should be able to sign in as user "test" with password "test"
    

    然后把所有的登录逻辑放到第二行的 step definition 里。

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