gollum-rugged_adapter 0.99.6 → 1.1.2

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: b52a878c106ae3c5aee6eb2871ddf060117c6eaaff0a33a101b29704be75e9b9
4
- data.tar.gz: f652fe0afa40f2e2bd93f823d813afe5d4dc218b5f52754c09d3899d715966bd
3
+ metadata.gz: 3b4b572fd56e0608c76ab7b3536ed18a54211571ded4f37dbfe77e296df17bfe
4
+ data.tar.gz: e3f2ab7a9ae0ebe06eaa1983426a9f89f78796e8535cb6373d21499d45914c72
5
5
  SHA512:
6
- metadata.gz: 43e6d20d1c1959208331dd36643e6f2384b72e530fdfc09d13bdffee5ef69734924bd12244f04b2588fc66ab80f33b8aaebe87a039b3001a2e93c6dca3d35d9c
7
- data.tar.gz: 43cb1739e0b909fae184a5857dd7971d0582e9b3a883df7b6fbf49d00edcbca0bc458399f73e94a8984767ea6651abfbaa2e18460a505b33675e979487f73503
6
+ metadata.gz: 4c481c8741c577b5cf0e0af292745c04fea0a32d96f89ed77ddb54db726c510517e35e134ca80ab3ddba8966618814fb1590c590c89e2f453fdab2447a62acba
7
+ data.tar.gz: 8b7cbcc97c857862a2e60ddb9beb7f625d5eb184ca7800189d95400cbe38400511075083f0dbd50bef91bbe21c9f38f1ba1599675d83dbb31fe5e72d2b903545
data/README.md CHANGED
@@ -1,12 +1,10 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/gollum-rugged_adapter.svg)](http://badge.fury.io/rb/gollum-rugged_adapter)
2
- [![Build Status](https://travis-ci.org/gollum/rugged_adapter.svg?branch=master)](https://travis-ci.org/gollum/rugged_adapter)
2
+ ![Build Status](https://github.com/gollum/rugged_adapter/actions/workflows/test.yaml/badge.svg)
3
3
  [![Dependency Status](https://gemnasium.com/gollum/rugged_adapter.svg)](https://gemnasium.com/gollum/rugged_adapter)
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
@@ -173,7 +174,7 @@ module Gollum
173
174
  def grep(search_terms, options={}, &block)
174
175
  ref = options[:ref] ? options[:ref] : "HEAD"
175
176
  tree = @repo.lookup(sha_from_ref(ref)).tree
176
- tree = @repo.lookup(tree[options[:path]][:oid]) if options[:path]
177
+ tree = @repo.lookup(tree.path(options[:path])[:oid]) if options[:path]
177
178
  enc = options.fetch(:encoding, 'utf-8')
178
179
  results = []
179
180
  tree.walk_blobs(:postorder) do |root, entry|
@@ -234,7 +235,7 @@ module Gollum
234
235
  @repo.checkout_head(**options)
235
236
  else
236
237
  ref = "refs/heads/#{ref}" unless ref =~ /^refs\/heads\//
237
- @repo.checkout_tree(sha_from_ref(ref), options)
238
+ @repo.checkout_tree(sha_from_ref(ref), **options)
238
239
  end
239
240
  end
240
241
 
@@ -309,13 +310,13 @@ module Gollum
309
310
 
310
311
  def push(remote, branches = nil, options = {})
311
312
  branches = [branches].flatten.map {|branch| "refs/heads/#{branch}" unless branch =~ /^refs\/heads\//}
312
- @repo.push(remote, branches, options)
313
+ @repo.push(remote, branches, **options)
313
314
  end
314
315
 
315
316
  def pull(remote, branches = nil, options = {})
316
317
  branches = [branches].flatten.map {|branch| "refs/heads/#{branch}" unless branch =~ /^refs\/heads\//}
317
318
  r = @repo.remotes[remote]
318
- r.fetch(branches, options)
319
+ r.fetch(branches, **options)
319
320
  branches.each do |branch|
320
321
  branch_name = branch.match(/^refs\/heads\/(.*)/)[1]
321
322
  remote_name = remote.match(/^(refs\/heads\/)?(.*)/)[2]
@@ -367,7 +368,7 @@ module Gollum
367
368
  # This is a commit we care about, unless we haven't skipped enough
368
369
  # yet
369
370
  skipped += 1
370
-
371
+
371
372
  commits.push(Gollum::Git::Commit.new(c, track_pathnames ? renamed_path : nil)) if skipped > offset
372
373
  renamed_path = current_path.nil? ? nil : current_path.dup
373
374
  end
@@ -489,7 +490,7 @@ module Gollum
489
490
  commit_options[:message] = message.to_s
490
491
  commit_options[:parents] = parents
491
492
  commit_options[:update_ref] = head
492
- Rugged::Commit.create(@rugged_repo, commit_options)
493
+ Rugged::Commit.create(@rugged_repo, **commit_options)
493
494
  end
494
495
 
495
496
  def tree
@@ -614,11 +615,11 @@ module Gollum
614
615
 
615
616
  def diff(sha1, sha2, *paths)
616
617
  opts = paths.nil? ? {} : {:paths => paths}
617
- @repo.diff(sha1, sha2, opts).patch
618
+ @repo.diff(sha1, sha2, opts).patch.force_encoding('utf-8')
618
619
  end
619
620
 
620
621
  def log(commit = 'refs/heads/master', path = nil, options = {})
621
- git.log(commit, path, options)
622
+ git.log(commit, path, **options)
622
623
  end
623
624
 
624
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.6'
4
+ VERSION = '1.1.2'
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.6
4
+ version: 1.1.2
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-04-15 00:00:00.000000000 Z
11
+ date: 2021-11-22 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: []