Permalink
Browse files

Applied patch from Pavel Kunc to make TODO Bundle work with Ruby 1.8.7.

git-svn-id: http://svn.textmate.org/trunk/Bundles/TODO.tmbundle@10355 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent d720839 commit b8e66570ffbfff4d1c6b547dacb4459feb5d6843 @Soryu Soryu committed Aug 2, 2008
Showing with 6 additions and 6 deletions.
  1. +6 −6 Support/todo.rb
View
@@ -49,11 +49,11 @@ def TextMate.file_link (file, line = 0)
tag[:rendered] = ''
end
-html_head = ERB.new(File.open("#{ENV['TM_BUNDLE_SUPPORT']}/template_html_header.rhtml"), 0, '<>').result(binding)
+html_head = ERB.new(File.read("#{ENV['TM_BUNDLE_SUPPORT']}/template_html_header.rhtml"), 0, '<>').result(binding)
puts html_head(:window_title => "TODO", :page_title => "TODO List", :sub_title => ENV['TM_PROJECT_DIRECTORY'], :html_head => html_head)
-puts ERB.new(File.open("#{ENV['TM_BUNDLE_SUPPORT']}/template_head.rhtml"), 0, '<>').result(binding)
+puts ERB.new(File.read("#{ENV['TM_BUNDLE_SUPPORT']}/template_head.rhtml"), 0, '<>').result(binding)
STDOUT.flush
@@ -62,7 +62,7 @@ def TextMate.file_link (file, line = 0)
TextMate.each_text_file do |file|
next if (ignores != nil and file =~ /#{ignores}/) or File.symlink?(file)
file_name = file.sub(home_dir, '~')
- puts ERB.new(File.open("#{ENV['TM_BUNDLE_SUPPORT']}/template_update_dir.rhtml"), 0, '<>').result(binding)
+ puts ERB.new(File.read("#{ENV['TM_BUNDLE_SUPPORT']}/template_update_dir.rhtml"), 0, '<>').result(binding)
tags.each do |tag|
File.open(file) do |io|
io.grep(tag[:regexp]) do |content|
@@ -81,16 +81,16 @@ def TextMate.file_link (file, line = 0)
tag[:matches] << match
count = tag[:matches].length
total += 1
- puts ERB.new(File.open("#{ENV['TM_BUNDLE_SUPPORT']}/template_update.rhtml"), 0, '<>').result(binding)
- tag[:rendered] += ERB.new(File.open("#{ENV['TM_BUNDLE_SUPPORT']}/template_item.rhtml"), 0, '<>').result binding
+ puts ERB.new(File.read("#{ENV['TM_BUNDLE_SUPPORT']}/template_update.rhtml"), 0, '<>').result(binding)
+ tag[:rendered] += ERB.new(File.read("#{ENV['TM_BUNDLE_SUPPORT']}/template_item.rhtml"), 0, '<>').result binding
STDOUT.flush
end
end if File.readable?(file)
end
end
tmpl_file = "#{ENV['TM_BUNDLE_SUPPORT']}/template_tail.rhtml"
-puts ERB.new(File.open(tmpl_file), 0, '<>').result(binding)
+puts ERB.new(File.read(tmpl_file), 0, '<>').result(binding)
html_footer()

0 comments on commit b8e6657

Please sign in to comment.