• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

Commit MetaInfo

Revisão1ac0fbfb9caf931bc2db9dd1158bd5e00a1b44db (tree)
Hora2009-09-22 22:49:08
Autorsoutaro <soutaro@f836...>
Commitersoutaro

Mensagem de Log

for case if config.yaml is empty

git-svn-id: http://dev.ikejima.org/src/svn/pragger/trunk@415 f8368ae4-1e99-dc11-9799-0018f35ab5fa

Mudança Sumário

Diff

--- a/pragger.rb
+++ b/pragger.rb
@@ -10,7 +10,7 @@ $plugins = {}
1010 class Plugin
1111 attr_reader :source
1212 def initialize(file)
13- instance_eval( @source = File.read(file).toutf8, file , 1)
13+ instance_eval( @source = File.read(file).toutf8, file.to_s , 1)
1414 end
1515 def self.load_plugins(folder = (Pathname(__FILE__).parent + "plugin"))
1616 Pathname.glob(folder.to_s + "**/*.rb").sort.each do |file|
@@ -23,7 +23,7 @@ class Plugin
2323 end
2424
2525 def eval_pragger(command_array,data)
26- command_array.inject(data) do |data, command|
26+ (command_array || []).inject(data) do |data, command|
2727 $plugins[command["module"]].send(command["module"].sub(/.*::/,""), command["config"] || {}, data.clone)
2828 end
2929 end
@@ -36,6 +36,7 @@ opt.on("-p", "--plugindir PLUGINDIR") {|v| Plugin.load_plugins(Pathname(v)) }
3636 opt.on("-u", "--pluginusage PLUGINNAME") {|v| $plugins[v].source.gsub(/^## ?(.*)/){ puts $1 }; exit }
3737 opt.on("-l", "--listplugin") { $plugins.keys.sort.each{|k| puts k }; exit }
3838 opt.on("-w", "--where") { puts(Pathname(__FILE__).parent + "plugin"); exit }
39+opt.on("-v", "--verbose") { $verbose = true }
3940 opt.parse!
4041
4142 eval_pragger(YAML.load(File.read(configFile).toutf8.gsub(/base64::([\w+\/]+=*)/){ Base64.decode64($1) }),[])