Rails-2.3.11用のExceptionNotificationプラグインは以下にあるようです (via @a_matsuda

基本的にはこれを script/plugin install -r 2-3-stable すれば良いのですが、ConsiderLocalの実装にバグがあるので 直す必要があります。

具体的には、以下のファイルの self.included の場所をConsiderLocalモジュールの直下に移動します。

あとはREADME通りに設定して、ConsiderLocalをApplicationControllerからincludeすればok

posted by Png genki on Sat 11 Jun 2011 at 06:51

GitリポジトリのRailsプラグインをインストールするときに、 標準では master ブランチがインストールされますが、 特定のブランチの内容をインストールしたい場合には、以下のように -r オプションを使用します。

   1  script/plugin install --force https://github.com/rails/exception_notification.git -r 2-3-stable

上記の例では 2-3-stable ブランチをインストールします。

posted by Png genki on Sat 11 Jun 2011 at 05:21
undefined method `parse' for nil:NilClass
posted by Png genki on Wed 9 Mar 2011 at 22:18

ちょっと前になりますが、Snow LeopardでTerminalCopyOnSelectが動かないというレポートを頂いておりました。 まだSnow Leopardへの移行ができていなくて放置状態だったのですが、 Nyahoさんがgithubでpull requestを送ってくれたのでmergeしてみました。

TerminalCopyOnSelect.bundle.zip

手元の環境では動作検証できていないのでSnow Leopardで動くかどうかは未確認ですが、環境をお持ちの方はお試しあれ。

See Also

posted by Png genki on Wed 23 Sep 2009 at 10:17 with 1 comment

最近Twitterクライアントとして Termtter を使っています。 適度に見づらいのが、かえって邪魔にならなくて良い感じです。

発言中のURLを開くときに、$ab のような識別子を指定して開くプラグインを作りました。

open.rb

   1  USAGE
   2  > open $dq
   3  open 1st URI in $dq
   4  > open $dq 2
   5  open 2nd URI in $dq

posted by Png genki on Sat 15 Aug 2009 at 04:22 with 4 comments

As I mentioned before, I am making small abstraction FW. For giving the task a vista, I want to make a list of the requirements in advance.

  • Abstract Model (I hope the ActiveORM will be)
  • Basic HTML tag helpers (such as "tag", "url_for")
  • Starting up hook to modify others
  • Way to register helpers
  • Way to read/write configuration of plugin

In particular, abstract model is quite important. There are already several efforts, but they all are probably not succeeding. I think the reason of the failure is what most of them had been concentrating to make abstraction of models for models. It must be designed for agnostic plugins.

Suppose you are an application developer and you are writing some code. Obviously, the FW and ORM have already been chosen. So you have no need to treat various ORMs for making the app. Only agnostic plugins need the abstract model.

What is the requirements of the plugins?

  • read_many with options for specifying :limit and :offset
  • read_one, create, destroy, update
  • read/write access to attributes
  • counting, searching, association and so on.

Is it the DataMapper? Yeah, it is nearly equals to. But it must have more flexibility.

In conclusion, we should not make an abstraction of models but an abstraction of plugin's requirements to FW.

posted by Png genki on Thu 23 Jul 2009 at 21:22

dm-is-remixable は、Commentなどの複数のリソースにまたがって共用されるがちなリソースをDRYにするためのDataMapperプラグインです。

しかし、Validationのためのコードを記述しても、正常に動作しないという問題がありました。これは、以下のようにすれば解決できます。

   1  module Commentable
   2    include DataMapper::Resource
   3    is :remixable, :suffix => "comment"
   4  
   5    (..snip..)
   6  
   7    def self.included(base)
   8      base.class_eval do
   9        validates_present :message
  10      end
  11    end
  12  end

See Also

posted by Png genki on Mon 4 May 2009 at 17:56

Formula は、数式を簡単にブログに貼付けて共有できるサービスです。 このたび、FormulaをRails-2.3.2に対応させました。

また、対応作業の過程で、Rails用のpaginationライブラリである、 pagination_scopeのバージョン0.1.2をリリースいたしました。

:groupオプションを含むnamed scopeのpaginationに対応いたしました。

posted by Png genki on Thu 2 Apr 2009 at 01:35

Railsでモデルのバージョン管理を行うというと、 acts_as_versionedを使うのが一般的でしたが、 しばらくメンテナンスされていないのと、githubでforkがカオス状態になっていて、公式ドキュメントと実装が一致しなくなっているなど、ちょっと使いにくい状況になっているようなので、それ以外の選択肢を調べてみました。

  • version_fu かなりシンプルな作り。ソースは100行程度。そのぶん、Versionedテーブルの作成などは自動でやってくれない。
  • SimplyVersioned こちらもシンプル路線。Versionedテーブルを使わずに、1つのテーブルでhas_manyアソシエーションを使って管理するタイプ。validates_uniqueness_ofとかを使っていないならこれでも良いかな。
  • acts_as_versioned_association aavでassociationを含むモデルのバージョニングが出来なかった問題を解決したものらしい。
posted by Png genki on Wed 1 Apr 2009 at 11:51

あのAsakusa.rbから、dm-paginationバージョン0.3.2がリリースされました。

dm-pagination-0.3.2 is out from Asakusa.rb

最近の改善が取り込まれています。 dm-paginationはMerb with DataMapper用のpaginationを提供するプラグインです。 Rails用の pagination_scope の姉妹プラグインです。

See Also

posted by Png genki on Tue 31 Mar 2009 at 10:45