avm-eac_redmine_plugin_base0 0.5.0 → 0.6.0
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/lib/avm/eac_redmine_plugin_base0/sources/base/plugins_dependencies.rb +25 -0
- data/lib/avm/eac_redmine_plugin_base0/sources/base/update.rb +18 -0
- data/lib/avm/eac_redmine_plugin_base0/sources/base.rb +2 -0
- data/lib/avm/eac_redmine_plugin_base0/sources/init_file/plugin_id.rb +23 -0
- data/lib/avm/eac_redmine_plugin_base0/sources/init_file/version.rb +27 -0
- data/lib/avm/eac_redmine_plugin_base0/sources/init_file/version_set.rb +39 -0
- data/lib/avm/eac_redmine_plugin_base0/sources/init_file.rb +8 -23
- data/lib/avm/eac_redmine_plugin_base0/sources/update_changes/plugins_requirements.rb +47 -0
- data/lib/avm/eac_redmine_plugin_base0/version.rb +1 -1
- data/lib/avm/eac_redmine_plugin_base0.rb +3 -8
- data/locale/en.yml +7 -0
- data/locale/pt-BR.yml +7 -0
- metadata +22 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1fcbe6acaaeaaa75aa1b390a6c7e02f75d77c593625b61a677ca98e89e5b1772
|
|
4
|
+
data.tar.gz: 50ada4ec3eb0f59320c744c9cafbbaeb16e489797788a070203bf879dc06bf66
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5897bbe54f5ec9e3b6c0acc7ea8e020a76767554f6b289e8b5fad4929c7b90f5080d548484b3db7885be6ec96e404212818a43998ccadc3c65f4cb5942e9bc8
|
|
7
|
+
data.tar.gz: e40288b381e22b45a53b9202ddc02eb1b510335848adec31253df4064844c0c2e9403aa6c40eb0232e460affbaaa2496b1e8fd7b8d42bfc36a3c0f6f716cbc59
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Avm
|
|
4
|
+
module EacRedminePluginBase0
|
|
5
|
+
module Sources
|
|
6
|
+
class Base < ::Avm::EacRubyBase1::Sources::Base
|
|
7
|
+
module PluginsDependencies
|
|
8
|
+
DEPENDENCIES_SUBPATHS = %w[yml yaml].map { |e| "dependencies.#{e}" }
|
|
9
|
+
|
|
10
|
+
# The possible absolute paths for the dependencies file.
|
|
11
|
+
#
|
|
12
|
+
# @return [Enumerable<Pathname>]
|
|
13
|
+
def dependencies_file_paths
|
|
14
|
+
DEPENDENCIES_SUBPATHS.map { |basename| path.join(basename) }
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# @return [Pathname, nil]
|
|
18
|
+
def dependencies_file
|
|
19
|
+
dependencies_file_paths.find(&:file?)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Avm
|
|
4
|
+
module EacRedminePluginBase0
|
|
5
|
+
module Sources
|
|
6
|
+
class Base < ::Avm::EacRubyBase1::Sources::Base
|
|
7
|
+
module Update
|
|
8
|
+
# @param changes [Enumerable<Avm::Sources::Change>]
|
|
9
|
+
def update_self_changes_after_subs
|
|
10
|
+
super + [
|
|
11
|
+
::Avm::EacRedminePluginBase0::Sources::UpdateChanges::PluginsRequirements.new(self)
|
|
12
|
+
]
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Avm
|
|
4
|
+
module EacRedminePluginBase0
|
|
5
|
+
module Sources
|
|
6
|
+
class InitFile
|
|
7
|
+
class PluginId
|
|
8
|
+
acts_as_instance_method
|
|
9
|
+
common_constructor :init_file
|
|
10
|
+
|
|
11
|
+
PLUGIN_ID_PARSER = /Redmine::Plugin.register\s+:([^\s]+)\s/.to_parser do |m|
|
|
12
|
+
m[1].to_sym
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# @return [Symbol]
|
|
16
|
+
def result
|
|
17
|
+
init_file.find_on_line { |line| PLUGIN_ID_PARSER.parse(line) }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Avm
|
|
4
|
+
module EacRedminePluginBase0
|
|
5
|
+
module Sources
|
|
6
|
+
class InitFile
|
|
7
|
+
class Version
|
|
8
|
+
acts_as_instance_method
|
|
9
|
+
common_constructor :init_file
|
|
10
|
+
|
|
11
|
+
# @return [Avm::VersionNumber, nil] Version found in line, nil otherwise.
|
|
12
|
+
def result
|
|
13
|
+
init_file.find_on_line { |line| line_value(line) }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
protected
|
|
17
|
+
|
|
18
|
+
# @return [Avm::VersionNumber, nil] Version found in line, nil otherwise.
|
|
19
|
+
def line_value(line)
|
|
20
|
+
Avm::EacRedminePluginBase0::Sources::InitFile::VERSION_LINE_PATTERN
|
|
21
|
+
.if_match(line.rstrip, false) { |m| ::Avm::VersionNumber.new(m[2]) }
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Avm
|
|
4
|
+
module EacRedminePluginBase0
|
|
5
|
+
module Sources
|
|
6
|
+
class InitFile
|
|
7
|
+
class VersionSet
|
|
8
|
+
acts_as_instance_method
|
|
9
|
+
common_constructor :init_file, :new_value
|
|
10
|
+
|
|
11
|
+
# @return [String]
|
|
12
|
+
def result
|
|
13
|
+
init_file.path.write(new_value_content(new_value))
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
protected
|
|
17
|
+
|
|
18
|
+
# @param new_value [String]
|
|
19
|
+
# @return [String]
|
|
20
|
+
def new_value_content(new_value)
|
|
21
|
+
path.read.each_line
|
|
22
|
+
.map { |line| new_value_line(line, new_value) }
|
|
23
|
+
.join
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# @param line [String]
|
|
27
|
+
# @param new_value [String]
|
|
28
|
+
# @return [String]
|
|
29
|
+
def new_value_line(line, new_value)
|
|
30
|
+
m = Avm::EacRedminePluginBase0::Sources::InitFile::VERSION_LINE_PATTERN.match(line)
|
|
31
|
+
return line unless m
|
|
32
|
+
|
|
33
|
+
"#{m[1]}version '#{new_value}'"
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -6,35 +6,20 @@ module Avm
|
|
|
6
6
|
class InitFile
|
|
7
7
|
common_constructor :path
|
|
8
8
|
|
|
9
|
-
VERSION_LINE_PATTERN = /\A(\s*)version\s*['"]([^'"]+)['"](\s*)\z
|
|
10
|
-
|
|
11
|
-
def version
|
|
12
|
-
path.read.each_line.lazy.map { |line| line_value(line) }.find { |v| v }
|
|
13
|
-
end
|
|
9
|
+
VERSION_LINE_PATTERN = /\A(\s*)version\s*['"]([^'"]+)['"](\s*)\z/
|
|
14
10
|
|
|
11
|
+
# @param new_value [String]
|
|
15
12
|
def version=(new_value)
|
|
16
|
-
|
|
13
|
+
version_set(new_value)
|
|
17
14
|
end
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
VERSION_LINE_PATTERN.if_match(line.rstrip, false) { |m| ::Avm::VersionNumber.new(m[2]) }
|
|
16
|
+
# @param &line_evaluator [Proc]
|
|
17
|
+
# @return [Object]
|
|
18
|
+
def find_on_line(&)
|
|
19
|
+
path.read.each_line.lazy.map(&).find(&:present?)
|
|
24
20
|
end
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
path.read.each_line
|
|
28
|
-
.map { |line| new_value_line(line, new_value) }
|
|
29
|
-
.join
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def new_value_line(line, new_value)
|
|
33
|
-
m = VERSION_LINE_PATTERN.match(line)
|
|
34
|
-
return line unless m
|
|
35
|
-
|
|
36
|
-
"#{m[1]}version '#{new_value}'"
|
|
37
|
-
end
|
|
22
|
+
require_sub __FILE__, require_mode: :kernel
|
|
38
23
|
end
|
|
39
24
|
end
|
|
40
25
|
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Avm
|
|
4
|
+
module EacRedminePluginBase0
|
|
5
|
+
module Sources
|
|
6
|
+
module UpdateChanges
|
|
7
|
+
class PluginsRequirements < ::Avm::Sources::Change
|
|
8
|
+
# @return [String]
|
|
9
|
+
def commit_message
|
|
10
|
+
i18n_translate(
|
|
11
|
+
__method__,
|
|
12
|
+
dependencies_file: source.dependencies_file.relative_path_from(source.path)
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# @return [void]
|
|
17
|
+
def perform
|
|
18
|
+
return if source.dependencies_file.blank?
|
|
19
|
+
|
|
20
|
+
source.dependencies_file.write(dependencies.to_yaml)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# @return [Hash<String, Hash>]
|
|
24
|
+
def dependencies
|
|
25
|
+
::YAML.load_file(source.dependencies_file).keys.to_h do |plugin_id|
|
|
26
|
+
[plugin_id, { 'version_or_higher' => plugin_version(plugin_id.to_sym) }]
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# @param plugin_id [Symbol]
|
|
31
|
+
# @return [String]
|
|
32
|
+
def plugin_version(plugin_id)
|
|
33
|
+
plugin_source(plugin_id).version.to_s
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# @param plugin_id [Symbol]
|
|
37
|
+
# @return [Avm::EacRedminePluginBase0::Sources::Base]
|
|
38
|
+
def plugin_source(plugin_id)
|
|
39
|
+
source.parent.subs.find do |e|
|
|
40
|
+
e.is_a?(::Avm::EacRedminePluginBase0::Sources::Base) && e.plugin_id == plugin_id
|
|
41
|
+
end || raise("Plugin with id \"#{plugin_id}\" not found")
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
module Avm
|
|
7
|
-
module EacRedminePluginBase0
|
|
8
|
-
end
|
|
3
|
+
require 'eac_ruby_base1'
|
|
4
|
+
EacRubyBase1::RootModuleSetup.perform __FILE__ do
|
|
5
|
+
require 'avm/eac_ruby_base1'
|
|
9
6
|
end
|
|
10
|
-
|
|
11
|
-
require 'avm/eac_ruby_base1'
|
data/locale/en.yml
ADDED
data/locale/pt-BR.yml
ADDED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: avm-eac_redmine_plugin_base0
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eduardo H. Bogoni
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-08-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: avm-eac_ruby_base1
|
|
@@ -16,54 +16,54 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0.
|
|
19
|
+
version: '0.43'
|
|
20
20
|
- - ">="
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: 0.
|
|
22
|
+
version: 0.43.3
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - "~>"
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: '0.
|
|
29
|
+
version: '0.43'
|
|
30
30
|
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 0.
|
|
32
|
+
version: 0.43.3
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
|
-
name:
|
|
34
|
+
name: eac_ruby_base1
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '0.
|
|
39
|
+
version: '0.1'
|
|
40
40
|
- - ">="
|
|
41
41
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: 0.
|
|
42
|
+
version: 0.1.1
|
|
43
43
|
type: :runtime
|
|
44
44
|
prerelease: false
|
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
|
46
46
|
requirements:
|
|
47
47
|
- - "~>"
|
|
48
48
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: '0.
|
|
49
|
+
version: '0.1'
|
|
50
50
|
- - ">="
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
|
-
version: 0.
|
|
52
|
+
version: 0.1.1
|
|
53
53
|
- !ruby/object:Gem::Dependency
|
|
54
54
|
name: eac_ruby_gem_support
|
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
|
56
56
|
requirements:
|
|
57
57
|
- - "~>"
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
|
-
version: '0.
|
|
59
|
+
version: '0.14'
|
|
60
60
|
type: :development
|
|
61
61
|
prerelease: false
|
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
|
63
63
|
requirements:
|
|
64
64
|
- - "~>"
|
|
65
65
|
- !ruby/object:Gem::Version
|
|
66
|
-
version: '0.
|
|
66
|
+
version: '0.14'
|
|
67
67
|
description:
|
|
68
68
|
email:
|
|
69
69
|
executables: []
|
|
@@ -74,10 +74,18 @@ files:
|
|
|
74
74
|
- lib/avm/eac_redmine_plugin_base0/sources/base.rb
|
|
75
75
|
- lib/avm/eac_redmine_plugin_base0/sources/base/init.rb
|
|
76
76
|
- lib/avm/eac_redmine_plugin_base0/sources/base/parent.rb
|
|
77
|
+
- lib/avm/eac_redmine_plugin_base0/sources/base/plugins_dependencies.rb
|
|
77
78
|
- lib/avm/eac_redmine_plugin_base0/sources/base/rubocop.rb
|
|
79
|
+
- lib/avm/eac_redmine_plugin_base0/sources/base/update.rb
|
|
78
80
|
- lib/avm/eac_redmine_plugin_base0/sources/base/version.rb
|
|
79
81
|
- lib/avm/eac_redmine_plugin_base0/sources/init_file.rb
|
|
82
|
+
- lib/avm/eac_redmine_plugin_base0/sources/init_file/plugin_id.rb
|
|
83
|
+
- lib/avm/eac_redmine_plugin_base0/sources/init_file/version.rb
|
|
84
|
+
- lib/avm/eac_redmine_plugin_base0/sources/init_file/version_set.rb
|
|
85
|
+
- lib/avm/eac_redmine_plugin_base0/sources/update_changes/plugins_requirements.rb
|
|
80
86
|
- lib/avm/eac_redmine_plugin_base0/version.rb
|
|
87
|
+
- locale/en.yml
|
|
88
|
+
- locale/pt-BR.yml
|
|
81
89
|
homepage:
|
|
82
90
|
licenses: []
|
|
83
91
|
metadata: {}
|
|
@@ -89,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
89
97
|
requirements:
|
|
90
98
|
- - ">="
|
|
91
99
|
- !ruby/object:Gem::Version
|
|
92
|
-
version: '2
|
|
100
|
+
version: '3.2'
|
|
93
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
102
|
requirements:
|
|
95
103
|
- - ">="
|