Revision | bad2d71cf011a4ef717253f6e2c88bcf73cff63f (tree) |
---|---|
Zeit | 2007-05-29 00:52:07 |
Autor | ikeji <ikeji@f836...> |
Commiter | ikeji |
Support for old ruby
for example 1.8.2
git-svn-id: http://dev.ikejima.org/src/svn/pragger/trunk@363 f8368ae4-1e99-dc11-9799-0018f35ab5fa
@@ -11,7 +11,7 @@ class Plugin | ||
11 | 11 | def initialize(file) |
12 | 12 | instance_eval( @source = File.read(file).toutf8, file , 1) |
13 | 13 | end |
14 | - def self.load_plugins(folder = (Pathname(__FILE__).parent + "plugin")) | |
14 | + def self.load_plugins(folder = (Pathname.new(__FILE__).parent + "plugin")) | |
15 | 15 | Pathname.glob(folder + "**/*.rb").sort.each do |file| |
16 | 16 | begin |
17 | 17 | $plugins[ file.relative_path_from(folder).to_s.gsub("/","::")[0..-4] ]= Plugin.new(file) |
@@ -32,10 +32,10 @@ Plugin.load_plugins() | ||
32 | 32 | configFile = "config.yaml" |
33 | 33 | opt = OptionParser.new |
34 | 34 | opt.on("-c", "--configfile CONFIGFILE") {|v| configFile = v } |
35 | -opt.on("-p", "--plugindir PLUGINDIR") {|v| Plugin.load_plugins(Pathname(v)) } | |
35 | +opt.on("-p", "--plugindir PLUGINDIR") {|v| Plugin.load_plugins(Pathname.new(v)) } | |
36 | 36 | opt.on("-u", "--pluginusage PLUGINNAME") {|v| $plugins[v].source.gsub(/^## ?(.*)/){ puts $1 }; exit } |
37 | 37 | opt.on("-l", "--listplugin") { $plugins.keys.sort.each{|k| puts k }; exit } |
38 | -opt.on("-w", "--where") { puts(Pathname(__FILE__).parent + "plugin"); exit } | |
38 | +opt.on("-w", "--where") { puts(Pathname.new(__FILE__).parent + "plugin"); exit } | |
39 | 39 | opt.parse! |
40 | 40 | |
41 | 41 | eval_pragger(YAML.load(File.read(configFile).toutf8),[]) |