gollum-rugged_adapter 0.99.4 → 1.1.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: e26a1062990e5dae1e42c6f0b55b964b5bc39246fc45ba091556cf3638e35fa6
4
- data.tar.gz: 6b7163ae78eb0fd4db16a185994116532da4887bd3d8c5da023f6f27e5d1406c
3
+ metadata.gz: e30b044f09b8b22f7616816d30ae2ad30397e45537df0c256fdd5e85f4f186ab
4
+ data.tar.gz: 2ec6f1bddc5d186160dde25cfc03a45182d779bed3bf026eeb414008255c4ea5
5
5
  SHA512:
6
- metadata.gz: 184dcbda389bd30dd6548f1d66927c6805cea668b50bf545eff349ea474823f0b6408703005c1748a885049bf0e1d3c49686711913817dbd1044b6fcec931929
7
- data.tar.gz: fa41ab8888be111f340362fb7c4bc09d3cfb8f270cc84f967570d0557fc6e1f2a605ebe9801d019c6ac6a93d4e39bc2c167d2909497b45ef13d5c80354120100
6
+ metadata.gz: 75c2a499064d67e007d0e970831fe317c457e9b25d6cfc1958a984faf13ff19ce8bee9292830e65395d183d91fdd09dbfb680c63b00ec688a0a011baeb489acb
7
+ data.tar.gz: 7d74de8e8eae9b1f606c73330324fdd5026d34cc4be7ab12cf1da34defaabbfa2b09ed8a666c9a35708366a4e09eb05325b37689fd5726c02926944fed910644
data/README.md CHANGED
@@ -4,9 +4,7 @@
4
4
 
5
5
  ## DESCRIPTION
6
6
 
7
- Adapter for [gollum](https://github.com/gollum/gollum) to use [Rugged](https://github.com/libgit2/rugged) (libgit2) at the backend. See the [gollum wiki](https://github.com/gollum/gollum/wiki/Git-adapters) for more information on adapters. Currently gollum uses grit as a backend by default, but since that is abandonware, the plan is to make this adapter the default in the future.
8
-
9
- **Please note that this adapter is currently in beta. It passes the unit tests for gollum and [gollum-lib](https://github.com/gollum/gollum-lib), but it needs more comprehensive testing. Please [report any issues](https://github.com/gollum/rugged_adapter/issues) that you encounter.**
7
+ Adapter for [gollum](https://github.com/gollum/gollum) to use [Rugged](https://github.com/libgit2/rugged) (libgit2) at the backend. See the [gollum wiki](https://github.com/gollum/gollum/wiki/Git-adapters) for more information on adapters. Currently this is the default adapter for gollum.
10
8
 
11
9
  ## USAGE
12
10
 
@@ -19,15 +19,16 @@ module Gollum
19
19
 
20
20
  class Actor
21
21
 
22
- attr_accessor :name, :email
22
+ attr_accessor :name, :email, :time
23
23
 
24
24
  def self.default_actor
25
25
  self.new("Gollum", "Gollum@wiki")
26
26
  end
27
27
 
28
- def initialize(name, email)
28
+ def initialize(name, email, time = nil)
29
29
  @name = name
30
30
  @email = email
31
+ @time = time
31
32
  end
32
33
 
33
34
  def output(time)
@@ -42,7 +43,7 @@ module Gollum
42
43
  end
43
44
 
44
45
  def to_h
45
- {:name => @name, :email => @email}
46
+ {:name => @name, :email => @email, :time => @time}
46
47
  end
47
48
 
48
49
  end
@@ -126,6 +127,10 @@ module Gollum
126
127
  @stats ||= build_stats
127
128
  end
128
129
 
130
+ def parent
131
+ @commit.parents.empty? ? nil : Gollum::Git::Commit.new(@commit.parents.first)
132
+ end
133
+
129
134
  private
130
135
 
131
136
  def build_stats
@@ -227,10 +232,10 @@ module Gollum
227
232
  path = path.nil? ? path : [path]
228
233
  options = options.merge({:paths => path, :strategy => :force})
229
234
  if ref == 'HEAD'
230
- @repo.checkout_head(options)
235
+ @repo.checkout_head(**options)
231
236
  else
232
237
  ref = "refs/heads/#{ref}" unless ref =~ /^refs\/heads\//
233
- @repo.checkout_tree(sha_from_ref(ref), options)
238
+ @repo.checkout_tree(sha_from_ref(ref), **options)
234
239
  end
235
240
  end
236
241
 
@@ -305,13 +310,13 @@ module Gollum
305
310
 
306
311
  def push(remote, branches = nil, options = {})
307
312
  branches = [branches].flatten.map {|branch| "refs/heads/#{branch}" unless branch =~ /^refs\/heads\//}
308
- @repo.push(remote, branches, options)
313
+ @repo.push(remote, branches, **options)
309
314
  end
310
315
 
311
316
  def pull(remote, branches = nil, options = {})
312
317
  branches = [branches].flatten.map {|branch| "refs/heads/#{branch}" unless branch =~ /^refs\/heads\//}
313
318
  r = @repo.remotes[remote]
314
- r.fetch(branches, options)
319
+ r.fetch(branches, **options)
315
320
  branches.each do |branch|
316
321
  branch_name = branch.match(/^refs\/heads\/(.*)/)[1]
317
322
  remote_name = remote.match(/^(refs\/heads\/)?(.*)/)[2]
@@ -363,7 +368,7 @@ module Gollum
363
368
  # This is a commit we care about, unless we haven't skipped enough
364
369
  # yet
365
370
  skipped += 1
366
-
371
+
367
372
  commits.push(Gollum::Git::Commit.new(c, track_pathnames ? renamed_path : nil)) if skipped > offset
368
373
  renamed_path = current_path.nil? ? nil : current_path.dup
369
374
  end
@@ -485,7 +490,7 @@ module Gollum
485
490
  commit_options[:message] = message.to_s
486
491
  commit_options[:parents] = parents
487
492
  commit_options[:update_ref] = head
488
- Rugged::Commit.create(@rugged_repo, commit_options)
493
+ Rugged::Commit.create(@rugged_repo, **commit_options)
489
494
  end
490
495
 
491
496
  def tree
@@ -559,7 +564,7 @@ module Gollum
559
564
  class Repo
560
565
 
561
566
  def initialize(path, options)
562
- @repo = Rugged::Repository.new(path, options)
567
+ @repo = Rugged::Repository.new(path, **options)
563
568
  end
564
569
 
565
570
  def self.init(path)
@@ -610,11 +615,11 @@ module Gollum
610
615
 
611
616
  def diff(sha1, sha2, *paths)
612
617
  opts = paths.nil? ? {} : {:paths => paths}
613
- @repo.diff(sha1, sha2, opts).patch
618
+ @repo.diff(sha1, sha2, opts).patch.force_encoding('utf-8')
614
619
  end
615
620
 
616
621
  def log(commit = 'refs/heads/master', path = nil, options = {})
617
- git.log(commit, path, options)
622
+ git.log(commit, path, **options)
618
623
  end
619
624
 
620
625
  def lstree(sha, options = {})
@@ -1,7 +1,7 @@
1
1
  module Gollum
2
2
  module Lib
3
3
  module Git
4
- VERSION = '0.99.4'
4
+ VERSION = '1.1.1'
5
5
  end
6
6
  end
7
7
  end
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  s.description = %q{Adapter for Gollum to use Rugged (libgit2) at the backend.}
14
14
  s.license = "MIT"
15
15
 
16
- s.add_runtime_dependency 'rugged', '~> 0.99'
17
- s.add_runtime_dependency 'mime-types', '>= 1.15'
16
+ s.add_runtime_dependency 'rugged', '~> 1.1.0'
17
+ s.add_runtime_dependency 'mime-types', '~> 1.15'
18
18
  s.add_development_dependency 'rspec', "3.4.0"
19
19
 
20
20
  s.files = Dir['lib/**/*.rb'] + ["README.md", "Gemfile"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum-rugged_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.99.4
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Kamphorst, Dawa Ometto
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-15 00:00:00.000000000 Z
11
+ date: 2021-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged
@@ -16,26 +16,26 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.99'
19
+ version: 1.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.99'
26
+ version: 1.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mime-types
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.15'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.15'
41
41
  - !ruby/object:Gem::Dependency
@@ -71,7 +71,7 @@ homepage: https://github.com/gollum/rugged_adapter
71
71
  licenses:
72
72
  - MIT
73
73
  metadata: {}
74
- post_install_message:
74
+ post_install_message:
75
75
  rdoc_options: []
76
76
  require_paths:
77
77
  - lib
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubygems_version: 3.0.3
90
- signing_key:
90
+ signing_key:
91
91
  specification_version: 4
92
92
  summary: Adapter for Gollum to use Rugged (libgit2) at the backend.
93
93
  test_files: []