gollum-lib 5.0.3-java → 5.1.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -2
- data/Rakefile +1 -0
- data/gemspec.rb +14 -17
- data/gollum-lib.gemspec +2 -2
- data/gollum-lib_java.gemspec +2 -2
- data/lib/gollum-lib/blob_entry.rb +16 -6
- data/lib/gollum-lib/committer.rb +1 -1
- data/lib/gollum-lib/file.rb +1 -1
- data/lib/gollum-lib/filter/pandoc_bib.rb +6 -5
- data/lib/gollum-lib/filter/tags.rb +1 -0
- data/lib/gollum-lib/filter/toc.rb +42 -3
- data/lib/gollum-lib/filter/yaml.rb +1 -1
- data/lib/gollum-lib/helpers.rb +1 -1
- data/lib/gollum-lib/macro.rb +4 -0
- data/lib/gollum-lib/macro/series.rb +2 -2
- data/lib/gollum-lib/markups.rb +4 -3
- data/lib/gollum-lib/page.rb +3 -2
- data/lib/gollum-lib/redirects.rb +4 -3
- data/lib/gollum-lib/version.rb +1 -1
- data/lib/gollum-lib/wiki.rb +6 -4
- metadata +30 -84
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86522ff24f9e9b09250954b5c3ffd0438e0a36b754c991de5b7d8804d76821b9
|
4
|
+
data.tar.gz: cda628f38b4fdfc54af5abaa10576717c09a439c9b7d634db523e2c11fdd31b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 220d93def416381e2077d55eb3894fa48722e37344a77b69137e4c7ecb949a632b30b838f43d4c7c97bd33e19339f5b2fa051c61b7320f8b78cfb48b71c7d2b8
|
7
|
+
data.tar.gz: 6ae767089ea2efc4d7de8187ae8020163d5fe5f1dd9777a0b78d9877387fda79b67663e9537649cfb7330ba7e786e2aa4a164083ab98e94640e4b5dad61e123b
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@ gollum lib -- A wiki built on top of Git
|
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/gollum-lib.svg)](http://badge.fury.io/rb/gollum-lib)
|
5
5
|
[![Build Status](https://travis-ci.org/gollum/gollum-lib.svg?branch=master)](https://travis-ci.org/gollum/gollum-lib)
|
6
|
-
[![Dependency Status](https://
|
6
|
+
[![Cutting Edge Dependency Status](https://dometto-cuttingedge.herokuapp.com/github/gollum/gollum-lib/svg 'Cutting Edge Dependency Status')](https://dometto-cuttingedge.herokuapp.com/github/gollum/gollum-lib/info)
|
7
7
|
|
8
8
|
## DESCRIPTION
|
9
9
|
|
@@ -91,7 +91,7 @@ Note that `base_path` just modifies the links.
|
|
91
91
|
Get the latest version of the given human or canonical page name:
|
92
92
|
|
93
93
|
```ruby
|
94
|
-
page = wiki.page('/page name') # Finds pages in the root directory of the wiki that are named 'page name' with a valid extension.
|
94
|
+
page = wiki.page('/page name') # Finds pages in the root directory of the wiki that are named 'page name' with a valid extension.
|
95
95
|
# => <Gollum::Page>
|
96
96
|
|
97
97
|
page = wiki.page('page name') # For convenience, you can leave out the '/' in front. Paths are assumed to be relative to '/'.
|
@@ -217,6 +217,21 @@ end
|
|
217
217
|
Gollum::Hook.unregister(:post_commit, :hook_id)
|
218
218
|
```
|
219
219
|
|
220
|
+
Register or unregister a hook to be called after the wiki is initialized:
|
221
|
+
|
222
|
+
```ruby
|
223
|
+
Gollum::Hook.register(:post_wiki_initialize, :hook_id) do |wiki|
|
224
|
+
# Your code here
|
225
|
+
end
|
226
|
+
|
227
|
+
Gollum::Hook.unregister(:post_wiki_initialize, :hook_id)
|
228
|
+
```
|
229
|
+
|
230
|
+
A combination of both hooks can be used to pull from a remote after
|
231
|
+
`:post_wiki_initialize` and push to a remote after `:post_commit` which in
|
232
|
+
effect keeps the remote in sync both ways. Keep in mind that it may not be
|
233
|
+
possible to resolve all conflicts automatically.
|
234
|
+
|
220
235
|
## WINDOWS FILENAME VALIDATION
|
221
236
|
|
222
237
|
Note that filenames on windows must not contain any of the following characters `\ / : * ? " < > |`. See [this support article](http://support.microsoft.com/kb/177506) for details.
|
data/Rakefile
CHANGED
data/gemspec.rb
CHANGED
@@ -8,7 +8,7 @@ def specification(version, default_adapter, platform = nil)
|
|
8
8
|
s.name = 'gollum-lib'
|
9
9
|
s.version = version
|
10
10
|
s.platform = platform if platform
|
11
|
-
s.date = '
|
11
|
+
s.date = '2021-06-28'
|
12
12
|
s.date = '2017-04-13'
|
13
13
|
s.rubyforge_project = 'gollum-lib'
|
14
14
|
s.license = 'MIT'
|
@@ -29,36 +29,33 @@ def specification(version, default_adapter, platform = nil)
|
|
29
29
|
s.add_dependency 'rouge', '~> 3.1'
|
30
30
|
s.add_dependency 'nokogiri', '~> 1.8'
|
31
31
|
s.add_dependency 'loofah', '~> 2.3'
|
32
|
-
s.add_dependency 'github-markup', '~>
|
32
|
+
s.add_dependency 'github-markup', '~> 4.0'
|
33
33
|
s.add_dependency 'gemojione', '~> 4.1'
|
34
|
-
s.add_dependency 'octicons', '~>
|
34
|
+
s.add_dependency 'octicons', '~> 12.0'
|
35
35
|
s.add_dependency 'twitter-text', '1.14.7'
|
36
36
|
|
37
37
|
s.add_development_dependency 'org-ruby', '~> 0.9.9'
|
38
|
-
s.add_development_dependency 'kramdown', '~> 2.
|
38
|
+
s.add_development_dependency 'kramdown', '~> 2.3.0'
|
39
39
|
s.add_development_dependency 'kramdown-parser-gfm', '~> 1.1.0'
|
40
40
|
s.add_development_dependency 'RedCloth', '~> 4.2.9'
|
41
|
-
s.add_development_dependency 'mocha', '~> 1.
|
42
|
-
s.add_development_dependency 'shoulda', '~>
|
41
|
+
s.add_development_dependency 'mocha', '~> 1.11'
|
42
|
+
s.add_development_dependency 'shoulda', '~> 4.0'
|
43
43
|
s.add_development_dependency 'wikicloth', '~> 0.8.3'
|
44
|
-
s.add_development_dependency 'bibtex-ruby', '~>
|
44
|
+
s.add_development_dependency 'bibtex-ruby', '~> 6.0'
|
45
45
|
s.add_development_dependency 'citeproc-ruby', '~> 1.1'
|
46
46
|
s.add_development_dependency 'unicode_utils', '~> 1.4.0' # required by citeproc-ruby on ruby < 2.4
|
47
|
-
s.add_development_dependency 'rake', '~>
|
48
|
-
s.add_development_dependency 'pry', '~> 0.
|
47
|
+
s.add_development_dependency 'rake', '~> 13.0'
|
48
|
+
s.add_development_dependency 'pry', '~> 0.13'
|
49
49
|
# required by pry
|
50
50
|
s.add_development_dependency 'rb-readline', '~> 0.5.1'
|
51
51
|
# updating minitest-reporters requires a new minitest which fails with gollum's tests.
|
52
|
-
s.add_development_dependency 'test-unit', '~> 3.
|
52
|
+
s.add_development_dependency 'test-unit', '~> 3.3'
|
53
53
|
s.add_development_dependency 'minitest-reporters', '~> 1.4'
|
54
54
|
s.add_development_dependency 'nokogiri-diff', '~> 0.2.0'
|
55
|
-
|
56
|
-
s.add_development_dependency 'guard', '~> 2.
|
57
|
-
s.add_development_dependency '
|
58
|
-
|
59
|
-
s.add_development_dependency 'rb-fsevent', '~> 0.9.4'
|
60
|
-
s.add_development_dependency 'rb-fchange', '~> 0.0.6'
|
61
|
-
s.add_development_dependency 'twitter_cldr', '~> 3.1.0'
|
55
|
+
s.add_development_dependency 'guard', '~> 2.16'
|
56
|
+
s.add_development_dependency 'guard-minitest', '~> 2.4'
|
57
|
+
s.add_development_dependency 'twitter_cldr', '~> 6.4'
|
58
|
+
|
62
59
|
# = MANIFEST =
|
63
60
|
s.files = %w(
|
64
61
|
Gemfile
|
data/gollum-lib.gemspec
CHANGED
@@ -3,8 +3,8 @@ require File.join(File.dirname(__FILE__), 'lib', 'gollum-lib', 'version.rb')
|
|
3
3
|
# This file needs to conditionally define the default adapter for MRI and Java, because this is the file that is included from the Gemfile.
|
4
4
|
# In addition, the default Java adapter needs to be defined in gollum-lib_java.gemspec beause that file is used to *build* the Java gem.
|
5
5
|
if RUBY_PLATFORM == 'java' then
|
6
|
-
default_adapter = ['gollum-rjgit_adapter', '
|
6
|
+
default_adapter = ['gollum-rjgit_adapter', '~> 0.6']
|
7
7
|
else
|
8
|
-
default_adapter = ['gollum-rugged_adapter', '
|
8
|
+
default_adapter = ['gollum-rugged_adapter', '~> 1.0']
|
9
9
|
end
|
10
10
|
Gem::Specification.new &specification(Gollum::Lib::VERSION, default_adapter)
|
data/gollum-lib_java.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), 'gemspec.rb')
|
2
2
|
require File.join(File.dirname(__FILE__), 'lib', 'gollum-lib', 'version.rb')
|
3
|
-
default_adapter = ['gollum-rjgit_adapter', '
|
4
|
-
Gem::Specification.new &specification(Gollum::Lib::VERSION, default_adapter, "java")
|
3
|
+
default_adapter = ['gollum-rjgit_adapter', '~> 0.6']
|
4
|
+
Gem::Specification.new &specification(Gollum::Lib::VERSION, default_adapter, "java")
|
@@ -78,12 +78,22 @@ module Gollum
|
|
78
78
|
# Returns a normalized String directory name, or nil if no directory
|
79
79
|
# is given.
|
80
80
|
def self.normalize_dir(dir)
|
81
|
-
return
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
81
|
+
return unless dir
|
82
|
+
|
83
|
+
dir = dir.dup
|
84
|
+
|
85
|
+
# Remove '.' and '..' path segments
|
86
|
+
dir.gsub!(%r{(\A|/)\.{1,2}(/|\z)}, '/')
|
87
|
+
|
88
|
+
# Remove repeated slashes
|
89
|
+
dir.gsub!(%r{//+}, '/')
|
90
|
+
|
91
|
+
# Remove Windows drive letters, trailing slashes, and keep one leading slash
|
92
|
+
dir.sub!(%r{\A([a-z]:)?/*(.*?)/*\z}i, '/\2')
|
93
|
+
|
94
|
+
# Return empty string for paths that point to the toplevel
|
95
|
+
return '' if dir == '/'
|
96
|
+
|
87
97
|
dir
|
88
98
|
end
|
89
99
|
end
|
data/lib/gollum-lib/committer.rb
CHANGED
@@ -54,7 +54,7 @@ module Gollum
|
|
54
54
|
@actor ||= begin
|
55
55
|
@options[:name] = @wiki.default_committer_name if @options[:name].nil?
|
56
56
|
@options[:email] = @wiki.default_committer_email if @options[:email].nil?
|
57
|
-
Gollum::Git::Actor.new(@options[:name], @options[:email])
|
57
|
+
Gollum::Git::Actor.new(@options[:name], @options[:email], @options[:time])
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
data/lib/gollum-lib/file.rb
CHANGED
@@ -171,7 +171,7 @@ module Gollum
|
|
171
171
|
return false if @blob.is_symlink && !FS_SUPPORT_SYMLINKS
|
172
172
|
|
173
173
|
# This will try to resolve symbolic links, as well
|
174
|
-
pathname = Pathname.new(::File.
|
174
|
+
pathname = Pathname.new(::File.join(@wiki.repo.path, '..', BlobEntry.normalize_dir(@path)))
|
175
175
|
if pathname.symlink?
|
176
176
|
source = ::File.readlink(pathname.to_path)
|
177
177
|
realpath = ::File.join(::File.dirname(pathname.to_path), source)
|
@@ -14,16 +14,15 @@ class Gollum::Filter::PandocBib < Gollum::Filter
|
|
14
14
|
|
15
15
|
def extract(data)
|
16
16
|
return data unless supported_format? && bibliography_metadata_present?
|
17
|
-
bib_metadata
|
18
|
-
bib_metadata.merge!(@markup.metadata.select {|key, _value| BIB_KEYS.include?(key)})
|
17
|
+
@bib_metadata.select! {|key, _value| BIB_KEYS.include?(key)}
|
19
18
|
|
20
19
|
BIB_PATH_KEYS.each do |bibliography_key|
|
21
20
|
if path = @markup.metadata[bibliography_key]
|
22
21
|
next unless file = @markup.wiki.file(path)
|
23
|
-
bib_metadata[bibliography_key] = path_for_bibfile(file)
|
22
|
+
@bib_metadata[bibliography_key] = path_for_bibfile(file)
|
24
23
|
end
|
25
24
|
end
|
26
|
-
bib_metadata.empty? ? data : "#{bib_metadata.to_yaml}---\n#{data}"
|
25
|
+
@bib_metadata.empty? ? data : "#{@bib_metadata.to_yaml}---\n#{data}"
|
27
26
|
end
|
28
27
|
|
29
28
|
private
|
@@ -47,6 +46,8 @@ class Gollum::Filter::PandocBib < Gollum::Filter
|
|
47
46
|
end
|
48
47
|
|
49
48
|
def bibliography_metadata_present?
|
50
|
-
|
49
|
+
return false unless @markup.metadata
|
50
|
+
@bib_metadata = @markup.wiki.metadata.merge(@markup.metadata)
|
51
|
+
@bib_metadata.keys.any? {|key| ALL_BIB_KEYS.include?(key)}
|
51
52
|
end
|
52
53
|
end
|
@@ -230,6 +230,7 @@ class Gollum::Filter::Tags < Gollum::Filter
|
|
230
230
|
else
|
231
231
|
name = page ? path_to_link_text(link) : link
|
232
232
|
end
|
233
|
+
|
233
234
|
link = page ? page.escaped_url_path : ERB::Util.url_encode(link).force_encoding('utf-8')
|
234
235
|
generate_link(link, name, extra, presence)
|
235
236
|
end
|
@@ -1,5 +1,8 @@
|
|
1
1
|
# Inserts header anchors and creates TOC
|
2
2
|
class Gollum::Filter::TOC < Gollum::Filter
|
3
|
+
|
4
|
+
HEADERS = (1..6).to_a
|
5
|
+
|
3
6
|
def extract(data)
|
4
7
|
data
|
5
8
|
end
|
@@ -10,12 +13,15 @@ class Gollum::Filter::TOC < Gollum::Filter
|
|
10
13
|
@toc_doc = nil
|
11
14
|
@anchor_names = {}
|
12
15
|
@current_ancestors = []
|
13
|
-
|
16
|
+
@headers_levels = {}
|
14
17
|
toc_str = ''
|
15
18
|
if @markup.sub_page && @markup.parent_page
|
16
19
|
toc_str = @markup.parent_page.toc_data
|
17
20
|
else
|
18
|
-
@doc.css(
|
21
|
+
@headers = @doc.css(headers_selector)
|
22
|
+
get_toc_levels()
|
23
|
+
|
24
|
+
@headers.each_with_index do |header, i|
|
19
25
|
next if header.content.empty?
|
20
26
|
# omit the first H1 (the page title) from the TOC if so configured
|
21
27
|
next if (i == 0 && header.name =~ /[Hh]1/) && @markup.wiki && @markup.wiki.h1_title
|
@@ -59,6 +65,39 @@ class Gollum::Filter::TOC < Gollum::Filter
|
|
59
65
|
|
60
66
|
private
|
61
67
|
|
68
|
+
def headers_selector
|
69
|
+
HEADERS.map { |n| make_header_tag(n) } .join(',')
|
70
|
+
end
|
71
|
+
|
72
|
+
def get_header_level(header)
|
73
|
+
header.name.match(/[Hh]([1-6])/)[1].to_i
|
74
|
+
end
|
75
|
+
|
76
|
+
# Find level as it should be viewed in TOC for each header
|
77
|
+
# and save hash to @header_levels
|
78
|
+
def get_toc_levels
|
79
|
+
stack = []
|
80
|
+
|
81
|
+
@headers.each do |header|
|
82
|
+
cur_level = get_header_level(header)
|
83
|
+
|
84
|
+
loop do
|
85
|
+
prev_level = stack[-1]
|
86
|
+
break if prev_level.nil? || prev_level < cur_level
|
87
|
+
stack.pop
|
88
|
+
end
|
89
|
+
|
90
|
+
stack.push cur_level
|
91
|
+
@headers_levels[header] = stack.size
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Generates header in format "h<level>"
|
96
|
+
def make_header_tag(level)
|
97
|
+
raise "Header should be from 1 to 6" unless level.between?(1, 6)
|
98
|
+
"h#{level}"
|
99
|
+
end
|
100
|
+
|
62
101
|
# Generates the anchor name from the given header element
|
63
102
|
# removing all non alphanumeric characters, replacing them
|
64
103
|
# with single dashes.
|
@@ -100,7 +139,7 @@ class Gollum::Filter::TOC < Gollum::Filter
|
|
100
139
|
@tail ||= @toc_doc.child
|
101
140
|
@tail_level ||= 0
|
102
141
|
|
103
|
-
level = header
|
142
|
+
level = @headers_levels[header]
|
104
143
|
|
105
144
|
if @tail_level < level
|
106
145
|
while @tail_level < level
|
@@ -14,7 +14,7 @@ class Gollum::Filter::YAML < Gollum::Filter
|
|
14
14
|
@markup.metadata.merge!(frontmatter) if frontmatter.respond_to?(:keys) && frontmatter.respond_to?(:values)
|
15
15
|
rescue ::Psych::SyntaxError, ::Psych::DisallowedClass, ::Psych::BadAlias => error
|
16
16
|
@markup.metadata['errors'] ||= []
|
17
|
-
@markup.metadata['errors'] << "Failed to load YAML
|
17
|
+
@markup.metadata['errors'] << "Failed to load YAML frontmatter: #{error.message}"
|
18
18
|
end
|
19
19
|
''
|
20
20
|
end
|
data/lib/gollum-lib/helpers.rb
CHANGED
data/lib/gollum-lib/macro.rb
CHANGED
@@ -25,6 +25,10 @@ module Gollum
|
|
25
25
|
"<p class=\"gollum-error\">#{s}</p>"
|
26
26
|
end
|
27
27
|
|
28
|
+
def active_page
|
29
|
+
return @page.parent_page || @page
|
30
|
+
end
|
31
|
+
|
28
32
|
# The special class we reserve for only the finest of screwups. The
|
29
33
|
# underscore is to make sure nobody can define a real, callable macro
|
30
34
|
# with the same name, because that would be... exciting.
|
@@ -3,7 +3,7 @@ module Gollum
|
|
3
3
|
|
4
4
|
class Series < Gollum::Macro
|
5
5
|
def render(series_prefix = "")
|
6
|
-
raise "This page's name does not match the prefix '#{series_prefix}'" unless
|
6
|
+
raise "This page's name does not match the prefix '#{series_prefix}'" unless active_page.name =~ /^#{series_prefix}/
|
7
7
|
render_links(*find_series(series_prefix))
|
8
8
|
end
|
9
9
|
|
@@ -21,7 +21,7 @@ module Gollum
|
|
21
21
|
dir = @wiki.pages.select {|page| ::File.dirname(page.path) == ::File.dirname(@page.path)}
|
22
22
|
dir.select! {|page| page.name =~ /\A#{series_prefix}/ } unless series_prefix.empty?
|
23
23
|
dir.sort_by! {|page| page.name}
|
24
|
-
self_index = dir.find_index {|page| page.name ==
|
24
|
+
self_index = dir.find_index {|page| page.name == active_page.name}
|
25
25
|
if self_index > 0
|
26
26
|
return dir[self_index-1], dir[self_index+1]
|
27
27
|
else
|
data/lib/gollum-lib/markups.rb
CHANGED
@@ -56,9 +56,9 @@ end
|
|
56
56
|
module Gollum
|
57
57
|
class Markup
|
58
58
|
if gem_exists?('pandoc-ruby')
|
59
|
-
GitHub::Markup::Markdown::MARKDOWN_GEMS.
|
59
|
+
GitHub::Markup::Markdown::MARKDOWN_GEMS.clear
|
60
60
|
GitHub::Markup::Markdown::MARKDOWN_GEMS['pandoc-ruby'] = proc { |content|
|
61
|
-
PandocRuby.convert(content, :from =>
|
61
|
+
PandocRuby.convert(content, '--citeproc', :from => 'markdown-tex_math_dollars-raw_tex', :to => :html)
|
62
62
|
}
|
63
63
|
else
|
64
64
|
GitHub::Markup::Markdown::MARKDOWN_GEMS['kramdown'] = proc { |content|
|
@@ -85,7 +85,8 @@ module Gollum
|
|
85
85
|
:extensions => ['rest', 'rst'])
|
86
86
|
register(:asciidoc, "AsciiDoc",
|
87
87
|
:skip_filters => [:Tags],
|
88
|
-
:enabled => MarkupRegisterUtils::gem_exists?("asciidoctor")
|
88
|
+
:enabled => MarkupRegisterUtils::gem_exists?("asciidoctor"),
|
89
|
+
:extensions => ['adoc','asciidoc'])
|
89
90
|
register(:mediawiki, "MediaWiki",
|
90
91
|
:enabled => MarkupRegisterUtils::gem_exists?("wikicloth"),
|
91
92
|
:extensions => ['mediawiki','wiki'], :reverse_links => true)
|
data/lib/gollum-lib/page.rb
CHANGED
@@ -277,7 +277,7 @@ module Gollum
|
|
277
277
|
#
|
278
278
|
# Returns the String extension (no leading period).
|
279
279
|
def self.format_to_ext(format)
|
280
|
-
format
|
280
|
+
Gollum::Markup.formats[format] ? Gollum::Markup.formats[format][:extensions].first : nil
|
281
281
|
end
|
282
282
|
|
283
283
|
# The underlying wiki repo.
|
@@ -360,7 +360,7 @@ module Gollum
|
|
360
360
|
def initialize(wiki, name, data, version, parent_page = nil)
|
361
361
|
@wiki = wiki
|
362
362
|
@path = name
|
363
|
-
@blob = OpenStruct.new(:name => name, :data => data, :is_symlink => false)
|
363
|
+
@blob = OpenStruct.new(:name => name, :data => wiki.normalize(data), :is_symlink => false)
|
364
364
|
@version = version
|
365
365
|
@formatted_data = nil
|
366
366
|
@doc = nil
|
@@ -368,5 +368,6 @@ module Gollum
|
|
368
368
|
@historical = false
|
369
369
|
end
|
370
370
|
end
|
371
|
+
|
371
372
|
|
372
373
|
end
|
data/lib/gollum-lib/redirects.rb
CHANGED
@@ -28,9 +28,10 @@ module Gollum
|
|
28
28
|
self.clear
|
29
29
|
self.merge!(redirects)
|
30
30
|
end
|
31
|
-
|
32
|
-
def dump
|
33
|
-
|
31
|
+
|
32
|
+
def dump(commit=nil)
|
33
|
+
commit = {} if commit.nil?
|
34
|
+
@wiki.overwrite_file(REDIRECTS_FILE, self.to_yaml, commit)
|
34
35
|
end
|
35
36
|
|
36
37
|
def get_head_sha
|
data/lib/gollum-lib/version.rb
CHANGED
data/lib/gollum-lib/wiki.rb
CHANGED
@@ -150,6 +150,8 @@ module Gollum
|
|
150
150
|
@filter_chain.delete(:Emoji) unless options.fetch :emoji, false
|
151
151
|
@filter_chain.delete(:PandocBib) unless ::Gollum::MarkupRegisterUtils.using_pandoc?
|
152
152
|
@filter_chain.delete(:CriticMarkup) unless options.fetch :critic_markup, false
|
153
|
+
|
154
|
+
Hook.execute(:post_wiki_initialize, self)
|
153
155
|
end
|
154
156
|
|
155
157
|
# Public: check whether the wiki's git repo exists on the filesystem.
|
@@ -551,14 +553,14 @@ module Gollum
|
|
551
553
|
@redirects
|
552
554
|
end
|
553
555
|
|
554
|
-
def add_redirect(old_path, new_path)
|
556
|
+
def add_redirect(old_path, new_path, commit=nil)
|
555
557
|
redirects[old_path] = new_path
|
556
|
-
redirects.dump
|
558
|
+
redirects.dump(commit)
|
557
559
|
end
|
558
560
|
|
559
|
-
def remove_redirect(path)
|
561
|
+
def remove_redirect(path, commit=nil)
|
560
562
|
redirects.tap{|k| k.delete(path)}
|
561
|
-
redirects.dump
|
563
|
+
redirects.dump(commit)
|
562
564
|
end
|
563
565
|
|
564
566
|
#########################################################################
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gollum-lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
8
8
|
- Rick Olson
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
date: 2017-04-13 00:00:00.000000000 Z
|
@@ -15,22 +15,16 @@ dependencies:
|
|
15
15
|
name: gollum-rjgit_adapter
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: 0.5.1
|
21
18
|
- - "~>"
|
22
19
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.
|
20
|
+
version: '0.6'
|
24
21
|
type: :runtime
|
25
22
|
prerelease: false
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
27
24
|
requirements:
|
28
|
-
- - ">="
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: 0.5.1
|
31
25
|
- - "~>"
|
32
26
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
27
|
+
version: '0.6'
|
34
28
|
- !ruby/object:Gem::Dependency
|
35
29
|
name: rouge
|
36
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,14 +73,14 @@ dependencies:
|
|
79
73
|
requirements:
|
80
74
|
- - "~>"
|
81
75
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
76
|
+
version: '4.0'
|
83
77
|
type: :runtime
|
84
78
|
prerelease: false
|
85
79
|
version_requirements: !ruby/object:Gem::Requirement
|
86
80
|
requirements:
|
87
81
|
- - "~>"
|
88
82
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
83
|
+
version: '4.0'
|
90
84
|
- !ruby/object:Gem::Dependency
|
91
85
|
name: gemojione
|
92
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,14 +101,14 @@ dependencies:
|
|
107
101
|
requirements:
|
108
102
|
- - "~>"
|
109
103
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
104
|
+
version: '12.0'
|
111
105
|
type: :runtime
|
112
106
|
prerelease: false
|
113
107
|
version_requirements: !ruby/object:Gem::Requirement
|
114
108
|
requirements:
|
115
109
|
- - "~>"
|
116
110
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
111
|
+
version: '12.0'
|
118
112
|
- !ruby/object:Gem::Dependency
|
119
113
|
name: twitter-text
|
120
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -149,14 +143,14 @@ dependencies:
|
|
149
143
|
requirements:
|
150
144
|
- - "~>"
|
151
145
|
- !ruby/object:Gem::Version
|
152
|
-
version: 2.
|
146
|
+
version: 2.3.0
|
153
147
|
type: :development
|
154
148
|
prerelease: false
|
155
149
|
version_requirements: !ruby/object:Gem::Requirement
|
156
150
|
requirements:
|
157
151
|
- - "~>"
|
158
152
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.
|
153
|
+
version: 2.3.0
|
160
154
|
- !ruby/object:Gem::Dependency
|
161
155
|
name: kramdown-parser-gfm
|
162
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -191,28 +185,28 @@ dependencies:
|
|
191
185
|
requirements:
|
192
186
|
- - "~>"
|
193
187
|
- !ruby/object:Gem::Version
|
194
|
-
version: 1.
|
188
|
+
version: '1.11'
|
195
189
|
type: :development
|
196
190
|
prerelease: false
|
197
191
|
version_requirements: !ruby/object:Gem::Requirement
|
198
192
|
requirements:
|
199
193
|
- - "~>"
|
200
194
|
- !ruby/object:Gem::Version
|
201
|
-
version: 1.
|
195
|
+
version: '1.11'
|
202
196
|
- !ruby/object:Gem::Dependency
|
203
197
|
name: shoulda
|
204
198
|
requirement: !ruby/object:Gem::Requirement
|
205
199
|
requirements:
|
206
200
|
- - "~>"
|
207
201
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
202
|
+
version: '4.0'
|
209
203
|
type: :development
|
210
204
|
prerelease: false
|
211
205
|
version_requirements: !ruby/object:Gem::Requirement
|
212
206
|
requirements:
|
213
207
|
- - "~>"
|
214
208
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
209
|
+
version: '4.0'
|
216
210
|
- !ruby/object:Gem::Dependency
|
217
211
|
name: wikicloth
|
218
212
|
requirement: !ruby/object:Gem::Requirement
|
@@ -233,14 +227,14 @@ dependencies:
|
|
233
227
|
requirements:
|
234
228
|
- - "~>"
|
235
229
|
- !ruby/object:Gem::Version
|
236
|
-
version: '
|
230
|
+
version: '6.0'
|
237
231
|
type: :development
|
238
232
|
prerelease: false
|
239
233
|
version_requirements: !ruby/object:Gem::Requirement
|
240
234
|
requirements:
|
241
235
|
- - "~>"
|
242
236
|
- !ruby/object:Gem::Version
|
243
|
-
version: '
|
237
|
+
version: '6.0'
|
244
238
|
- !ruby/object:Gem::Dependency
|
245
239
|
name: citeproc-ruby
|
246
240
|
requirement: !ruby/object:Gem::Requirement
|
@@ -275,34 +269,28 @@ dependencies:
|
|
275
269
|
requirements:
|
276
270
|
- - "~>"
|
277
271
|
- !ruby/object:Gem::Version
|
278
|
-
version: '
|
279
|
-
- - ">="
|
280
|
-
- !ruby/object:Gem::Version
|
281
|
-
version: 12.3.3
|
272
|
+
version: '13.0'
|
282
273
|
type: :development
|
283
274
|
prerelease: false
|
284
275
|
version_requirements: !ruby/object:Gem::Requirement
|
285
276
|
requirements:
|
286
277
|
- - "~>"
|
287
278
|
- !ruby/object:Gem::Version
|
288
|
-
version: '
|
289
|
-
- - ">="
|
290
|
-
- !ruby/object:Gem::Version
|
291
|
-
version: 12.3.3
|
279
|
+
version: '13.0'
|
292
280
|
- !ruby/object:Gem::Dependency
|
293
281
|
name: pry
|
294
282
|
requirement: !ruby/object:Gem::Requirement
|
295
283
|
requirements:
|
296
284
|
- - "~>"
|
297
285
|
- !ruby/object:Gem::Version
|
298
|
-
version: 0.
|
286
|
+
version: '0.13'
|
299
287
|
type: :development
|
300
288
|
prerelease: false
|
301
289
|
version_requirements: !ruby/object:Gem::Requirement
|
302
290
|
requirements:
|
303
291
|
- - "~>"
|
304
292
|
- !ruby/object:Gem::Version
|
305
|
-
version: 0.
|
293
|
+
version: '0.13'
|
306
294
|
- !ruby/object:Gem::Dependency
|
307
295
|
name: rb-readline
|
308
296
|
requirement: !ruby/object:Gem::Requirement
|
@@ -323,14 +311,14 @@ dependencies:
|
|
323
311
|
requirements:
|
324
312
|
- - "~>"
|
325
313
|
- !ruby/object:Gem::Version
|
326
|
-
version: 3.
|
314
|
+
version: '3.3'
|
327
315
|
type: :development
|
328
316
|
prerelease: false
|
329
317
|
version_requirements: !ruby/object:Gem::Requirement
|
330
318
|
requirements:
|
331
319
|
- - "~>"
|
332
320
|
- !ruby/object:Gem::Version
|
333
|
-
version: 3.
|
321
|
+
version: '3.3'
|
334
322
|
- !ruby/object:Gem::Dependency
|
335
323
|
name: minitest-reporters
|
336
324
|
requirement: !ruby/object:Gem::Requirement
|
@@ -365,84 +353,42 @@ dependencies:
|
|
365
353
|
requirements:
|
366
354
|
- - "~>"
|
367
355
|
- !ruby/object:Gem::Version
|
368
|
-
version: 2.
|
356
|
+
version: '2.16'
|
369
357
|
type: :development
|
370
358
|
prerelease: false
|
371
359
|
version_requirements: !ruby/object:Gem::Requirement
|
372
360
|
requirements:
|
373
361
|
- - "~>"
|
374
362
|
- !ruby/object:Gem::Version
|
375
|
-
version: 2.
|
363
|
+
version: '2.16'
|
376
364
|
- !ruby/object:Gem::Dependency
|
377
365
|
name: guard-minitest
|
378
366
|
requirement: !ruby/object:Gem::Requirement
|
379
367
|
requirements:
|
380
368
|
- - "~>"
|
381
369
|
- !ruby/object:Gem::Version
|
382
|
-
version: 2.
|
383
|
-
type: :development
|
384
|
-
prerelease: false
|
385
|
-
version_requirements: !ruby/object:Gem::Requirement
|
386
|
-
requirements:
|
387
|
-
- - "~>"
|
388
|
-
- !ruby/object:Gem::Version
|
389
|
-
version: 2.3.2
|
390
|
-
- !ruby/object:Gem::Dependency
|
391
|
-
name: rb-inotify
|
392
|
-
requirement: !ruby/object:Gem::Requirement
|
393
|
-
requirements:
|
394
|
-
- - "~>"
|
395
|
-
- !ruby/object:Gem::Version
|
396
|
-
version: 0.9.3
|
397
|
-
type: :development
|
398
|
-
prerelease: false
|
399
|
-
version_requirements: !ruby/object:Gem::Requirement
|
400
|
-
requirements:
|
401
|
-
- - "~>"
|
402
|
-
- !ruby/object:Gem::Version
|
403
|
-
version: 0.9.3
|
404
|
-
- !ruby/object:Gem::Dependency
|
405
|
-
name: rb-fsevent
|
406
|
-
requirement: !ruby/object:Gem::Requirement
|
407
|
-
requirements:
|
408
|
-
- - "~>"
|
409
|
-
- !ruby/object:Gem::Version
|
410
|
-
version: 0.9.4
|
411
|
-
type: :development
|
412
|
-
prerelease: false
|
413
|
-
version_requirements: !ruby/object:Gem::Requirement
|
414
|
-
requirements:
|
415
|
-
- - "~>"
|
416
|
-
- !ruby/object:Gem::Version
|
417
|
-
version: 0.9.4
|
418
|
-
- !ruby/object:Gem::Dependency
|
419
|
-
name: rb-fchange
|
420
|
-
requirement: !ruby/object:Gem::Requirement
|
421
|
-
requirements:
|
422
|
-
- - "~>"
|
423
|
-
- !ruby/object:Gem::Version
|
424
|
-
version: 0.0.6
|
370
|
+
version: '2.4'
|
425
371
|
type: :development
|
426
372
|
prerelease: false
|
427
373
|
version_requirements: !ruby/object:Gem::Requirement
|
428
374
|
requirements:
|
429
375
|
- - "~>"
|
430
376
|
- !ruby/object:Gem::Version
|
431
|
-
version:
|
377
|
+
version: '2.4'
|
432
378
|
- !ruby/object:Gem::Dependency
|
433
379
|
name: twitter_cldr
|
434
380
|
requirement: !ruby/object:Gem::Requirement
|
435
381
|
requirements:
|
436
382
|
- - "~>"
|
437
383
|
- !ruby/object:Gem::Version
|
438
|
-
version:
|
384
|
+
version: '6.4'
|
439
385
|
type: :development
|
440
386
|
prerelease: false
|
441
387
|
version_requirements: !ruby/object:Gem::Requirement
|
442
388
|
requirements:
|
443
389
|
- - "~>"
|
444
390
|
- !ruby/object:Gem::Version
|
445
|
-
version:
|
391
|
+
version: '6.4'
|
446
392
|
description: A simple, Git-powered wiki with a sweet API and local frontend.
|
447
393
|
email: tom@github.com
|
448
394
|
executables: []
|
@@ -506,7 +452,7 @@ homepage: http://github.com/gollum/gollum-lib
|
|
506
452
|
licenses:
|
507
453
|
- MIT
|
508
454
|
metadata: {}
|
509
|
-
post_install_message:
|
455
|
+
post_install_message:
|
510
456
|
rdoc_options:
|
511
457
|
- "--charset=UTF-8"
|
512
458
|
require_paths:
|
@@ -523,7 +469,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
523
469
|
version: '0'
|
524
470
|
requirements: []
|
525
471
|
rubygems_version: 3.0.3
|
526
|
-
signing_key:
|
472
|
+
signing_key:
|
527
473
|
specification_version: 2
|
528
474
|
summary: A simple, Git-powered wiki.
|
529
475
|
test_files: []
|