gollum-lib 5.0.5-java → 5.0.6-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gemspec.rb +1 -1
- data/lib/gollum-lib/blob_entry.rb +16 -6
- data/lib/gollum-lib/file.rb +1 -1
- data/lib/gollum-lib/filter/yaml.rb +1 -1
- data/lib/gollum-lib/markups.rb +1 -1
- data/lib/gollum-lib/page.rb +2 -1
- data/lib/gollum-lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e08f233796cb452691f39d50029ea10100088f520ca413cd656f81ae3c586edc
|
4
|
+
data.tar.gz: 6819382931ebd534d6b698bb733f251b4b7df7c1bc6475dd8130aadf75402971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '058703fd1e3240e66ea9039548fb32e051c881fbb549b1f2a0f5ad1b7f45b9608f172991c7a3ddd1edd64744a051b7da189f5777407aa8d383db51a51173da22'
|
7
|
+
data.tar.gz: 2a82c3024a8c0365089e588be77e0efcc73a8406d9882095788e8937f3e281249007b6c7f4dee9c754ae244d19d2394243b856536c4abf63d5af535911fd83b8
|
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 = '2020-
|
11
|
+
s.date = '2020-09-23'
|
12
12
|
s.date = '2017-04-13'
|
13
13
|
s.rubyforge_project = 'gollum-lib'
|
14
14
|
s.license = 'MIT'
|
@@ -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/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,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/markups.rb
CHANGED
@@ -56,7 +56,7 @@ 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
61
|
PandocRuby.convert(content, :from => 'markdown-tex_math_dollars-raw_tex', :to => :html, :filter => 'pandoc-citeproc')
|
62
62
|
}
|
data/lib/gollum-lib/page.rb
CHANGED
@@ -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/version.rb
CHANGED