gollum-lib 5.0.5-java → 5.0.6-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58d6a76ac3ff4e944c5954024fe52ba50cf208f86c9623131bb3aac6011c8540
4
- data.tar.gz: 59b0439f772973507254aaa566e134984c5c1761f7242b4c09c9ef3fe9e34aab
3
+ metadata.gz: e08f233796cb452691f39d50029ea10100088f520ca413cd656f81ae3c586edc
4
+ data.tar.gz: 6819382931ebd534d6b698bb733f251b4b7df7c1bc6475dd8130aadf75402971
5
5
  SHA512:
6
- metadata.gz: 047b9eae8522314a1cd2300fb6eacfa58376595a0ed84c514b35d0a1a61f16625bf12793f47b76339a328ae57add678b0829265086352de3d0cde285030131fc
7
- data.tar.gz: 9ab4e40babd84d9baa3041e7212431fb05a95855dd428964e4d5467ebebd75b2405a1a7fbbb038a5ab8ca0ae14401f172eaf2f6f0e6fd8f510358e7b0f5cbb3c
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-08-03'
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 '' if dir =~ /^.:\/$/
82
- if dir
83
- dir = ::File.expand_path(dir, '/')
84
- dir = dir[2..-1] if dir =~ /^[a-zA-Z]:\// # expand_path may add d:/ on windows
85
- dir = '' if dir == '/'
86
- end
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
@@ -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.expand_path(::File.join(@wiki.repo.path, '..', @path)))
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 frontmater: #{error.message}"
17
+ @markup.metadata['errors'] << "Failed to load YAML frontmatter: #{error.message}"
18
18
  end
19
19
  ''
20
20
  end
@@ -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.delete('kramdown')
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
  }
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Gollum
2
2
  module Lib
3
- VERSION = '5.0.5'
3
+ VERSION = '5.0.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.5
4
+ version: 5.0.6
5
5
  platform: java
6
6
  authors:
7
7
  - Tom Preston-Werner