gollum 5.0.0 → 5.0.1

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3746893fd4bb885fa53c453b7224916685babb8c129a65d56ccd8c31b73e0d43
4
- data.tar.gz: 1a83709ed4921c25ea91743b36b27dc788409866a4705b71eb285920696b9853
3
+ metadata.gz: 8d4d24ffaa889dd2ccaea1b04803e084020f923f3efb3e1512609676f9fc8647
4
+ data.tar.gz: ade42ad7156ebde9985813a051b2f327bc5c597604dc3d1fa20141fc307a197a
5
5
  SHA512:
6
- metadata.gz: f43522071d711ee1fa8446636fc621db6be4c3721184018a8a050f11fb6485ef06642f0b09f056a9ec4cf3ac5da58f6b75f06315cc78823d0ce8ed35990e9c82
7
- data.tar.gz: 447f15b9174f3375825739f35f54baea66e5f583337aeb1e7ccbb87d439cd04cd1f21216e074c6dae01514261c6f6a1937558b8969621237cc543418f19f4536
6
+ metadata.gz: 33521b0483e80acdb63acbceb27dda772684dda4e5bf619e4a1cbf6fa0eb9b60c49c70ff15d0def8f34dce5d8690625e173f35137e3ff51a58e3c18926398ecb
7
+ data.tar.gz: 6f9c3b0b3a97ce1789c2f91184d6aebebab966b883be753b30562f41bca42782f1d2c2abb5b1dfd0bf55977521d2f49e77969f1211073b658860222ed772786b
data/README.md CHANGED
@@ -17,7 +17,7 @@ Gollum is a simple wiki system built on top of Git. A Gollum Wiki is simply a gi
17
17
  * May be written in a variety of [markups](#markups).
18
18
  * Can be edited with your favourite system editor or IDE (changes will be visible after committing) or with the built-in web interface.
19
19
  * Can be displayed in all versions, reverted, etc.
20
- * Gollum strives to be compatible with GitHub wikis (see `--hyphened-tag-lookup`)
20
+ * Gollum strives to be compatible with GitHub wikis (see `--lenient-tag-lookup`)
21
21
  * Gollum supports advanced functionality like:
22
22
  * [UML diagrams](https://github.com/gollum/gollum/wiki#plantuml-diagrams)
23
23
  * [BibTeX and Citation support](https://github.com/gollum/gollum/wiki/BibTeX-and-Citations)
data/bin/gollum CHANGED
@@ -172,6 +172,7 @@ MSG
172
172
  end
173
173
  opts.on('--version', 'Display the current version of Gollum.') do
174
174
  puts 'Gollum ' + Gollum::VERSION
175
+ exit 0
175
176
  end
176
177
  opts.on('--versions', 'Display the current version of Gollum and auxiliary gems.') do
177
178
  require 'gollum-lib'
@@ -286,29 +287,7 @@ else
286
287
  else
287
288
  require 'rack'
288
289
 
289
- class MapGollum
290
- def initialize(base_path)
291
- @mg = Rack::Builder.new do
292
-
293
- map "/#{base_path}" do
294
- run Precious::App
295
- end
296
- map '/' do
297
- run Proc.new { [302, { 'Location' => "/#{base_path}" }, []] }
298
- end
299
- map '/*' do
300
- run Proc.new { [302, { 'Location' => "/#{base_path}" }, []] }
301
- end
302
-
303
- end
304
- end
305
-
306
- def call(env)
307
- @mg.call(env)
308
- end
309
- end
310
-
311
290
  # Rack::Handler does not work with Ctrl + C. Use Rack::Server instead.
312
- Rack::Server.new(:app => MapGollum.new(base_path), :Port => options[:port], :Host => options[:bind]).start
291
+ Rack::Server.new(:app => Precious::MapGollum.new(base_path), :Port => options[:port], :Host => options[:bind]).start
313
292
  end
314
293
  end
@@ -4,8 +4,6 @@ require 'optparse'
4
4
  require 'pathname'
5
5
  require 'rubygems'
6
6
 
7
- REPO = ARGV[0] || Dir.pwd
8
-
9
7
  wiki_options = {}
10
8
  options = {}
11
9
 
@@ -83,12 +81,15 @@ begin
83
81
  const = setting.to_s.upcase
84
82
  Object.const_set(const, value) unless Object.const_defined?(const)
85
83
  end
84
+ wiki_options[:page_file_dir] = setting(:page_file_dir) ? setting(:page_file_dir) : wiki_options[:page_file_dir] # Allow settings :page_file_dir through PAGE_FILE_DIR constant.
86
85
  rescue OptionParser::InvalidOption
87
86
  puts "gollum-migrate-tags: #{$!.message}"
88
87
  puts "gollum-migrate-tags: try 'gollum-migrate-tags --help' for more information"
89
88
  exit
90
89
  end
91
90
 
91
+ REPO = ARGV[0] || Dir.pwd
92
+
92
93
  require 'gollum-lib'
93
94
 
94
95
  if cfg = options[:config]
@@ -261,7 +262,7 @@ wiki.pages.each do |page|
261
262
  log(:info,"Page #{page.path}")
262
263
  new_data = page.formatted_data
263
264
  if setting(:no_dry_run)
264
- path = ::File.join([wiki.path, wiki.page_file_dir, page.path].compact)
265
+ path = ::File.join(wiki.path, page.path)
265
266
  f = File.new(path, 'w')
266
267
  f.write(new_data)
267
268
  f.close
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
5
5
  s.required_ruby_version = '>= 1.9'
6
6
 
7
7
  s.name = 'gollum'
8
- s.version = '5.0.0'
9
- s.date = '2020-03-30'
8
+ s.version = '5.0.1'
9
+ s.date = '2020-04-04'
10
10
  s.license = 'MIT'
11
11
 
12
12
  s.summary = 'A simple, Git-powered wiki.'
@@ -12,7 +12,7 @@ require 'rhino' if RUBY_PLATFORM == 'java'
12
12
  require File.expand_path('../gollum/uri_encode_component', __FILE__)
13
13
 
14
14
  module Gollum
15
- VERSION = '5.0.0'
15
+ VERSION = '5.0.1'
16
16
 
17
17
  def self.assets_path
18
18
  ::File.expand_path('gollum/public', ::File.dirname(__FILE__))
@@ -40,6 +40,30 @@ Gollum::set_git_max_filesize(190 * 10**6)
40
40
  # See the wiki.rb file for more details on wiki options
41
41
 
42
42
  module Precious
43
+
44
+ # For use with the --base-path option.
45
+ class MapGollum
46
+ def initialize(base_path)
47
+ @mg = Rack::Builder.new do
48
+
49
+ map "/#{base_path}" do
50
+ run Precious::App
51
+ end
52
+ map '/' do
53
+ run Proc.new { [302, { 'Location' => "/#{base_path}" }, []] }
54
+ end
55
+ map '/*' do
56
+ run Proc.new { [302, { 'Location' => "/#{base_path}" }, []] }
57
+ end
58
+
59
+ end
60
+ end
61
+
62
+ def call(env)
63
+ @mg.call(env)
64
+ end
65
+ end
66
+
43
67
  class App < Sinatra::Base
44
68
  register Mustache::Sinatra
45
69
  register Sinatra::Namespace
@@ -188,7 +212,8 @@ module Precious
188
212
  @etag = page.sha
189
213
  mustache :edit
190
214
  else
191
- redirect_to("/create/#{encodeURIComponent(@name)}")
215
+ path = ::File.join('gollum/create', @path, @name)
216
+ redirect to(clean_url(encodeURIComponent(path)))
192
217
  end
193
218
  end
194
219
 
@@ -413,8 +438,8 @@ module Precious
413
438
  @page = wikip.page
414
439
  @page_num = [params[:page_num].to_i, 1].max
415
440
  @max_count = settings.wiki_options.fetch(:pagination_count, 10)
416
- @wiki = @page.wiki
417
441
  unless @page.nil?
442
+ @wiki = @page.wiki
418
443
  @versions = @page.versions(
419
444
  per_page: @max_count,
420
445
  page_num: @page_num,
@@ -435,12 +460,12 @@ module Precious
435
460
  end
436
461
 
437
462
  post '/compare/*' do
438
- @file = encodeURIComponent(params[:splat].first)
463
+ @file = clean_url(encodeURIComponent(params[:splat].first))
439
464
  @versions = params[:versions] || []
440
465
  if @versions.size < 2
441
- redirect_to("/history/#{@file}")
466
+ redirect to("gollum/history/#{@file}")
442
467
  else
443
- redirect_to("/compare/%s/%s...%s" % [
468
+ redirect to("gollum/compare/%s/%s...%s" % [
444
469
  @file,
445
470
  @versions.last,
446
471
  @versions.first]
@@ -51,7 +51,7 @@
51
51
  {{#mathjax_config}}
52
52
  <script type="text/javascript" src="{{base_url}}/{{mathjax_config}}"></script>
53
53
  {{/mathjax_config}}
54
- <script defer src="{{base_path}}/gollum/assets/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
54
+ <script defer src="{{base_url}}/gollum/assets/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
55
55
  {{/mathjax}}
56
56
  {{#js}}<script type="text/javascript" src="{{custom_path}}/custom.js"></script>{{/js}}
57
57
 
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: 5.0.0
4
+ version: 5.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-03-30 00:00:00.000000000 Z
12
+ date: 2020-04-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gollum-lib