# 60sf.rb - select-filters plugin # This file is based on 50sp.rb Revision: 1.5 # Modified by KURODA Hiraku. SF_PREFIX = 'sf' @sf_path = [( @conf["#{SF_PREFIX}.path"] || "#{TDiary.root}/misc/filter" )].flatten @sf_path = @sf_path.collect do |path| /\/$/ =~ path ? path.chop : path end # get plugin option def sf_option( key ) @conf["#{SF_PREFIX}.#{key}"] end # hash of paths from array of dirs def sf_hash_from_dirs( dirs ) r = Hash.new dirs.each do |dir| Dir::glob( "#{dir}/*.rb" ).each do |path| filename = File.basename( path ) unless r[ filename ] then r[ filename ] = path end end end r end # url of the document def sf_doc_url( file ) "https://github.com/tdiary/tdiary-docs-#{@conf.lang}/wiki/#{CGI::escape( file )}" end #