lib/ore/config.rb in ore-0.1.3 vs lib/ore/config.rb in ore-0.1.4

- old
+ new

@@ -24,15 +24,17 @@ # The given block will be passed every builtin template. # # @yieldparam [String] path # The path of a Ore template directory. # - def Config.builtin_templates(&block) + def Config.builtin_templates path = File.join(@@data_dir,'ore','templates') if File.directory?(path) - Dir.glob("#{path}/*",&block) + Dir.glob("#{path}/*") do |template| + yield template if File.directory?(template) + end end end # # The installed templates. @@ -41,12 +43,14 @@ # The given block will be passed every installed template. # # @yieldparam [String] path # The path of a Ore template directory. # - def Config.installed_templates(&block) + def Config.installed_templates if File.directory?(@@templates_dir) - Dir.glob("#{@@templates_dir}/*",&block) + Dir.glob("#{@@templates_dir}/*") do |template| + yield template if File.directory?(template) + end end end end end