redmine_with_git 0.7.8 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/initializers/001_patches.rb +2 -0
- data/installer/tasks/redmine_git_hosting.sh +1 -1
- data/installer/tasks/redmine_git_hosting_ssh_key.sh +1 -1
- data/lib/redmine_with_git/patches/redmine_git_hosting/gitolite_hook_patch.rb +94 -0
- data/lib/redmine_with_git/version.rb +1 -1
- metadata +21 -7
- data/installer/tasks/apt_ruby.sh +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f9a04b22d5fd7ac0889c9334049403f512292871b3ca73829e414401a8f688f
|
4
|
+
data.tar.gz: 54eaa0769689fce4254692356fc4f16f6ca7d32e9085f8f87c760fd75e759a2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 463c0616cc2c09597d21fac0714915dc65669e629d261cb19881e06dc049026a24a5221f7186a1618c3c49cd97eb41fd9bbc76388392e2e2c023f27cc479ec48
|
7
|
+
data.tar.gz: 364e0fe410f29ef9cc25c543681e9f860a36ec10114b00a1f8b7aac8df695c5da6558c64e7d2a5e1bf2e09dc964d1d245b56631e1a03951882eaf708d4252d39
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'redmine_with_git/patches/redmine_git_hosting/gitolite_hook_patch'
|
4
|
+
|
3
5
|
apply_patches_version_limit = ::Gem::Version.new('4.0.0')
|
4
6
|
redmine_git_hosting_version = ::Gem::Version.new(
|
5
7
|
::Redmine::Plugin.registered_plugins[:redmine_git_hosting].version
|
@@ -13,6 +13,6 @@ export -f task_condition
|
|
13
13
|
|
14
14
|
function task_fix {
|
15
15
|
# https://github.com/libgit2/pygit2/issues/1013#issuecomment-679200156
|
16
|
-
sudo -u "$redmine_user" -H ssh-keygen
|
16
|
+
sudo -u "$redmine_user" -H ssh-keygen -m PEM -t ed25519 -b 2048 -f "$ssh_key" -N ''
|
17
17
|
}
|
18
18
|
export -f task_fix
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_ruby_utils/patch'
|
5
|
+
require 'redmine_git_hosting/gitolite_hook'
|
6
|
+
require 'rbconfig'
|
7
|
+
|
8
|
+
module RedmineWithGit
|
9
|
+
module Patches
|
10
|
+
module RedmineGitHosting
|
11
|
+
module GitoliteHookPatch
|
12
|
+
def self.included(base)
|
13
|
+
base.prepend(InstanceMethods)
|
14
|
+
end
|
15
|
+
|
16
|
+
module InstanceMethods
|
17
|
+
SHEBANG_PATTERNS = [:ruby].map { |k| [k, /^\#!.+\s+#{::Regexp.quote(k)}\s*$/] }
|
18
|
+
.to_h
|
19
|
+
|
20
|
+
def hook_file_has_changed?
|
21
|
+
on_content_replaced { super }
|
22
|
+
end
|
23
|
+
|
24
|
+
def install_hook_file
|
25
|
+
on_content_replaced { super }
|
26
|
+
end
|
27
|
+
|
28
|
+
def on_content_replaced
|
29
|
+
return yield unless replace_shebang?
|
30
|
+
|
31
|
+
::EacRubyUtils::Fs::Temp.on_file do |temp_path|
|
32
|
+
temp_path.write(source_content_with_shebang_replaced)
|
33
|
+
@temp_source_path = temp_path.to_path
|
34
|
+
yield
|
35
|
+
ensure
|
36
|
+
@temp_source_path = nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# @return [Boolean]
|
41
|
+
def replace_shebang?
|
42
|
+
shebang_replacement.present?
|
43
|
+
end
|
44
|
+
|
45
|
+
# @return [String]
|
46
|
+
def ruby_shebang
|
47
|
+
bin = ::RbConfig::CONFIG['RUBY_INSTALL_NAME'] || ::RbConfig::CONFIG['ruby_install_name']
|
48
|
+
bin += (::RbConfig::CONFIG['EXEEXT'] || ::RbConfig::CONFIG['exeext'] || '')
|
49
|
+
::File.join(::RbConfig::CONFIG['bindir'], bin)
|
50
|
+
end
|
51
|
+
|
52
|
+
# @return [Regexp]
|
53
|
+
def shebang_from
|
54
|
+
SHEBANG_PATTERNS.fetch(shebang_replacement)
|
55
|
+
end
|
56
|
+
|
57
|
+
# @return [Symbol, nil]
|
58
|
+
def shebang_replacement
|
59
|
+
SHEBANG_PATTERNS.each do |k, v|
|
60
|
+
return k if v.match?(source_shebang)
|
61
|
+
end
|
62
|
+
|
63
|
+
nil
|
64
|
+
end
|
65
|
+
|
66
|
+
# @return [String]
|
67
|
+
def shebang_to
|
68
|
+
"\#\!#{send("#{shebang_replacement}_shebang")}\n"
|
69
|
+
end
|
70
|
+
|
71
|
+
# @return [String]
|
72
|
+
def source_path
|
73
|
+
@temp_source_path || super
|
74
|
+
end
|
75
|
+
|
76
|
+
# @return [String]
|
77
|
+
def source_shebang
|
78
|
+
::File.open(source_path, &:readline).strip
|
79
|
+
end
|
80
|
+
|
81
|
+
# @return [String]
|
82
|
+
def source_content_with_shebang_replaced
|
83
|
+
::File.read(source_path).gsub(shebang_from, shebang_to)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
::EacRubyUtils.patch(
|
92
|
+
::RedmineGitHosting::GitoliteHook,
|
93
|
+
::RedmineWithGit::Patches::RedmineGitHosting::GitoliteHookPatch
|
94
|
+
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_with_git
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avm
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.78'
|
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.
|
26
|
+
version: '0.78'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: eac_rails_utils
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,28 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.119'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
54
|
+
version: '0.119'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: eac_ruby_gem_support
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.5.1
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.5.1
|
55
69
|
description:
|
56
70
|
email:
|
57
71
|
executables: []
|
@@ -80,7 +94,6 @@ files:
|
|
80
94
|
- installer/programs/triggers/redmine_git_hosting_rescue.sh
|
81
95
|
- installer/setup.sh
|
82
96
|
- installer/tasks/_before_run.sh
|
83
|
-
- installer/tasks/apt_ruby.sh
|
84
97
|
- installer/tasks/gitolite.sh
|
85
98
|
- installer/tasks/gitolite_rc.sh
|
86
99
|
- installer/tasks/gitolite_setup.sh
|
@@ -116,6 +129,7 @@ files:
|
|
116
129
|
- lib/redmine_with_git/load/git.rb
|
117
130
|
- lib/redmine_with_git/patches/redmine_git_hosting/cache/database_patch.rb
|
118
131
|
- lib/redmine_with_git/patches/redmine_git_hosting/commands/git/git_patch.rb
|
132
|
+
- lib/redmine_with_git/patches/redmine_git_hosting/gitolite_hook_patch.rb
|
119
133
|
- lib/redmine_with_git/version.rb
|
120
134
|
- lib/tasks/redmine_with_git.rake
|
121
135
|
homepage:
|