gollum-rugged_adapter 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/Rakefile +56 -0
- data/lib/rugged_adapter/git_layer_rugged.rb +16 -0
- data/lib/rugged_adapter/version.rb +1 -1
- data/rugged_adapter.gemspec +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18259a2992e32502c42836d608a0339a0e0f4e5555aca0a36cba02cc2894ffd5
|
4
|
+
data.tar.gz: a0f13307e539bfd3cddc2053fc569ac334feec99b86c58ce592569001632be05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e09da620ba3f9cfdecdb85b00e68fef221209896d9a12a297f6d7e956e9d12bdf719ba88a1b2a2375f03ce1b291956fbf0f76e24f656706eaaaeec5f0bae34a
|
7
|
+
data.tar.gz: f8b75d0f80ed360fc6bd14a1e0eb2d9c2e258b0b83460caf73cc0ee039a2c7077b2be3c0919182f6c2ded4ccd105b33262943764aa7d953b5bcb9113d64f8f61
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/gollum-rugged_adapter.svg)](
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/gollum-rugged_adapter.svg)](https://badge.fury.io/rb/gollum-rugged_adapter)
|
2
2
|
![Build Status](https://github.com/gollum/rugged_adapter/actions/workflows/test.yaml/badge.svg)
|
3
|
-
[![Dependency Status](https://
|
3
|
+
[![Cutting Edge Dependency Status](https://cuttingedge.onrender.com/github/gollum/rugged_adapter/svg 'Cutting Edge Dependency Status')](https://cuttingedge.onrender.com/github/gollum/rugged_adapter/info)
|
4
4
|
|
5
5
|
## DESCRIPTION
|
6
6
|
|
data/Rakefile
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'date'
|
4
|
+
require 'tempfile'
|
2
5
|
|
3
6
|
task :default => :rspec
|
4
7
|
|
@@ -8,6 +11,18 @@ def name
|
|
8
11
|
"rugged_adapter"
|
9
12
|
end
|
10
13
|
|
14
|
+
def date
|
15
|
+
Time.now.strftime("%Y-%m-%d")
|
16
|
+
end
|
17
|
+
|
18
|
+
def latest_changes_file
|
19
|
+
'LATEST_CHANGES.md'
|
20
|
+
end
|
21
|
+
|
22
|
+
def history_file
|
23
|
+
'HISTORY.md'
|
24
|
+
end
|
25
|
+
|
11
26
|
def version
|
12
27
|
line = File.read("lib/rugged_adapter/version.rb")[/^\s*VERSION\s*=\s*.*/]
|
13
28
|
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
@@ -72,6 +87,7 @@ task :release => :build do
|
|
72
87
|
puts "You must be on the master branch to release!"
|
73
88
|
exit!
|
74
89
|
end
|
90
|
+
Rake::Task[:changelog].execute
|
75
91
|
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
76
92
|
sh "git pull --rebase origin master"
|
77
93
|
sh "git tag v#{version}"
|
@@ -123,4 +139,44 @@ task :validate do
|
|
123
139
|
puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir."
|
124
140
|
exit!
|
125
141
|
end
|
142
|
+
end
|
143
|
+
|
144
|
+
desc 'Build changlog'
|
145
|
+
task :changelog do
|
146
|
+
[latest_changes_file, history_file].each do |f|
|
147
|
+
unless File.exist?(f)
|
148
|
+
puts "#{f} does not exist but is required to build a new release."
|
149
|
+
exit!
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
latest_changes = File.open(latest_changes_file)
|
154
|
+
version_pattern = "# #{version}"
|
155
|
+
|
156
|
+
if !`grep "#{version_pattern}" #{history_file}`.empty?
|
157
|
+
puts "#{version} is already described in #{history_file}"
|
158
|
+
exit!
|
159
|
+
end
|
160
|
+
|
161
|
+
begin
|
162
|
+
unless latest_changes.readline.chomp! =~ %r{#{version_pattern}}
|
163
|
+
puts "#{latest_changes_file} should begin with '#{version_pattern}'"
|
164
|
+
exit!
|
165
|
+
end
|
166
|
+
rescue EOFError
|
167
|
+
puts "#{latest_changes_file} is empty!"
|
168
|
+
exit!
|
169
|
+
end
|
170
|
+
|
171
|
+
body = latest_changes.read
|
172
|
+
body.scan(/\s*#\s+\d\.\d.*/) do |match|
|
173
|
+
puts "#{latest_changes_file} may not contain multiple markdown headers!"
|
174
|
+
exit!
|
175
|
+
end
|
176
|
+
|
177
|
+
temp = Tempfile.new
|
178
|
+
temp.puts("#{version_pattern} / #{date}\n#{body}\n\n")
|
179
|
+
temp.close
|
180
|
+
`cat #{history_file} >> #{temp.path}`
|
181
|
+
`cat #{temp.path} > #{history_file}`
|
126
182
|
end
|
@@ -143,6 +143,22 @@ module Gollum
|
|
143
143
|
@commit.parents.empty? ? nil : Gollum::Git::Commit.new(@commit.parents.first)
|
144
144
|
end
|
145
145
|
|
146
|
+
def note(ref='refs/notes/commits')
|
147
|
+
result = @commit.notes(ref)
|
148
|
+
result ? result[:message] : nil
|
149
|
+
end
|
150
|
+
|
151
|
+
def note=(msg, actor = nil, ref='refs/notes/commits')
|
152
|
+
actor = Gollum::Git::Actor.default_actor if actor.nil?
|
153
|
+
@commit.create_note(
|
154
|
+
author: actor.to_h,
|
155
|
+
committer: actor.to_h,
|
156
|
+
message: msg,
|
157
|
+
ref: ref,
|
158
|
+
force: true
|
159
|
+
)
|
160
|
+
end
|
161
|
+
|
146
162
|
private
|
147
163
|
|
148
164
|
def build_stats
|
data/rugged_adapter.gemspec
CHANGED
@@ -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', '~> 1.
|
17
|
-
s.add_runtime_dependency 'mime-types', '~>
|
16
|
+
s.add_runtime_dependency 'rugged', '~> 1.5'
|
17
|
+
s.add_runtime_dependency 'mime-types', '~> 3.4'
|
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: 2.
|
4
|
+
version: 2.1.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:
|
11
|
+
date: 2023-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: '1.5'
|
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: 1.
|
26
|
+
version: '1.5'
|
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
|
-
version: '
|
33
|
+
version: '3.4'
|
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
|
-
version: '
|
40
|
+
version: '3.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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.
|
89
|
+
rubygems_version: 3.4.6
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: Adapter for Gollum to use Rugged (libgit2) at the backend.
|