redmine_plugin_kit 1.0.6 → 1.0.7

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: e70a683a6d00229895f294f80c9e45b3418097776a8cdb1404861647d947be4a
4
- data.tar.gz: 609059f357451defbd6c72a579de206f437fe53b5c582edbd2129999387ffe97
3
+ metadata.gz: b46d9687fc10c651bf9b97d521c32626da3aa512e4a6b35129853b392373c9e6
4
+ data.tar.gz: 82fff5a7d015c429fc2aace8aa21487e4926834ce12f531b4c1730c6ded1bd07
5
5
  SHA512:
6
- metadata.gz: c4d80378cc8c646323a895d3e440ba2c67d78757d9e4938b84ea2276d90dbc65d548686114c5a370eeccddbae8479f31ba58d1f13bddea84d389aa0198f96c05
7
- data.tar.gz: 1a488d91d4d3b7d12c5c1dc653bd00191d055fb4fc576ff99b86d1fe2634fcc9373b5651f5abdb621a9356bcf29edafb41608ff56bf08ecfe15525d6789e55cf
6
+ metadata.gz: 52ec1ea4baa451f343576dde3901619d30d2c7b7cacba46c9bdc40af8fab0f80b8db4fd2a1d07b75465d9b071e2d5677cdb81ad8f5b3f46b53f0fbe90fd8bc68
7
+ data.tar.gz: 9380da6c43ed0da0c0b2cad2ca90f179fda32ae7b6f6a86d47381414fcdca4aaba2e9e66e78af4a039f2cb318469a821f5f20b6600b137de3310a2e440df6e7c
@@ -15,7 +15,7 @@ module RedminePluginKit
15
15
  return if url.blank?
16
16
 
17
17
  parts = url.split '://'
18
- name = if parts.count.positive?
18
+ name = if parts.any?
19
19
  parts.shift
20
20
  parts.join.chomp '/'
21
21
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RedminePluginKit
4
- VERSION = '1.0.6'
4
+ VERSION = '1.0.7'
5
5
  end
@@ -79,4 +79,39 @@ namespace :redmine_plugin_kit do
79
79
  puts plugin_settings[setting]
80
80
  end
81
81
  end
82
+
83
+ desc 'Detects templates from the plugin that override Redmine core templates'
84
+ task detect_overwritten_templates: :environment do
85
+ redmine_views_root = Rails.root.join 'app/views'
86
+
87
+ Rails.root.glob('plugins/*').each do |plugin_path|
88
+ plugin_path = plugin_path.to_s
89
+ plugin_views = Dir.glob "#{plugin_path}/app/views/**/*.{erb,slim}"
90
+ overwritten = []
91
+
92
+ plugin_views.each do |plugin_file|
93
+ relative_path = plugin_file.sub %r{^#{Regexp.escape plugin_path}/app/views/}, ''
94
+ base_path = relative_path.sub(/\.(erb|slim)$/, '')
95
+ redmine_template = redmine_views_root.join "#{base_path}.erb"
96
+
97
+ overwritten << "app/views/#{base_path}.erb" if File.exist? redmine_template
98
+ end
99
+
100
+ output_file = File.join plugin_path, '.overwritten_templates'
101
+ previous_content = if File.exist? output_file
102
+ lines = File.read(output_file).lines.map(&:strip)
103
+ lines.sort
104
+ else
105
+ []
106
+ end
107
+ new_content = overwritten.sort
108
+
109
+ if previous_content == new_content
110
+ puts "✔️ No changes for: #{File.basename plugin_path}"
111
+ else
112
+ File.write output_file, "#{new_content.join "\n"}\n"
113
+ puts "✅ Updated: #{output_file}"
114
+ end
115
+ end
116
+ end
82
117
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_plugin_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - AlphaNodes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-10 00:00:00.000000000 Z
11
+ date: 2025-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface