eac_redmine_base0 0.4.3 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f20d973844997c94e102f1dcae7d62813603b0fd5558789c18519863efc59ba
4
- data.tar.gz: f178cebf40e416799afc9f396193fa196121e3a6433307006f2656c8f61dfd86
3
+ metadata.gz: f9b88ec824e226607f3b0823ec77f1129e1df03cf7d09a93e1b29f9a6f720699
4
+ data.tar.gz: 577c3a612c3a56fa5ebe0f18bf130ba05bcb291d3b39358df615ea575f5b495e
5
5
  SHA512:
6
- metadata.gz: 252ec79683fdb73426457865ef716cc73b7b16aa3411e4124f282397bf42c634916821824beca95c7a629ce25166922e6d40e4bae44c2f37d428827e53fd03e0
7
- data.tar.gz: 03b548c664aadafd6de0b32f7725e95832d1592f4e74d05e1ea3efa261c1385d14ba893b8adf9dd5ca2bb79ef70447f83858b8c3ddd37245dcbaf1ef43780e8b
6
+ metadata.gz: f3c006e25010a444678328e122d01c5a5b166cb22cac6bae7212c2091767f0b640cefd62bd597f6cc6f19efa304a9c1fcd2ce2588655dc3a67edc92dc5dbe389
7
+ data.tar.gz: be704cbe0560e2464441a397cc50e879376569364f1a8a794af045de52a92497e33818900a7dca4352271768704864bd7002c2ea7532801cf774560e5954194d
data/init.rb CHANGED
@@ -10,7 +10,3 @@ Redmine::Plugin.register :eac_redmine_base0 do
10
10
  description ::EacRedmineBase0::SUMMARY
11
11
  version ::EacRedmineBase0::VERSION
12
12
  end
13
-
14
- Rails.configuration.to_prepare do
15
- require 'eac_redmine_base0/maintained_plugins'
16
- end
@@ -4,5 +4,5 @@ module EacRedmineBase0
4
4
  AUTHOR = 'Eduardo Henrique Bogoni'
5
5
  HOMEPAGE = 'https://github.com/esquilo-azul/eac_redmine_base0'
6
6
  SUMMARY = 'E.A.C. base for Redmine.'
7
- VERSION = '0.4.3'
7
+ VERSION = '0.5.0'
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_redmine_base0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
- - 0.4.3
7
+ - 0.5.0
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-06 00:00:00.000000000 Z
11
+ date: 2022-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm-eac_redmine_base0
@@ -66,15 +66,7 @@ extra_rdoc_files: []
66
66
  files:
67
67
  - init.rb
68
68
  - lib/eac_redmine_base0.rb
69
- - lib/eac_redmine_base0/maintained_plugins.rb
70
- - lib/eac_redmine_base0/plugins_test.rb
71
- - lib/eac_redmine_base0/plugins_test/base_test.rb
72
- - lib/eac_redmine_base0/plugins_test/plugin.rb
73
- - lib/eac_redmine_base0/plugins_test/rake_task_test.rb
74
- - lib/eac_redmine_base0/plugins_test/rubocop_test.rb
75
- - lib/eac_redmine_base0/plugins_test/unmaintened_stub_test.rb
76
69
  - lib/eac_redmine_base0/version.rb
77
- - lib/tasks/eac_redmine_base0.rake
78
70
  homepage: https://github.com/esquilo-azul/eac_redmine_base0
79
71
  licenses: []
80
72
  metadata: {}
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'redmine/plugin'
4
-
5
- module EacRedmineBase0
6
- MAINTAINED_PLUGINS_NAMES = %w[
7
- eac_redmine_base0 eac_redmine_usability notifyme redmine_avm redmine_events_manager
8
- redmine_installer redmine_nonproject_modules redmine_plugins_helper redmine_remotes
9
- redmine_tasks_scheduler redmine_with_git
10
- ].freeze
11
-
12
- class << self
13
- def maintained_plugins
14
- @maintained_plugins ||= ::Redmine::Plugin.registered_plugins.values.select do |plugin|
15
- MAINTAINED_PLUGINS_NAMES.include?(plugin.id.to_s)
16
- end
17
- end
18
- end
19
- end
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module EacRedmineBase0
6
- class PluginsTest
7
- class BaseTest
8
- enable_simple_cache
9
- common_constructor :plugin
10
-
11
- def stderr_log
12
- log_path('stderr')
13
- end
14
-
15
- def stdout_log
16
- log_path('stdout')
17
- end
18
-
19
- def test_name
20
- self.class.name.demodulize.gsub(/Test\z/, '').underscore
21
- end
22
-
23
- def to_s
24
- "#{plugin.id}/#{test_name}"
25
- end
26
-
27
- private
28
-
29
- def log_path(suffix)
30
- r = ::Rails.root.join('log', 'eac_redmine_base0',
31
- "#{plugin.id}_#{self.class.name.demodulize.underscore}_#{suffix}.log")
32
- ::FileUtils.mkdir_p(::File.dirname(r))
33
- r
34
- end
35
-
36
- def run_test_uncached
37
- r = run_test_command.execute
38
- ::File.write(stderr_log, r.fetch(:stderr))
39
- ::File.write(stdout_log, r.fetch(:stdout))
40
- r.fetch(:exit_code).zero?
41
- end
42
-
43
- def test_result_uncached
44
- ::Avm::Result.success_or_error(
45
- run_test, 'success', "failed (Log: #{stdout_log})"
46
- )
47
- end
48
- end
49
- end
50
- end
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_redmine_base0/sources/base'
4
- require 'avm/eac_redmine_plugin_base0/sources/base'
5
- require 'avm/result'
6
- require 'eac_ruby_utils/simple_cache'
7
-
8
- module EacRedmineBase0
9
- class PluginsTest
10
- class Plugin < ::SimpleDelegator
11
- include ::EacRubyUtils::SimpleCache
12
-
13
- def initialize(plugin)
14
- super(plugin)
15
- end
16
-
17
- def maintained?
18
- ::EacRedmineBase0.maintained_plugins.any? { |plugin| plugin.id == id }
19
- end
20
-
21
- def tests
22
- return [test_by_type(:unmaintened_stub)] unless maintained?
23
-
24
- [test_by_type(:rake_task), test_by_type(:rubocop)]
25
- end
26
-
27
- private
28
-
29
- def test_by_type(type)
30
- ::EacRedmineBase0::PluginsTest.const_get(type.to_s.camelize + 'Test').new(self)
31
- end
32
-
33
- def plugin_gem_uncached
34
- ::Avm::EacRedminePluginBase0::Sources::Base.new(directory)
35
- end
36
-
37
- def rails_gem_uncached
38
- ::Avm::EacRedmineBase0::Sources::Base.new(::Rails.root)
39
- end
40
- end
41
- end
42
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module EacRedmineBase0
6
- class PluginsTest
7
- class RakeTaskTest < ::EacRedmineBase0::PluginsTest::BaseTest
8
- def test_task?
9
- ::Rake::Task.task_defined?(test_task_name)
10
- end
11
-
12
- def test_task_name
13
- "#{plugin.id}:test"
14
- end
15
-
16
- private
17
-
18
- def run_test_command
19
- plugin.rails_gem.bundle('exec', 'rake', test_task_name).envvar('RAILS_ENV', 'test')
20
- end
21
-
22
- def test_result_uncached
23
- return ::Avm::Result.neutral("task \"#{test_task_name}\" not found") unless test_task?
24
-
25
- super
26
- end
27
- end
28
- end
29
- end
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module EacRedmineBase0
6
- class PluginsTest
7
- class RubocopTest < ::EacRedmineBase0::PluginsTest::BaseTest
8
- EXEC_NAME = GEM_NAME = 'rubocop'
9
-
10
- def rubocop?
11
- return false unless plugin.plugin_gem.gemfile_path.exist?
12
-
13
- bundle_install_command.execute!
14
- plugin.plugin_gem.gemfile_lock_gem_version(GEM_NAME).present?
15
- end
16
-
17
- private
18
-
19
- def bundle_install_command
20
- plugin.plugin_gem.bundle.chdir_root
21
- end
22
-
23
- def run_test_command
24
- plugin.plugin_gem.bundle('exec', EXEC_NAME, '--ignore-parent-exclusion')
25
- .envvar('RAILS_ENV', 'test')
26
- .chdir_root
27
- end
28
-
29
- def test_result_uncached
30
- return ::Avm::Result.neutral("gem \"#{GEM_NAME}\"not found") unless rubocop?
31
-
32
- super
33
- end
34
- end
35
- end
36
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module EacRedmineBase0
6
- class PluginsTest
7
- class UnmaintenedStubTest < ::EacRedmineBase0::PluginsTest::BaseTest
8
- private
9
-
10
- def test_result_uncached
11
- ::Avm::Result.neutral('not maintained by E.A.C.')
12
- end
13
- end
14
- end
15
- end
@@ -1,55 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_cli/speaker'
4
- require 'eac_ruby_utils/core_ext'
5
- require 'eac_ruby_utils/envs'
6
- require 'eac_ruby_utils/speaker'
7
-
8
- module EacRedmineBase0
9
- class PluginsTest
10
- enable_speaker
11
-
12
- def run
13
- ::EacRubyUtils::Speaker.context.on(::EacCli::Speaker.new) do
14
- @tests = []
15
- ::Redmine::Plugin.registered_plugins.each_value do |plugin|
16
- check_plugin(plugin)
17
- end
18
- check_results
19
- end
20
- end
21
-
22
- def check_plugin(plugin)
23
- ::EacRedmineBase0::PluginsTest::Plugin.new(plugin).tests.each { |test| check_test(test) }
24
- end
25
-
26
- def check_test(test)
27
- infom "Checking test \"#{test}\"..."
28
- test.test_result
29
- infom "Test \"#{test}\" checked"
30
- @tests << test
31
- results_banner
32
- end
33
-
34
- def results_banner
35
- infom 'Tests\' results:'
36
- @tests.each do |test|
37
- infov " * #{test}", test.test_result.label
38
- end
39
- end
40
-
41
- def tests_failed
42
- @tests.select { |test| test.test_result.error? }
43
- end
44
-
45
- def check_results
46
- if tests_failed.any?
47
- fatal_error "Some test did not pass:\n" + tests_failed.map do |test|
48
- " * #{test} (Log: #{test.stdout_log}, #{test.stderr_log})"
49
- end.join("\n")
50
- else
51
- success 'All tests passed'
52
- end
53
- end
54
- end
55
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- $LOAD_PATH.unshift(::File.join(::File.dirname(__dir__)))
4
- require 'eac_redmine_base0'
5
-
6
- namespace :eac_redmine_base0 do
7
- namespace :plugins do
8
- desc 'Lists plugins maintained by E.A.C..'
9
- task list: :environment do
10
- ::EacRedmineBase0.maintained_plugins.each do |plugin|
11
- ::Rails.logger.info("Plugin: #{plugin.name} (ID: #{plugin.id})")
12
- end
13
- end
14
-
15
- desc 'Tests plugins maintained by E.A.C..'
16
- task test: :environment do
17
- ::EacRedmineBase0::PluginsTest.new.run
18
- end
19
- end
20
-
21
- task plugins: 'plugins:list'
22
- end