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

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

Episode #307 - September 21st, 2012

http://ruby5.envylabs.com/episodes/311-episode-307-september-21st-2012

Yell 1.0.0

https://github.com/rudionrails/yell

  • 出力用のライブラリ
  • 複数のアダプタに対応しているのがすごいところ。stdout, datefile, syslog, Graylog2, や自分で書いたものとか

Complex Has Many Associations with ActiveRecord

http://www.artellectual.com/posts/complex-has-many-associations-with-activerecord

  • 複雑なhas_manyの関係をActiveRecordで表現することについてのブログ記事
  • has_manyのカスタマイズ方法

A fireside chat about optional parentheses

http://blog.mojotech.com/post/31812700196/a-fireside-chat-about-optional-parentheses

  • ()カッコを付ける場合と付けない場合についてのブログ記事
    • 式(expression)と文(statement)に関する考え
  • つまりは、メソッド呼び出しの時は、引数がなくてもカッコを付けるべき
    • カッコを付けることでメソッドであるということを表現できるから

LearnRubyAndRails.com

http://www.learnrubyandrails.com/
RubyRailsに関するチュートリアルやスクリーンキャストなどをまとめたサイト

From Lisp to Ruby

http://patshaughnessy.net/2012/9/18/how-ruby-borrowed-a-decades-old-idea-from-lisp

  • Rubyのクロージャーの概念について?
    • 言語仕様に関する細かい考察が書いてある感じ…?
  • "Ruby Under a Microscope."という本

StrongParameters

https://github.com/rails/rails/commit/c49d959e9d40101f1712a452004695f4ce27d84c

  • DHH氏がRails EdgeにStrongParametersを追加した

Episode #300 - August 24th, 2012 続き

DCI and Refinements

http://mikepackdev.com/blog_posts/35-dci-with-ruby-refinements

  • Ruby 2.0の話
    • Ruby 2.0においてのDCIの話

あとでちゃんと↑の記事を読んでみる…

Thwarting Wifi Restrictions

http://rogueleaderr.tumblr.com/post/29855576743/never-again-be-thwarted-by-restrictive-guest-wifi
publicなwifiを使うときに、制限を受けないようにする方法を紹介しているブログ記事

Removing Deadweight

http://blog.scoutapp.com/articles/2012/08/23/removing-deadweight-cleaning-up-our-rails-app
以下、ブログの内容簡単なまとめ

  • テストの時間を短縮する
    • test_benchmarkというgemを使う
    • HTTPのリクエストに関するテストは重いので、fakewebを使う
    • fixtureを使う場合とActiveRecord#createを使ったほうがいい場合を使い分ける
      • ActiveRecord#createを使うと、アプリケーションのコードによるバリデーションとコールバック処理, 適用されるデフォルト値などが保証されたデータを見ることが出来る。
      • fixtureを使うと、アプリケーションのコードやカラムに変更があったときに、fixtureで記述していたところも変更しないといけない
  • Railsのプロジェクト内で使用されていないCSSとか画像ファイルやなどを削除する方法
    • access.logからgrepで捜すとか

Episode #300 - August 24th, 2012

http://ruby5.envylabs.com/episodes/304-episode-300-august-24th-2012

Bootstrap 2.1

http://blog.getbootstrap.com/2012/08/20/bootstrap-2-1-0-released/
Twitter Bootstrapの2.1がリリースされた
120ものバグが修正された

  • ドロップダウン、affixプラグイン等。ドキュメントも新しくなった

affixプラグインは、bootstrap-affix.jsで、ドキュメントの所の説明affixにある

  • ↑のリンクの左側のメニューがまさにaffixプラグインで表示されているみたい

SASS Chrome Plugin

https://chrome.google.com/webstore/detail/lkofmbmllpgfbnonmnenkiakimpgoamn

  • Chrome拡張
  • SASSのデバッグに使える
    • コンパイル後のCSSから、そのCSSのSASS部分にジャンプしてくれる

便利そうだが…
↑の拡張の説明ページで作者がChrome側の問題等挙げている…
UXの問題があって、Chrome自体が修正されないといけないらしく…issue ticketに上げたらしいが、作者がパッチを上げる時間が今はないらしい。
11月ぐらいまではこの拡張に割ける時間が少ないらしい。
Chromeにパッチを送るとか、Googleに言ってくれると嬉しいなという話が書いてあった。

Git-Process

http://jdigger.github.com/git-process/

  • git-flowの考え方が重いと考えて作られたgem
  • fetureブランチの自動管理のgem(?)

Git-Processを使ってみたというはてなブログを発見
http://d.hatena.ne.jp/Voluntas/20101223/1293111549



続く

Episode #299 - August 21, 2012

http://ruby5.envylabs.com/episodes/303-episode-299-august-21-2012

Trace your execution stack with StackTracy

http://vimeo.com/47689001
StackTracy (stack_tracy)というgemの紹介

↑の動画で導入方法が紹介されている。
動画ではSinatoraを使った場合のスタックトレースの仕方が紹介されているが、
Sinatoraじゃなくて、普通のRubyのコードで可能。
https://github.com/archan937/stack_tracy
に載っている使い方だとこんな感じ。

[1] pry(main)> StackTracy.start
[2] pry(main)> puts "testing"
[3] pry(main)> StackTracy.stop
[1] pry(main)> stack_tracy do
[1] pry(main)*   puts "testing"
[1] pry(main)* end
  • stack_tracyのパフォーマンスが測定に影響しないように、一部分はCで書かれているらしい

The Rails flash isn’t just for messages

http://henrik.nyh.se/octopress/2012/08/the-rails-flash/

  • Railsのflash機能についてのブログ記事
  • flashで複雑な通知もすることが出来る
  • Google Analytics eventsを通知する方法とか

Show me the money with latinum

https://github.com/ioquatix/latinum

  • 通貨表示とか通貨変換とかできるgem

The University of Reddit

http://ureddit.com/class/40250/web-programming-with-ruby-on-rails

  • ↑の記事が502でアクセスできなかった…
  • Ruby on Railsの学習コンテンツ
    • 7週間のコースで45分のスクリーンキャストが毎週ある

Rails for Zombies Redux

  • Rails for Zombiesが新しくなった!
    • UIとかヒントや内容が新しくなっているらしい
    • 新しくなっても無料!

Episode #298 - August 17, 2012

http://ruby5.envylabs.com/episodes/302-episode-298-august-17-2012

Goliath is 1.0.0

https://github.com/postrank-labs/goliath

  • ノンブロッキング通信のためのRuby webサーバーフレームワーク
  • ver 1.0.0になった
    • web socketのハンドリング
    • ランタイム環境に対応?

などが修正されている

Rails-Dev-Box

https://github.com/rails/rails-dev-box
Railsの開発環境の仮想マシンを立てることができる

  • Ruby 1.9.3
  • Rails
  • Bundler
  • Git
  • その他依存しているもの

がすでに入っている

Delegation, you keep using that word…

http://www.saturnflyer.com/blog/jim/2012/07/06/the-gang-of-four-is-wrong-and-you-dont-understand-delegation

  • デリゲーションについての記事
    • 本当のデリゲーションの意味について(????)
  • JavaScriptやJSのprototypeシステムについて見識が深まるブログ記事

pjax on Rails

http://blog.bigbinary.com/2012/08/13/pjax-on-rails.html

  • ajaxよりも良い
    • ただちょっと違う
    • pjaxはページの更新リクエストなしのページナビゲーション
    • ajaxでサーバーにフラグを送信することで、ページ更新なしでページナビゲーションを実現している(?)
  • Railsにpjaxを組み込む方法が紹介されているスクリーンキャスト
  • 先週のRails meets upでDHHがpjaxを含むJSのフレームワークGoogleハングアウトを行った

learn.thoughtbot.com

https://learn.thoughtbot.com/
Railsのコンサル系企業thoughtbotが、教育系のコンテンツを1つのサイトにまとめた。
以下のジャンルがある
Ruby, Rails, design, testing, vim, JavaScript, git, RSpec

Episode #297 - August 14, 2012

http://ruby5.envylabs.com/episodes/301-episode-297-august-14-2012

Ruby on Rails version 3.2.8 has been released

http://weblog.rubyonrails.org/2012/8/9/ann-rails-3-2-8-has-been-released/

  • Rails 3.2.8がリリースされた
    • 幾つかのXSSに関する修正
    • できるときにアップグレードしたほうがいいだろう
    • 3.0や3.1でも修正されている

Compose new Rails apps with rails_apps_composer

https://github.com/RailsApps/rails_apps_composer

Get your CoreLocation with Lost and Found

https://github.com/evanphx/lost

Bitwise operations in Ruby, and an example application to testing with Rspec

http://vitobotta.com/applying-bitwise-operations-to-rspec-testing/

Manage Beanstalk with Backburner

http://nesquena.github.com/backburner/

Episode #296 - August 10th, 2012

http://ruby5.envylabs.com/episodes/300-episode-296-august-10th-2012

Huffshell

https://github.com/paulmars/huffshell

  • 今までにコマンドラインで打ったコマンドをカウントして表示してくれる
  • 作成した方がいいエイリアスの推薦をしてくれる
  1. gemでインストールして
  2. alias > ~/.aliases.cacheをコマンドラインで打つ
  3. huffshellとコマンドラインで打つ

と使える!

こんな感じ

 $ huffshell
Huffshell
=============
Importing /Users/sea_mountain/.bash_history 216 commands found
216

=============
28 unique keywords

28 commands appear > 1 times
18 commands appear > 2 times
11 commands appear > 5 times
9 commands appear > 10 times
2 commands appear > 20 times
0 commands appear > 50 times
0 commands appear > 100 times
0 commands appear > 250 times

Most common commands:
ls 48
cd 32
hg 15
vi 14
ln 13
rvm 13
git 12
brew 11
exit 11

Command tree:
ls 48: 'ls' => l
cd 32: 'cd' => c

このPCあまり使ってないことが…明らかに…////

Ruby Constructs: Class, Module and Mixin

http://matt.aimonetti.net/posts/2012/07/30/ruby-class-module-mixins/
Rubyエンジニアがよく思う疑問

  • クラスとモジュールの違い

これの解説が↑のブログ記事で行われている。

あとで読む

Version Constraint

https://github.com/on-site/version_constraint

  • jQueryのバージョン間差異
  • jQueryのバージョンをチェックしてくれる?

Textmate Open Sourced

https://github.com/textmate/textmate
「みんな大好きTextmateオープンソースになったよ!!!」
「え〜Vimオープンソースでしょ〜?」

Zeus

https://github.com/burke/zeus

  • Railsの起動時間はよくある話題
  • Zeusを使うと、console, generate, serverなどのコマンドが1秒以内になる(?)
    • sporkみたいな機能
    • Railsのconfigを予め読み込んでいる?
    • githubにデモ動画がある