• R/O
  • HTTP
  • SSH
  • HTTPS

feedgenerator: Commit

rubyで構築された、Atom Feedの管理ツールです


Commit MetaInfo

Revision4a71c8b50456d88627a43dbf92d98b608bfd3c07 (tree)
Time2011-05-05 17:31:57
Authorelixirel <elixirel@sour...>
Commiterelixirel

Log Message

Fixed plugin bug.

Change Summary

Incremental Difference

--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,5 @@
33 *.tmp_*
44 *.loadpath
55 *.project
6-*.dat
\ No newline at end of file
6+*.dat
7+plugins/*
\ No newline at end of file
--- a/feedgenerator.rb
+++ b/feedgenerator.rb
@@ -697,16 +697,16 @@ end
697697 #
698698 # プラグインの処理を行うクラスです
699699 class FeedGenPluginManager
700- def self.exec(mode, feed, entries)
700+ def self.exec(mode, feed, entry)
701701 l_feed = feed.dup.freeze
702- l_entries = entries.dup.freeze
702+ l_entry = entry.dup.freeze
703703 Dir.foreach(PLUGINDIR) do |fn|
704704 next unless File.extname(fn) == '.rb'
705705 require File.join(PLUGINDIR, fn)
706706 plugin_name = "FeedGenPlugins::"
707707 plugin_name << File.basename(fn).gsub(/\.rb\Z/, "")
708708 plugin_ins = plugin_name.split(/::/).inject(Object) { |c,name| c.const_get(name) }
709- plugin_ins.exec(mode, l_feed, l_entries)
709+ plugin_ins.new.exec(mode, l_feed, l_entry)
710710 end
711711 end
712712 end
@@ -749,7 +749,7 @@ class Controller
749749 params["mode"] = "error"
750750 else
751751 # 成功時はプラグイン処理を実施する
752- FeedGenPluginManager.exec("newentry", db["feed"], db["entry"])
752+ FeedGenPluginManager.exec("newentry", db["feed"], Entry.new(params))
753753 end
754754 # 画面を戻った際の処理
755755 when "back"
@@ -785,7 +785,7 @@ class Controller
785785 params["mode"] = "error"
786786 else
787787 # 成功時はプラグイン処理を実施する
788- FeedGenPluginManager.exec("editentry", db["feed"], db["entry"])
788+ FeedGenPluginManager.exec("editentry", db["feed"], Entry.new(params))
789789 end
790790 when "back"
791791 session["target_filepath"] = params["target_filepath"]
@@ -812,9 +812,6 @@ class Controller
812812 unless successed
813813 db["error"] = "日記の編集処理に失敗しました。<br>該当の日記が既に存在しない可能性があります。"
814814 params["mode"] = "error"
815- else
816- # 成功時はプラグイン処理を実施する
817- FeedGenPluginManager.exec("delentry", db["feed"], db["entry"])
818815 end
819816 when "back"
820817 session["target_filepath"] = params["target_filepath"]
Show on old repository browser