avm-eac_redmine_plugin_base0 0.2.0 → 0.4.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/init.rb +27 -0
- data/lib/avm/eac_redmine_plugin_base0/sources/base/parent.rb +31 -0
- data/lib/avm/eac_redmine_plugin_base0/sources/base/rubocop.rb +29 -0
- data/lib/avm/eac_redmine_plugin_base0/sources/base/version.rb +31 -0
- data/lib/avm/eac_redmine_plugin_base0/sources/base.rb +6 -29
- data/lib/avm/eac_redmine_plugin_base0/sources/init_file.rb +43 -0
- data/lib/avm/eac_redmine_plugin_base0/version.rb +1 -1
- metadata +19 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96d93cc3a812c02b50333327cdb3d257fd9d500694a122fd77800db3ad6d1fc2
|
4
|
+
data.tar.gz: 4308d5cc4ed266a9f182dd53d69ea77f6395ddefda6507fc8260bdffad1c6626
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 107aacf8827da1117d55305c2944063a24be1fffa78e215bcbd706234d027445e358ffffae0cdc942589d441faad74bc638c836dfd19d1f14492482318463285
|
7
|
+
data.tar.gz: e96953a19a52660b46ebf261f834a4a2ef4457744dd0f8ba71c776a8a73c1d533bba5857ef5c6e09946ee07bd5fe30a189de3cca67cb4986bf36ad1a79a52f39
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_redmine_plugin_base0/sources/init_file'
|
4
|
+
require 'avm/eac_ruby_base1/sources/base'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module EacRedminePluginBase0
|
9
|
+
module Sources
|
10
|
+
class Base < ::Avm::EacRubyBase1::Sources::Base
|
11
|
+
module Init
|
12
|
+
INIT_SUBPATH = 'init.rb'
|
13
|
+
|
14
|
+
# @return [Avm::EacRedminePluginBase0::Sources::InitFile]
|
15
|
+
def init_file
|
16
|
+
::Avm::EacRedminePluginBase0::Sources::InitFile.new(init_path)
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [String]
|
20
|
+
def init_path
|
21
|
+
path.join(INIT_SUBPATH)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_ruby_base1/sources/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacRedminePluginBase0
|
8
|
+
module Sources
|
9
|
+
class Base < ::Avm::EacRubyBase1::Sources::Base
|
10
|
+
module Parent
|
11
|
+
PARENT_RAKE_TASK_TEST_NAME = 'parent_rake_task'
|
12
|
+
|
13
|
+
# @return [String]
|
14
|
+
def parent_rake_test_task_name
|
15
|
+
[gem_name, 'test'].map(&:variableize).join(':')
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [Boolean]
|
19
|
+
def parent_rake_test_command?
|
20
|
+
ruby_parent.rake_task?(parent_rake_test_task_name)
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [EacRubyUtils::Envs::Command]
|
24
|
+
def parent_rake_test_command
|
25
|
+
ruby_parent.rake(parent_rake_test_task_name).chdir_root.envvar('RAILS_ENV', 'test')
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_ruby_base1/sources/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacRedminePluginBase0
|
8
|
+
module Sources
|
9
|
+
class Base < ::Avm::EacRubyBase1::Sources::Base
|
10
|
+
module Rubocop
|
11
|
+
RUBOCOP_GEM_NAME = 'rubocop'
|
12
|
+
RUBOCOP_TEST_NAME = 'rubocop'
|
13
|
+
|
14
|
+
# @return [EacRubyUtils::Envs::Command]
|
15
|
+
def rubocop_test_command
|
16
|
+
bundle('exec', 'rubocop', '--ignore-parent-exclusion')
|
17
|
+
.envvar('RAILS_ENV', 'test')
|
18
|
+
.chdir_root
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [Boolean]
|
22
|
+
def rubocop_test_command?
|
23
|
+
gemfile_path.exist? && gemfile_lock_gem_version(RUBOCOP_GEM_NAME).present?
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_ruby_base1/sources/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacRedminePluginBase0
|
8
|
+
module Sources
|
9
|
+
class Base < ::Avm::EacRubyBase1::Sources::Base
|
10
|
+
module Version
|
11
|
+
# @return [Avm::VersionNumber]
|
12
|
+
def version
|
13
|
+
if version_file_path.exist?
|
14
|
+
super
|
15
|
+
else
|
16
|
+
init_file.version
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def version=(value)
|
21
|
+
if version_file_path.exist?
|
22
|
+
super
|
23
|
+
else
|
24
|
+
init_file.version = value
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -7,10 +7,9 @@ module Avm
|
|
7
7
|
module EacRedminePluginBase0
|
8
8
|
module Sources
|
9
9
|
class Base < ::Avm::EacRubyBase1::Sources::Base
|
10
|
+
require_sub __FILE__, include_modules: true
|
11
|
+
|
10
12
|
DEFAULT_GEMFILE_PATH = 'SelfGemfile'
|
11
|
-
RUBOCOP_TEST_NAME = 'rubocop'
|
12
|
-
PARENT_RAKE_TASK_TEST_NAME = 'parent_rake_task'
|
13
|
-
INIT_SUBPATH = 'init.rb'
|
14
13
|
|
15
14
|
# @return [String]
|
16
15
|
def default_gemfile_path
|
@@ -19,32 +18,10 @@ module Avm
|
|
19
18
|
|
20
19
|
# @return [Hash<String, EacRubyUtils::Envs::Command>]
|
21
20
|
def default_test_commands
|
22
|
-
{
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
# @return [String]
|
29
|
-
def init_path
|
30
|
-
path.join(INIT_SUBPATH)
|
31
|
-
end
|
32
|
-
|
33
|
-
# @return [String]
|
34
|
-
def parent_rake_test_task_name
|
35
|
-
[gem_name, 'test'].map(&:variableize).join(':')
|
36
|
-
end
|
37
|
-
|
38
|
-
# @return [EacRubyUtils::Envs::Command]
|
39
|
-
def parent_rake_test_command
|
40
|
-
ruby_parent.rake(parent_rake_test_task_name).chdir_root.envvar('RAILS_ENV', 'test')
|
41
|
-
end
|
42
|
-
|
43
|
-
# @return [EacRubyUtils::Envs::Command]
|
44
|
-
def rubocop_test_command
|
45
|
-
bundle('exec', 'rubocop', '--ignore-parent-exclusion')
|
46
|
-
.envvar('RAILS_ENV', 'test')
|
47
|
-
.chdir_root
|
21
|
+
r = {}
|
22
|
+
r[PARENT_RAKE_TASK_TEST_NAME] = parent_rake_test_command if parent_rake_test_command?
|
23
|
+
r[RUBOCOP_TEST_NAME] = rubocop_test_command if rubocop_test_command?
|
24
|
+
r
|
48
25
|
end
|
49
26
|
|
50
27
|
# @return [Boolean]
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacRedminePluginBase0
|
7
|
+
module Sources
|
8
|
+
class InitFile
|
9
|
+
common_constructor :path
|
10
|
+
|
11
|
+
VERSION_LINE_PATTERN = /\A(\s*)version\s*[\'\"]([^\'\"]+)[\'\"](\s*)\z/.freeze
|
12
|
+
|
13
|
+
def version
|
14
|
+
path.read.each_line.lazy.map { |line| line_value(line) }.find { |v| v }
|
15
|
+
end
|
16
|
+
|
17
|
+
def version=(new_value)
|
18
|
+
path.write(new_value_content(new_value))
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
# @return Version found in line, nil otherwise.
|
24
|
+
def line_value(line)
|
25
|
+
VERSION_LINE_PATTERN.if_match(line.rstrip, false) { |m| ::Gem::Version.new(m[2]) }
|
26
|
+
end
|
27
|
+
|
28
|
+
def new_value_content(new_value)
|
29
|
+
path.read.each_line
|
30
|
+
.map { |line| new_value_line(line, new_value) }
|
31
|
+
.join
|
32
|
+
end
|
33
|
+
|
34
|
+
def new_value_line(line, new_value)
|
35
|
+
m = VERSION_LINE_PATTERN.match(line)
|
36
|
+
return line unless m
|
37
|
+
|
38
|
+
"#{m[1]}version '#{new_value}'"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
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.4.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: 2022-
|
11
|
+
date: 2022-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avm-eac_ruby_base1
|
@@ -16,34 +16,40 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.27'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.27.1
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
29
|
+
version: '0.27'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.27.1
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: eac_ruby_utils
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
39
|
+
version: '0.107'
|
34
40
|
- - ">="
|
35
41
|
- !ruby/object:Gem::Version
|
36
|
-
version: 0.
|
42
|
+
version: 0.107.1
|
37
43
|
type: :runtime
|
38
44
|
prerelease: false
|
39
45
|
version_requirements: !ruby/object:Gem::Requirement
|
40
46
|
requirements:
|
41
47
|
- - "~>"
|
42
48
|
- !ruby/object:Gem::Version
|
43
|
-
version: '0.
|
49
|
+
version: '0.107'
|
44
50
|
- - ">="
|
45
51
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.
|
52
|
+
version: 0.107.1
|
47
53
|
- !ruby/object:Gem::Dependency
|
48
54
|
name: eac_ruby_gem_support
|
49
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,6 +78,11 @@ extra_rdoc_files: []
|
|
72
78
|
files:
|
73
79
|
- lib/avm/eac_redmine_plugin_base0.rb
|
74
80
|
- lib/avm/eac_redmine_plugin_base0/sources/base.rb
|
81
|
+
- lib/avm/eac_redmine_plugin_base0/sources/base/init.rb
|
82
|
+
- lib/avm/eac_redmine_plugin_base0/sources/base/parent.rb
|
83
|
+
- lib/avm/eac_redmine_plugin_base0/sources/base/rubocop.rb
|
84
|
+
- lib/avm/eac_redmine_plugin_base0/sources/base/version.rb
|
85
|
+
- lib/avm/eac_redmine_plugin_base0/sources/init_file.rb
|
75
86
|
- lib/avm/eac_redmine_plugin_base0/version.rb
|
76
87
|
homepage:
|
77
88
|
licenses: []
|