gitlab-gollum-lib 4.2.7.9 → 4.2.7.10.gitlab.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3740cc515ddd0fb237bd1601a56cc270c3006796d30dbbab427c98c63dd4768b
4
- data.tar.gz: 9bb6911800778235cda3f750b9e453b75c9cbb0242da0b3e32ae060dbf205bb6
3
+ metadata.gz: 290dc5f811afde615e6e474cc94ce18ceda9894027a1398c903589838d6be1e9
4
+ data.tar.gz: 7cd7090ce4112e31c49257f41a7b7aa716c961d6c0dbe361e66b11cca70fa9da
5
5
  SHA512:
6
- metadata.gz: 278c9c92777b62ba843772e352dc9cc49eb5c10c72227492e3118c58bcfcddd12715f54ffe392188f975edb06a743275b09e75cc51b86446fec0cd1b4004b7be
7
- data.tar.gz: 655c25d15ed359668570a39b814a3ef4c1a7ba491eda6401af5bbe7c629f05b79d81ef2020cebb9fd929495b2b8ead8c67f7683cef1f91f28ad3bd36130ec442
6
+ metadata.gz: 0dc9f0e93e93ba8ce81db6cb055b32fc966d4f5ecb51da075a4e7049d9b5b625a71a0afe816e455c6253ea61d09367449ed3c98d025a3289ad1feb483d4daeaf
7
+ data.tar.gz: f11a51d68701ad24b04042fa2eb5a1eefa31bf49a1967597c32be0eccb68ed7562bbb69b880d8773a0062b023a061027d8b17aafe8c90051063039241ea3fb1c
@@ -0,0 +1,14 @@
1
+ v4.2.7.10.gitlab.1
2
+ - Drop JRuby support
3
+ - Upgrade gitlab-gollum-rugged_adapter to support Rugged 1.x
4
+ - Don't expand filesystem paths (backport from https://github.com/gollum/gollum-lib/pull/385)
5
+
6
+ v4.2.7.9
7
+ - Add adoc file support
8
+
9
+ v4.2.7.8
10
+ - Use rugged adapter
11
+ - Don't sanitize page titles
12
+
13
+ v1.1.0
14
+ - Removed pygments.rb dependency
data/README.md CHANGED
@@ -1,10 +1,14 @@
1
- gollum lib -- A wiki built on top of Git [![build status](https://ci.gitlab.org/projects/7/status.png?ref=master)](https://ci.gitlab.org/projects/7?ref=master)
1
+ gollum lib -- A wiki built on top of Git.
2
+
2
3
  ========================================
3
4
 
4
5
  [![pipeline status](https://gitlab.com/gitlab-org/gollum-lib/badges/master/pipeline.svg)](https://gitlab.com/gitlab-org/gollum-lib/-/commits/master)
5
- [![Gem Version](https://badge.fury.io/rb/gollum-lib.svg)](http://badge.fury.io/rb/gollum-lib)
6
- [![Build Status](https://travis-ci.org/gollum/gollum-lib.svg?branch=master)](https://travis-ci.org/gollum/gollum-lib)
7
- [![Dependency Status](https://gemnasium.com/gollum/gollum-lib.svg)](https://gemnasium.com/gollum/gollum-lib)
6
+ [![Gem Version](https://badge.fury.io/rb/gitlab-gollum-lib.svg)](http://badge.fury.io/rb/gitlab-gollum-lib)
7
+
8
+ ## This is a fork
9
+
10
+ It is made for the GitLab application and used in the [Gitaly](https://gitlab.com/gitlab-org/gitaly) project.
11
+ For use outside of GitLab, refer to the upstream [`gollum-lib`](https://github.com/gollum/gollum-lib) gem.
8
12
 
9
13
  ## DESCRIPTION
10
14
 
@@ -20,17 +24,17 @@ Gollum-lib follows the rules of [Semantic Versioning](http://semver.org/) and us
20
24
 
21
25
  ## SYSTEM REQUIREMENTS
22
26
 
23
- - Ruby 1.9.3+ (>2.0 recommended)
27
+ - Ruby 2.4+
24
28
  - Unix like operating system (OS X, Ubuntu, Debian, and more)
25
- - By default the [Rugged adapter](https://gitlab.com/gitlab-org/gitlab-gollum-rugged_adapter) is used for MRI, and [RJGit](https://github.com/gollum/rjgit_adapter) for JRuby.
26
- - Will not work on Windows with the [grit](https://github.com/github/grit) adapter, but might work via JRuby (please let us know!)
29
+ - By default the [Rugged adapter](https://gitlab.com/gitlab-org/gitlab-gollum-rugged_adapter) is used for MRI.
30
+ - Will not work on Windows.
27
31
 
28
32
  ## INSTALLATION
29
33
 
30
34
  The best way to install Gollum-lib is with RubyGems:
31
35
 
32
36
  ```bash
33
- $ [sudo] gem install gollum-lib
37
+ $ [sudo] gem install gitlab-gollum-lib
34
38
  ```
35
39
 
36
40
  If you're installing from source, you can use [Bundler][bundler] to pick up all the
data/Rakefile CHANGED
@@ -51,11 +51,11 @@ def gemspec_file
51
51
  end
52
52
 
53
53
  def gemspecs
54
- ["#{name}.gemspec", "#{name}_java.gemspec"]
54
+ ["#{name}.gemspec"]
55
55
  end
56
56
 
57
57
  def gem_files
58
- ["#{name}-#{version}.gem", "#{name}-#{version}-java.gem"]
58
+ ["#{name}-#{version}.gem"]
59
59
  end
60
60
 
61
61
  def replace_header(head, header_name)
@@ -128,7 +128,6 @@ task :release => :build do
128
128
  sh "git push origin master"
129
129
  sh "git push origin v#{version}"
130
130
  sh "gem push pkg/#{name}-#{version}.gem"
131
- sh "gem push pkg/#{name}-#{version}-java.gem"
132
131
  end
133
132
 
134
133
  desc 'Publish to rubygems. Same as release'
data/gemspec.rb CHANGED
@@ -57,55 +57,54 @@ def specification(version, default_adapter, platform = nil)
57
57
  s.add_development_dependency 'rb-fsevent', '~> 0.9.4'
58
58
  s.add_development_dependency 'rb-fchange', '~> 0.0.6'
59
59
  s.add_development_dependency 'twitter_cldr', '~> 3.1.0'
60
- # = MANIFEST =
61
- s.files = %w(
62
- Gemfile
63
- HISTORY.md
64
- LICENSE
65
- README.md
66
- Rakefile
67
- docs/sanitization.md
68
- gemspec.rb
69
- gollum-lib.gemspec
70
- gollum-lib_java.gemspec
71
- lib/gollum-lib.rb
72
- lib/gollum-lib/blob_entry.rb
73
- lib/gollum-lib/committer.rb
74
- lib/gollum-lib/file.rb
75
- lib/gollum-lib/file_view.rb
76
- lib/gollum-lib/filter.rb
77
- lib/gollum-lib/filter/code.rb
78
- lib/gollum-lib/filter/emoji.rb
79
- lib/gollum-lib/filter/macro.rb
80
- lib/gollum-lib/filter/metadata.rb
81
- lib/gollum-lib/filter/plain_text.rb
82
- lib/gollum-lib/filter/plantuml.rb
83
- lib/gollum-lib/filter/remote_code.rb
84
- lib/gollum-lib/filter/render.rb
85
- lib/gollum-lib/filter/sanitize.rb
86
- lib/gollum-lib/filter/tags.rb
87
- lib/gollum-lib/filter/toc.rb
88
- lib/gollum-lib/filter/wsd.rb
89
- lib/gollum-lib/sorters/wiki_sorter.rb
90
- lib/gollum-lib/git_access.rb
91
- lib/gollum-lib/gitcode.rb
92
- lib/gollum-lib/helpers.rb
93
- lib/gollum-lib/hook.rb
94
- lib/gollum-lib/macro.rb
95
- lib/gollum-lib/macro/all_pages.rb
96
- lib/gollum-lib/macro/global_toc.rb
97
- lib/gollum-lib/macro/navigation.rb
98
- lib/gollum-lib/macro/series.rb
99
- lib/gollum-lib/markup.rb
100
- lib/gollum-lib/markups.rb
101
- lib/gollum-lib/page.rb
102
- lib/gollum-lib/pagination.rb
103
- lib/gollum-lib/sanitization.rb
104
- lib/gollum-lib/version.rb
105
- lib/gollum-lib/wiki.rb
106
- licenses/licenses.txt
107
- )
108
- # = MANIFEST =
60
+
61
+ s.files = %w(
62
+ Gemfile
63
+ HISTORY.md
64
+ CHANGELOG
65
+ LICENSE
66
+ README.md
67
+ Rakefile
68
+ docs/sanitization.md
69
+ gemspec.rb
70
+ gollum-lib.gemspec
71
+ lib/gollum-lib.rb
72
+ lib/gollum-lib/blob_entry.rb
73
+ lib/gollum-lib/committer.rb
74
+ lib/gollum-lib/file.rb
75
+ lib/gollum-lib/file_view.rb
76
+ lib/gollum-lib/filter.rb
77
+ lib/gollum-lib/filter/code.rb
78
+ lib/gollum-lib/filter/emoji.rb
79
+ lib/gollum-lib/filter/macro.rb
80
+ lib/gollum-lib/filter/metadata.rb
81
+ lib/gollum-lib/filter/plain_text.rb
82
+ lib/gollum-lib/filter/plantuml.rb
83
+ lib/gollum-lib/filter/remote_code.rb
84
+ lib/gollum-lib/filter/render.rb
85
+ lib/gollum-lib/filter/sanitize.rb
86
+ lib/gollum-lib/filter/tags.rb
87
+ lib/gollum-lib/filter/toc.rb
88
+ lib/gollum-lib/filter/wsd.rb
89
+ lib/gollum-lib/sorters/wiki_sorter.rb
90
+ lib/gollum-lib/git_access.rb
91
+ lib/gollum-lib/gitcode.rb
92
+ lib/gollum-lib/helpers.rb
93
+ lib/gollum-lib/hook.rb
94
+ lib/gollum-lib/macro.rb
95
+ lib/gollum-lib/macro/all_pages.rb
96
+ lib/gollum-lib/macro/global_toc.rb
97
+ lib/gollum-lib/macro/navigation.rb
98
+ lib/gollum-lib/macro/series.rb
99
+ lib/gollum-lib/markup.rb
100
+ lib/gollum-lib/markups.rb
101
+ lib/gollum-lib/page.rb
102
+ lib/gollum-lib/pagination.rb
103
+ lib/gollum-lib/sanitization.rb
104
+ lib/gollum-lib/version.rb
105
+ lib/gollum-lib/wiki.rb
106
+ licenses/licenses.txt
107
+ )
109
108
 
110
109
  s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
111
110
  end
@@ -1,10 +1,10 @@
1
1
  require File.join(File.dirname(__FILE__), 'gemspec.rb')
2
2
  require File.join(File.dirname(__FILE__), 'lib', 'gollum-lib', 'version.rb')
3
- if RUBY_PLATFORM == 'java' then
4
- default_adapter = ['gollum-rjgit_adapter', '~> 0.3']
5
- elsif ENV['GOLLUM_ADAPTER'] == 'grit'
6
- default_adapter = ['gollum-grit_adapter', '~> 1.0']
7
- else
8
- default_adapter = ['gitlab-gollum-rugged_adapter', '~> 0.4.4.2']
9
- end
3
+
4
+ if ENV['GOLLUM_ADAPTER'] == 'grit'
5
+ default_adapter = ['gollum-grit_adapter', '~> 1.0']
6
+ else
7
+ default_adapter = ['gitlab-gollum-rugged_adapter', '~> 0.4.4.3.gitlab.1']
8
+ end
9
+
10
10
  Gem::Specification.new &specification(Gollum::Lib::VERSION, default_adapter)
@@ -5,13 +5,11 @@ require 'digest/sha1'
5
5
  require 'ostruct'
6
6
  require 'pathname'
7
7
 
8
- DEFAULT_ADAPTER = if RUBY_PLATFORM == 'java'
9
- 'rjgit_adapter'
10
- elsif ENV['GOLLUM_ADAPTER'] == 'grit'
11
- 'grit_adapter'
12
- else
13
- 'rugged_adapter'
14
- end
8
+ DEFAULT_ADAPTER = if ENV['GOLLUM_ADAPTER'] == 'grit'
9
+ 'grit_adapter'
10
+ else
11
+ 'rugged_adapter'
12
+ end
15
13
 
16
14
  if defined?(Gollum::GIT_ADAPTER)
17
15
  require "#{Gollum::GIT_ADAPTER.downcase}_adapter"
@@ -84,12 +84,22 @@ module Gollum
84
84
  # Returns a normalized String directory name, or nil if no directory
85
85
  # is given.
86
86
  def self.normalize_dir(dir)
87
- return '' if dir =~ /^.:\/$/
88
- if dir
89
- dir = ::File.expand_path(dir, '/')
90
- dir = dir[2..-1] if dir =~ /^[a-zA-Z]:\// # expand_path may add d:/ on windows
91
- dir = '' if dir == '/'
92
- end
87
+ return unless dir
88
+
89
+ dir = dir.dup
90
+
91
+ # Remove '.' and '..' path segments
92
+ dir.gsub!(%r{(\A|/)\.{1,2}(/|\z)}, '/')
93
+
94
+ # Remove repeated slashes
95
+ dir.gsub!(%r{//+}, '/')
96
+
97
+ # Remove Windows drive letters, trailing slashes, and keep one leading slash
98
+ dir.sub!(%r{\A([a-z]:)?/*(.*?)/*\z}i, '/\2')
99
+
100
+ # Return empty string for paths that point to the toplevel
101
+ return '' if dir == '/'
102
+
93
103
  dir
94
104
  end
95
105
  end
@@ -113,7 +113,7 @@ module Gollum
113
113
  return false if commit.sha != @wiki.repo.head.commit.sha
114
114
 
115
115
  # This will try to resolve symbolic links, as well
116
- pathname = Pathname.new(::File.expand_path(::File.join(@wiki.repo.path, '..', name)))
116
+ pathname = Pathname.new(::File.join(@wiki.repo.path, '..', BlobEntry.normalize_dir(name)))
117
117
  if pathname.symlink?
118
118
  source = ::File.readlink(pathname.to_path)
119
119
  realpath = ::File.join(::File.dirname(pathname.to_path), source)
@@ -1,5 +1,5 @@
1
1
  module Gollum
2
2
  module Lib
3
- VERSION = '4.2.7.9'
3
+ VERSION = '4.2.7.10.gitlab.1'
4
4
  end
5
5
  end
@@ -534,81 +534,6 @@ module Gollum
534
534
  multi_commit ? committer : committer.commit
535
535
  end
536
536
 
537
- # Public: Applies a reverse diff for a given page. If only 1 SHA is given,
538
- # the reverse diff will be taken from its parent (^SHA...SHA). If two SHAs
539
- # are given, the reverse diff is taken from SHA1...SHA2.
540
- #
541
- # page - The Gollum::Page to delete.
542
- # sha1 - String SHA1 of the earlier parent if two SHAs are given,
543
- # or the child.
544
- # sha2 - Optional String SHA1 of the child.
545
- # commit - The commit Hash details:
546
- # :message - The String commit message.
547
- # :name - The String author full name.
548
- # :email - The String email address.
549
- # :parent - Optional Gollum::Git::Commit parent to this update.
550
- #
551
- # Returns a String SHA1 of the new commit, or nil if the reverse diff does
552
- # not apply.
553
- def revert_page(page, sha1, sha2 = nil, commit = {})
554
- if sha2.is_a?(Hash)
555
- commit = sha2
556
- sha2 = nil
557
- end
558
-
559
- patch = full_reverse_diff_for(page, sha1, sha2)
560
- committer = Committer.new(self, commit)
561
- parent = committer.parents[0]
562
- committer.options[:tree] = @repo.git.apply_patch(parent.sha, patch)
563
- return false unless committer.options[:tree]
564
- committer.after_commit do |index, _sha|
565
- @access.refresh
566
-
567
- files = []
568
- if page
569
- files << [page.path, page.filename_stripped, page.format]
570
- else
571
- # Grit::Diff can't parse reverse diffs.... yet
572
- patch.each_line do |line|
573
- if line =~ %r(^diff --git b/.+? a/(.+)$)
574
- path = Regexp.last_match[1]
575
- ext = ::File.extname(path)
576
- name = ::File.basename(path, ext)
577
- if (format = ::Gollum::Page.format_for(ext))
578
- files << [path, name, format]
579
- end
580
- end
581
- end
582
- end
583
-
584
- files.each do |(path, name, format)|
585
- dir = ::File.dirname(path)
586
- dir = '' if dir == '.'
587
- index.update_working_dir(dir, name, format)
588
- end
589
- end
590
-
591
- committer.commit
592
- end
593
-
594
- # Public: Applies a reverse diff to the repo. If only 1 SHA is given,
595
- # the reverse diff will be taken from its parent (^SHA...SHA). If two SHAs
596
- # are given, the reverse diff is taken from SHA1...SHA2.
597
- #
598
- # sha1 - String SHA1 of the earlier parent if two SHAs are given,
599
- # or the child.
600
- # sha2 - Optional String SHA1 of the child.
601
- # commit - The commit Hash details:
602
- # :message - The String commit message.
603
- # :name - The String author full name.
604
- # :email - The String email address.
605
- #
606
- # Returns a String SHA1 of the new commit, or nil if the reverse diff does
607
- # not apply.
608
- def revert_commit(sha1, sha2 = nil, commit = {})
609
- revert_page(nil, sha1, sha2, commit)
610
- end
611
-
612
537
  # Public: Lists all pages for this wiki.
613
538
  #
614
539
  # treeish - The String commit ID or ref to find (default: @ref)
@@ -905,34 +830,6 @@ module Gollum
905
830
  end
906
831
  end
907
832
 
908
- # Creates a reverse diff for the given SHAs on the given Gollum::Page.
909
- #
910
- # page - The Gollum::Page to scope the patch to, or a String Path.
911
- # sha1 - String SHA1 of the earlier parent if two SHAs are given,
912
- # or the child.
913
- # sha2 - Optional String SHA1 of the child.
914
- #
915
- # Returns a String of the reverse Diff to apply.
916
- def full_reverse_diff_for(page, sha1, sha2 = nil)
917
- sha1, sha2 = "#{sha1}^", sha1 if sha2.nil?
918
- if page
919
- path = (page.respond_to?(:path) ? page.path : page.to_s)
920
- return repo.diff(sha2, sha1, path).first.diff
921
- end
922
- repo.diff(sha2, sha1).map { |d| d.diff }.join("\n")
923
- end
924
-
925
- # Creates a reverse diff for the given SHAs.
926
- #
927
- # sha1 - String SHA1 of the earlier parent if two SHAs are given,
928
- # or the child.
929
- # sha2 - Optional String SHA1 of the child.
930
- #
931
- # Returns a String of the reverse Diff to apply.
932
- def full_reverse_diff(sha1, sha2 = nil)
933
- full_reverse_diff_for(nil, sha1, sha2)
934
- end
935
-
936
833
  # Gets the default name for commits.
937
834
  #
938
835
  # Returns the String name.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-gollum-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.7.9
4
+ version: 4.2.7.10.gitlab.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-05-13 00:00:00.000000000 Z
12
+ date: 2020-10-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gitlab-gollum-rugged_adapter
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 0.4.4.2
20
+ version: 0.4.4.3.gitlab.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 0.4.4.2
27
+ version: 0.4.4.3.gitlab.1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rouge
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -375,6 +375,7 @@ extra_rdoc_files:
375
375
  - README.md
376
376
  - LICENSE
377
377
  files:
378
+ - CHANGELOG
378
379
  - Gemfile
379
380
  - HISTORY.md
380
381
  - LICENSE
@@ -383,7 +384,6 @@ files:
383
384
  - docs/sanitization.md
384
385
  - gemspec.rb
385
386
  - gollum-lib.gemspec
386
- - gollum-lib_java.gemspec
387
387
  - lib/gollum-lib.rb
388
388
  - lib/gollum-lib/blob_entry.rb
389
389
  - lib/gollum-lib/committer.rb
@@ -436,11 +436,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
436
436
  version: '1.9'
437
437
  required_rubygems_version: !ruby/object:Gem::Requirement
438
438
  requirements:
439
- - - ">="
439
+ - - ">"
440
440
  - !ruby/object:Gem::Version
441
- version: '0'
441
+ version: 1.3.1
442
442
  requirements: []
443
- rubygems_version: 3.0.8
443
+ rubygems_version: 3.1.4
444
444
  signing_key:
445
445
  specification_version: 2
446
446
  summary: A simple, Git-powered wiki.
@@ -1,4 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'gemspec.rb')
2
- require File.join(File.dirname(__FILE__), 'lib', 'gollum-lib', 'version.rb')
3
- default_adapter = ['gollum-rjgit_adapter', '~> 0.3']
4
- Gem::Specification.new &specification(Gollum::Lib::VERSION, default_adapter, "java")