Ruby5をひたすら翻訳する日記

海外で働きたい欲が高まった海山はついに強硬手段に出た。自分だけのためにRuby5(http://ruby5.envylabs.com/)翻訳し続けます。おかしなところは、適宜指摘大歓迎です!><

Episode #265 - April 20th, 2012

http://ruby5.envylabs.com/episodes/269-episode-265-april-20th-2012

RailsConf

  • 来週RailsConfだよ〜

※4/20のpodcastなので、RailsConfは終了しています

Authority

https://github.com/nathanl/authority

  • Railsの認証用gem
  • modelをAuthorizeクラスで囲んで
    • その中にRubyのメソッドを書きこんで、認証用のロジックを作る??デフォルトのままもあり???
  • DBのパーミッションをymlファイルを編集

FECH

http://open.blogs.nytimes.com/2012/04/11/announcing-fech-1-0/

  • "Federal Election Commission electronic campaign filings"のパース用gem
  • アメリカ連邦選挙委員会の電子データ

redis_failover

https://github.com/ryanlecompte/redis_failover

  • Rubyにmaster/slaveの自動フェイルオーバーを付加するgem
  • RedisFailover::Client のラッパーも提供している

rubygems-bundler

https://github.com/mpapis/rubygems-bundler

  • もう'bundle exec'しなくていい!
  • gemをインストール→~/.gemrcにcustom_shebang: $env ruby_noexec_wrapperを書く→gem regenerate_binstubs

でおk

redis-props

https://github.com/obie/redis_props

  • modelクラスの拡張
  • attributesで検索が出来る

↓な感じ(上のgithubのReadmeより引用)

class Dog < ActiveRecord::Base
  include RedisProps

  redis_props :has_medical_condition do
    define :fleas, default: false
  end
end

> dog = Dog.create(name: "Fido")

> dog.has_medical_condition_fleas?
false

> dog.has_medical_condition_fleas = true

> dog = Dog.find_by_name("Fido")

> dog.has_medical_condition_fleas?
true