query: tag:fix

monk-glue-0.0.1
に含まれている Monk::Glue::Reloaderには微妙な
バグがあり、developmentモードでソースコードを更新したときに
自動リロードが上手くかからない事があるようです。

Rack::Reloaderの問題かと思っていたのですが、
調べてみると Monk::Glue::Reloader の処理に問題があることがわかりました。

reload!メソッドを以下のように修正したところ正常に動作することが確認できました。

ruby>>
def reload!
expanded_loaded_features = $LOADED_FEATURES.map do |path|
File.expand_path(path)
end
hash = Hash[expanded_loaded_features.zip($LOADED_FEATURES)]
deletes = []
files.each do |file|
if path = hash[File.expand_path(file)]
$LOADED_FEATURES.delete(path)
end
end
<<--

$LOADED_FEATURESに絶対パスと相対パスが混在していることがあるようで、
その場合にうまく処理できていないようでした。

$LOADED_FEATURESは全て絶対パスで保持するようにしたほうが良い気がします。

posted by genki genki on Fri 22 Apr 2011 at 15:27 with 0 comments

こちら
で、ExceptionNotifierプラグインのテンプレートに関するバグの報告が出ていました。

Plugins - Exception Notifier

Brett Neumeier 12 Oct 2007

In ruby 1.8.6p111, rendering the _environment.rhtml plugin fails with "TemplateError: flag after width". This is fixed if you change the string "%-s" to "%-s" on line three of the template.

Chris 18 Oct 2007

This is the correct string: "%-*s:"

具体的には、views/exception_notifier/_environment.rhtml の3行目を次のように修正すればOKのようです。

views/exception_notifier/_environment.rhtml

<% max = @request.env.keys.max { |a,b| a.length <=> b.length } -%>
<% @request.env.keys.sort.each do |key| -%>
* <%= "%-*s: %s" % [max.length, key, filter_sensitive_post_data_from_env(key, @request.env[key].to_s.strip)] %>
<% end -%>

手元の環境(ruby-1.8.6 p36/Rails-1.99.0)では、これで問題なく動作するようになりました。

posted by genki genki on Thu 15 Nov 2007 at 05:11 with 0 comments