gollum 2.2.6 → 2.2.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gollum might be problematic. Click here for more details.

data/README.md CHANGED
@@ -413,6 +413,14 @@ By default, internal wiki links are all absolute from the root. To specify a dif
413
413
 
414
414
  wiki = Gollum::Wiki.new("my-gollum-repo.git", :base_path => "/wiki")
415
415
 
416
+ Note that base_path just modifies the links. To map gollum to a non-root location, use `map` in config.ru. See [#532](https://github.com/github/gollum/issues/532).
417
+
418
+ > :base_path - String base path for all Wiki links.
419
+ >
420
+ > The String base path to prefix to internal links. For example, when set
421
+ > to "/wiki", the page "Hobbit" will be linked as "/wiki/Hobbit". Defaults
422
+ > to "/".
423
+
416
424
  Get the latest version of the given human or canonical page name:
417
425
 
418
426
  page = wiki.page('page-name')
data/gollum.gemspec CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.required_ruby_version = ">= 1.8.7"
6
6
 
7
7
  s.name = 'gollum'
8
- s.version = '2.2.6'
8
+ s.version = '2.2.7'
9
9
  s.date = '2012-10-14'
10
10
  s.rubyforge_project = 'gollum'
11
11
 
data/lib/gollum.rb CHANGED
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
23
23
  require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
24
24
 
25
25
  module Gollum
26
- VERSION = '2.2.6'
26
+ VERSION = '2.2.7'
27
27
 
28
28
  def self.assets_path
29
29
  ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
@@ -86,7 +86,7 @@ module Precious
86
86
  end
87
87
 
88
88
  get '/' do
89
- redirect File.join(settings.wiki_options[:base_path].to_s, 'Home')
89
+ redirect File.join(settings.wiki_options[:page_file_dir].to_s,settings.wiki_options[:base_path].to_s, 'Home')
90
90
  end
91
91
 
92
92
  # path is set to name if path is nil.
@@ -145,6 +145,7 @@ module Precious
145
145
  page_name = CGI.unescape(params[:page])
146
146
  wiki = wiki_new
147
147
  page = wiki.paged(page_name, path, exact = true)
148
+ return if page.nil?
148
149
  rename = params[:rename].to_url if params[:rename]
149
150
  name = rename || page.name
150
151
  committer = Gollum::Committer.new(wiki, commit_message)
@@ -190,13 +191,20 @@ module Precious
190
191
  path = '' if path.nil?
191
192
  format = params[:format].intern
192
193
 
194
+ page_dir = File.join(settings.wiki_options[:page_file_dir].to_s,
195
+ settings.wiki_options[:base_path].to_s)
196
+ # Home is a special case.
197
+ path = '' if name.downcase == 'home'
198
+
199
+ page_dir = File.join(page_dir, path)
200
+
193
201
  # write_page is not directory aware so use wiki_options to emulate dir support.
194
- wiki_options = settings.wiki_options.merge({ :page_file_dir => path })
202
+ wiki_options = settings.wiki_options.merge({ :page_file_dir => page_dir })
195
203
  wiki = Gollum::Wiki.new(settings.gollum_path, wiki_options)
196
204
 
197
205
  begin
198
206
  wiki.write_page(name, format, params[:content], commit_message)
199
- redirect to("/#{clean_url(CGI.escape(::File.join(path,name)))}")
207
+ redirect to("/#{clean_url(CGI.escape(::File.join(page_dir,name)))}")
200
208
  rescue Gollum::DuplicatePageError => e
201
209
  @message = "Duplicate page: #{e.message}"
202
210
  mustache :error
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.2.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: