From 158eb0b71846ceb0d241916b2b439438203e6457 Mon Sep 17 00:00:00 2001 From: rick Date: Tue, 13 Jul 2010 17:10:47 -0700 Subject: [PATCH] ocd whitespace. currently seeking professional help --- lib/gollum/file.rb | 4 ++-- lib/gollum/frontend/views/editable.rb | 4 ++-- lib/gollum/markup.rb | 20 ++++++++++---------- lib/gollum/page.rb | 26 +++++++++++++------------- lib/gollum/wiki.rb | 22 +++++++++++----------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/lib/gollum/file.rb b/lib/gollum/file.rb index 1fc3bcf3..c1999fe6 100644 --- a/lib/gollum/file.rb +++ b/lib/gollum/file.rb @@ -48,8 +48,8 @@ module Gollum def find(name, version) commit = @wiki.repo.commit(version) if blob = commit.tree / name - @blob = blob - @path = name + @blob = blob + @path = name @version = commit self else diff --git a/lib/gollum/frontend/views/editable.rb b/lib/gollum/frontend/views/editable.rb index 8fb6caef..6f9ac51b 100644 --- a/lib/gollum/frontend/views/editable.rb +++ b/lib/gollum/frontend/views/editable.rb @@ -2,8 +2,8 @@ module Precious module Editable def formats(selected = @page.format) Gollum::Page::FORMAT_NAMES.map do |key, val| - { :name => val, - :id => key.to_s, + { :name => val, + :id => key.to_s, :selected => selected == key} end.sort do |a, b| a[:name].downcase <=> b[:name].downcase diff --git a/lib/gollum/markup.rb b/lib/gollum/markup.rb index f8246058..e34f3cdd 100644 --- a/lib/gollum/markup.rb +++ b/lib/gollum/markup.rb @@ -8,12 +8,12 @@ module Gollum # # Returns a new Gollum::Markup object, ready for rendering. def initialize(page) - @wiki = page.wiki - @name = page.name - @data = page.raw_data + @wiki = page.wiki + @name = page.name + @data = page.raw_data @version = page.version.id - @dir = ::File.dirname(page.path) - @tagmap = {} + @dir = ::File.dirname(page.path) + @tagmap = {} @codemap = {} end @@ -93,8 +93,8 @@ module Gollum # if it is not. def process_image_tag(tag) parts = tag.split('|') - name = parts[0].strip - path = nil + name = parts[0].strip + path = nil if file = find_file(name) path = "/#{file.path}" @@ -108,7 +108,7 @@ module Gollum containered = false classes = [] # applied to whatever the outermost container is - attrs = [] # applied to the image + attrs = [] # applied to the image align = opts['align'] if opts['float'] @@ -200,9 +200,9 @@ module Gollum # if it is not. def process_page_link_tag(tag) parts = tag.split('|') - name = parts[0].strip + name = parts[0].strip cname = Page.cname((parts[1] || parts[0]).strip) - link = ::File.join(@wiki.base_path, cname) + link = ::File.join(@wiki.base_path, cname) presence = @wiki.page(cname) ? "present" : "absent" %{#{name}} end diff --git a/lib/gollum/page.rb b/lib/gollum/page.rb index 1017bc9a..266319a2 100644 --- a/lib/gollum/page.rb +++ b/lib/gollum/page.rb @@ -6,14 +6,14 @@ module Gollum VALID_PAGE_RE = /^(.+)\.(md|mkdn?|mdown|markdown|textile|rdoc|org|creole|re?st(\.txt)?|asciidoc|pod|\d)$/i FORMAT_NAMES = { :markdown => "Markdown", - :textile => "Textile", - :rdoc => "RDoc", - :org => "Org-mode", - :creole => "Creole", - :rest => "reStructuredText", + :textile => "Textile", + :rdoc => "RDoc", + :org => "Org-mode", + :creole => "Creole", + :rest => "reStructuredText", :asciidoc => "AsciiDoc", - :pod => "Pod", - :roff => "roff" } + :pod => "Pod", + :roff => "roff" } # Public: Initialize a page. # @@ -125,13 +125,13 @@ module Gollum def self.format_to_ext(format) case format when :markdown then 'md' - when :textile then 'textile' - when :rdoc then 'rdoc' - when :org then 'org' - when :creole then 'creole' - when :rest then 'rest' + when :textile then 'textile' + when :rdoc then 'rdoc' + when :org then 'org' + when :creole then 'creole' + when :rest then 'rest' when :asciidoc then 'asciidoc' - when :pod then 'pod' + when :pod then 'pod' end end diff --git a/lib/gollum/wiki.rb b/lib/gollum/wiki.rb index 15d42313..49a26aa1 100644 --- a/lib/gollum/wiki.rb +++ b/lib/gollum/wiki.rb @@ -50,7 +50,7 @@ module Gollum def initialize(path, options = {}) @path = path @repo = Grit::Repo.new(path) - @base_path = options[:base_path] || "/" + @base_path = options[:base_path] || "/" @page_class = options[:page_class] || self.class.page_class @file_class = options[:file_class] || self.class.file_class end @@ -99,11 +99,11 @@ module Gollum map = tree_map(pcommit.tree) end - map = add_to_tree_map(map, '', name, format, data) + map = add_to_tree_map(map, '', name, format, data) index = tree_map_to_index(map) parents = pcommit ? [pcommit] : [] - actor = Grit::Actor.new(commit[:name], commit[:email]) + actor = Grit::Actor.new(commit[:name], commit[:email]) index.commit(commit[:message], parents, actor) end @@ -123,7 +123,7 @@ module Gollum # Returns the String SHA1 of the newly written version. def update_page(page, format, data, commit = {}) pcommit = @repo.commit('master') - map = tree_map(pcommit.tree) + map = tree_map(pcommit.tree) index = nil @@ -131,10 +131,10 @@ module Gollum index = tree_map_to_index(map) index.add(page.path, normalize(data)) else - map = delete_from_tree_map(map, page.path) - dir = ::File.dirname(page.path) - name = page.name.split('.')[0..-2].join('.') - map = add_to_tree_map(map, dir, name, format, data) + map = delete_from_tree_map(map, page.path) + dir = ::File.dirname(page.path) + name = page.name.split('.')[0..-2].join('.') + map = add_to_tree_map(map, dir, name, format, data) index = tree_map_to_index(map) end @@ -153,9 +153,9 @@ module Gollum # Returns the String SHA1 of the newly written version. def delete_page(page, commit) pcommit = @repo.commit('master') - map = tree_map(pcommit.tree) + map = tree_map(pcommit.tree) - map = delete_from_tree_map(map, page.path) + map = delete_from_tree_map(map, page.path) index = tree_map_to_index(map) actor = Grit::Actor.new(commit[:name], commit[:email]) @@ -292,7 +292,7 @@ module Gollum # Returns the modified Hash tree map. def delete_from_tree_map(map, path) parts = path.split('/') - name = parts.pop + name = parts.pop container = nil parts.each do |part| container = map[part]