gollum-rugged_adapter 2.1.0 → 3.0

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: 18259a2992e32502c42836d608a0339a0e0f4e5555aca0a36cba02cc2894ffd5
4
- data.tar.gz: a0f13307e539bfd3cddc2053fc569ac334feec99b86c58ce592569001632be05
3
+ metadata.gz: 5a7a4dc762df0ff1cb91195f8be624c1516945b5ed1d37271aa9791b609158cf
4
+ data.tar.gz: e167a14946f31bd07d751ae9dfb7bd5bf210beebb0cc69bf27d2179694c407bf
5
5
  SHA512:
6
- metadata.gz: 5e09da620ba3f9cfdecdb85b00e68fef221209896d9a12a297f6d7e956e9d12bdf719ba88a1b2a2375f03ce1b291956fbf0f76e24f656706eaaaeec5f0bae34a
7
- data.tar.gz: f8b75d0f80ed360fc6bd14a1e0eb2d9c2e258b0b83460caf73cc0ee039a2c7077b2be3c0919182f6c2ded4ccd105b33262943764aa7d953b5bcb9113d64f8f61
6
+ metadata.gz: c32be19c86ab9f0480ebf4786fcefa8ccf6b83af86a02127feaa130595203bc616ec08980bf8ea77d91d948300e2021942b5777cb5b4b627f00a51eb932d18f7
7
+ data.tar.gz: 737583e56222388d0a4657190636c2d37fb6a42ee2caa147c45b743949e27ebf45468671f9f99cd611360efb1624dcc883630248105619b8498ca83386e3ebff
data/Rakefile CHANGED
@@ -90,7 +90,7 @@ task :release => :build do
90
90
  Rake::Task[:changelog].execute
91
91
  sh "git commit --allow-empty -a -m 'Release #{version}'"
92
92
  sh "git pull --rebase origin master"
93
- sh "git tag v#{version}"
93
+ sh "git tag v#{version} -m 'Release v#{version}'"
94
94
  sh "git push origin master"
95
95
  sh "git push origin v#{version}"
96
96
  sh "gem push pkg/#{gem_file}"
@@ -179,4 +179,4 @@ task :changelog do
179
179
  temp.close
180
180
  `cat #{history_file} >> #{temp.path}`
181
181
  `cat #{temp.path} > #{history_file}`
182
- end
182
+ end
@@ -654,11 +654,7 @@ module Gollum
654
654
  def lstree(sha, options = {})
655
655
  results = []
656
656
  @repo.lookup(sha).tree.walk(:postorder) do |root, entry|
657
- entry[:sha] = entry[:oid]
658
- entry[:mode] = entry[:filemode].to_s(8)
659
- entry[:type] = entry[:type].to_s
660
- entry[:path] = "#{root}#{entry[:name]}"
661
- results << entry
657
+ results << ::Gollum::Git::Tree.tree_entry_from_rugged_hash(entry, root)
662
658
  end
663
659
  results
664
660
  end
@@ -689,6 +685,16 @@ module Gollum
689
685
 
690
686
  class Tree
691
687
 
688
+ def self.tree_entry_from_rugged_hash(entry, root = '')
689
+ {
690
+ sha: entry[:oid],
691
+ mode: entry[:filemode],
692
+ type: entry[:type].to_s,
693
+ name: entry[:name],
694
+ path: "#{root}#{entry[:name]}"
695
+ }
696
+ end
697
+
692
698
  def initialize(tree)
693
699
  @tree = tree
694
700
  end
@@ -719,10 +725,22 @@ module Gollum
719
725
 
720
726
  def blobs
721
727
  blobs = []
722
- @tree.each_blob {|blob| blobs << Gollum::Git::Blob.new(@tree.owner.lookup(blob[:oid]), blob) }
728
+ @tree.each_blob {|blob| blobs << blob_for_tree_entry(blob) }
723
729
  blobs
724
730
  end
725
731
 
732
+ def find_blob(&block)
733
+ return nil unless block_given?
734
+ blob = @tree.each_blob.find {|blob| yield blob[:name] }
735
+ blob ? blob_for_tree_entry(blob) : nil
736
+ end
737
+
738
+ private
739
+
740
+ def blob_for_tree_entry(blob)
741
+ Gollum::Git::Blob.new(@tree.owner.lookup(blob[:oid]), self.class.tree_entry_from_rugged_hash(blob))
742
+ end
743
+
726
744
  end
727
745
 
728
746
  end
@@ -1,7 +1,7 @@
1
1
  module Gollum
2
2
  module Lib
3
3
  module Git
4
- VERSION = '2.1.0'
4
+ VERSION = '3.0'
5
5
  end
6
6
  end
7
7
  end
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: 2.1.0
4
+ version: '3.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Kamphorst, Dawa Ometto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-12 00:00:00.000000000 Z
11
+ date: 2023-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubygems_version: 3.4.6
89
+ rubygems_version: 3.2.3
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: Adapter for Gollum to use Rugged (libgit2) at the backend.