From d4da0f86702202b30005811b5623f02ed19bb2fa Mon Sep 17 00:00:00 2001 From: rick Date: Wed, 8 Dec 2010 13:28:20 -0800 Subject: [PATCH] explicitly set the local var for 1.9 --- lib/gollum/wiki.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/gollum/wiki.rb b/lib/gollum/wiki.rb index 888cf20a..205aed24 100644 --- a/lib/gollum/wiki.rb +++ b/lib/gollum/wiki.rb @@ -184,7 +184,8 @@ module Gollum def write_page(name, format, data, commit = {}) commit = normalize_commit(commit) index = nil - sha1 = commit_index(commit) do |index| + sha1 = commit_index(commit) do |idx| + index = idx add_to_index(index, '', name, format, data) end @@ -216,7 +217,8 @@ module Gollum dir = ::File.dirname(page.path) dir = '' if dir == '.' index = nil - sha1 = commit_index(commit) do |index| + sha1 = commit_index(commit) do |idx| + index = idx if page.name == name && page.format == format index.add(page.path, normalize(data)) else @@ -243,7 +245,8 @@ module Gollum # Returns the String SHA1 of the newly written version. def delete_page(page, commit) index = nil - sha1 = commit_index(commit) do |index| + sha1 = commit_index(commit) |idx| + index = idx index.delete(page.path) end