今年の目標に、railsのプラグインを作るというのがあるのですが、時間ができたらと言わずに「さっさと/ささっと作れ」という助言をもらったのでささっとやってみました。まずはどいういうものかという初歩的なところから。
###Pluginディレクトリ
ここに多く集められています。
http://agilewebdevelopment.com/plugins

###様々な種類のプラグイン
プラグインはRailsの機能拡張するものなのですが、下記のように分類できます。

  • Helper系
  • Model/Controller系
  • acts_as_なんとかという名前が多い
    ex. acts_as_taggable
  • Generator系
  • その他
  • 上記のmix
    ex. acts_as_authenticated => model/controller拡張, generator
  • rake taskを作るもの
    ex. annotate_models

###作り方how-to

  • Generatorの作り方

http://blog.s21g.com/articles/215

  • pluginの作り方(情報が古い。rails変化早っ)

http://d.hatena.ne.jp/secondlife/20051101/1130850457

  • ロードパスについて

http://rakuto.blogspot.com/2006/06/rails-controllermodelview.html

###問題

  • プラグインのテスト、アプリのテスト両方のテストを通すようにtestを書くのが煩雑。
  • プラグインの更新を適用するのが面倒
    (gemのように簡単に最新にならないので、手動で削除、再インストールが必要)
posted by satoko satoko on Mon 25 Feb 2008 at 13:34 with 0 comments