redmineflux_icon_compat 0.1.0 → 0.1.2

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: 272232d401404eec7346af84c3fe7352c41f904b4292967462fab4f29daf7a89
4
- data.tar.gz: b0775447faafc0ad28d5365a4190355fb79956e7c82bec3a114a4c04c2f4f718
3
+ metadata.gz: 6086040e39bd5cf0e82f22f90afdc29853117f6ec8fffbc3ae76cfc5ab1a8b57
4
+ data.tar.gz: 207d95b7aece44166ec87a713bac13fbca6aef984ad9c9f0e576d6f96c2184c5
5
5
  SHA512:
6
- metadata.gz: d4e9e4a3dfde1fa90da197690a5456b52f4ae8ad17fa2e0cfb5cd9fe25b96fe0773ff7c47a6912f1b0e042beab14c9a990f3718046deabcfbc88726f0c9ab55c
7
- data.tar.gz: e50cf452bdc430577ddc4b7bdc579439912dcbfd214dfdbace58d68fceea42e8883d38bd92fd5970e4d79e9b600dabbb301742a87bd51c3ddf1ec932cb6d4893
6
+ metadata.gz: 1cda2877c0643b538626171e024e3046e68b6f74cc3fa314cc5b0e3988fb81e810a53e5ad6e7c54bb448f849e99e03539f3d2dba657d4660fb049e1ed506d9a8
7
+ data.tar.gz: 8c4995d5b73663acd7919ebd3fe02bf1f1b113a6a0d2bd342f1eb916bb97204a47a5572495228f5baad72b0fa9e7c8a71ae9ce00f0661ecb6bfd2cb2e17562cc
data/CHANGELOG.md ADDED
@@ -0,0 +1,32 @@
1
+ # Changelog
2
+
3
+ All notable changes to `redmineflux_icon_compat` will be documented in this file.
4
+
5
+ ## [0.1.2] - 2026-04-17
6
+
7
+ ### Changed
8
+ - Updated README wording and usage clarity.
9
+ - Updated RubyGems dependency example to `~> 0.1.2`.
10
+
11
+ ## [0.1.1] - 2026-04-16
12
+
13
+ ### Added
14
+ - Added comprehensive README usage guide for plugin integration.
15
+ - Added gem publishing documentation for RubyGems.
16
+ - Added test suite for icon helper behavior across fallback modes.
17
+ - Added YARD-style API comments for key helper methods.
18
+ - Added `CHANGELOG.md` to packaged gem files.
19
+
20
+ ### Changed
21
+ - Improved icon rendering detection to rely on helper availability, not Redmine major version constants.
22
+ - Added fallback rendering path through `ApplicationController.helpers.sprite_icon` when local helper context does not expose `sprite_icon`.
23
+
24
+ ### Fixed
25
+ - Prevented incorrect fallback to legacy icon classes in Redmine 6 hook/view contexts.
26
+
27
+ ## [0.1.0] - 2026-04-16
28
+
29
+ ### Added
30
+ - Initial release.
31
+ - Introduced `rf_icon_link` helper for Redmine 5/6 icon compatibility.
32
+ - Added Railtie-based automatic helper inclusion for views/controllers.
data/README.md CHANGED
@@ -1,105 +1,89 @@
1
1
  # Redmineflux Icon Compat
2
2
 
3
- Compatibility helper gem for Redmine plugin icons.
3
+ `redmineflux_icon_compat` provides one helper API for plugin links that works in both:
4
+ - Redmine 5 legacy icon classes (`icon icon-*`)
5
+ - Redmine 6 sprite icons (`sprite_icon`)
4
6
 
5
- This gem gives one helper API (`rf_icon_link`) that works in both:
6
- - Redmine 5 style icons (`icon icon-*` classes)
7
- - Redmine 6 SVG sprite icons (`sprite_icon`)
7
+ Use `rf_icon_link` to keep one code path across Redmine versions.
8
8
 
9
- ## Usage in a Redmine plugin
9
+ ## Install In A Redmine Plugin
10
10
 
11
- 1. Add to plugin Gemfile:
11
+ ### 1) Add the gem to your plugin Gemfile
12
12
 
13
- ```ruby
14
- gem 'redmineflux_icon_compat', path: '../redmineflux_icon_compat'
15
- ```
13
+ Create or update `plugins/<your_plugin>/Gemfile`.
16
14
 
17
- 2. Include helper where needed:
15
+ Local development:
18
16
 
19
17
  ```ruby
20
- include RedminefluxIconCompat::Helper
18
+ gem 'redmineflux_icon_compat', path: '../redmineflux_icon_compat'
21
19
  ```
22
20
 
23
- 3. Use in views/helpers:
21
+ From RubyGems:
24
22
 
25
23
  ```ruby
26
- rf_icon_link(:add, 'Add', '#')
24
+ gem 'redmineflux_icon_compat', '~> 0.1.2'
27
25
  ```
28
26
 
29
- ## Run Tests
27
+ ### 2) Install dependencies
30
28
 
31
29
  From Redmine root:
32
30
 
33
31
  ```bash
34
- ruby plugins/redmineflux_icon_compat/test/helper_test.rb
35
- ```
36
-
37
- Or from gem directory:
38
-
39
- ```bash
40
- cd plugins/redmineflux_icon_compat
41
- ruby test/helper_test.rb
32
+ bundle install
42
33
  ```
43
34
 
44
- ## Release Workflow (RubyGems)
35
+ ### 3) Require the gem in plugin init
45
36
 
46
- 1. Create RubyGems account: https://rubygems.org/sign_up
47
- 2. Login from terminal:
37
+ In `plugins/<your_plugin>/init.rb`:
48
38
 
49
- ```bash
50
- gem signin
39
+ ```ruby
40
+ require 'redmineflux_icon_compat'
51
41
  ```
52
42
 
53
- 3. Bump version in:
54
- - `plugins/redmineflux_icon_compat/lib/redmineflux_icon_compat/version.rb`
55
-
56
- 4. Run tests:
43
+ ### 4) Include the helper (recommended)
57
44
 
58
- ```bash
59
- ruby plugins/redmineflux_icon_compat/test/helper_test.rb
45
+ ```ruby
46
+ module MyPluginHelper
47
+ include RedminefluxIconCompat::Helper
48
+ end
60
49
  ```
61
50
 
62
- 5. Build the gem:
63
-
64
- ```bash
65
- cd plugins/redmineflux_icon_compat
66
- gem build redmineflux_icon_compat.gemspec
67
- ```
51
+ ### 5) Use `rf_icon_link` in views/helpers
68
52
 
69
- 6. Push to RubyGems:
53
+ ERB example:
70
54
 
71
- ```bash
72
- gem push redmineflux_icon_compat-<VERSION>.gem
55
+ ```erb
56
+ <%= rf_icon_link(:add, 'Add Checklist', '#', class: 'add-checklist-btn') %>
73
57
  ```
74
58
 
75
- 7. Verify:
76
- - Open `https://rubygems.org/gems/redmineflux_icon_compat`
77
- - Install test:
59
+ Helper example:
78
60
 
79
- ```bash
80
- gem install redmineflux_icon_compat
61
+ ```ruby
62
+ rf_icon_link(:edit, l(:button_edit), edit_path(record))
81
63
  ```
82
64
 
83
- ## Ownership and Security (Recommended)
65
+ ### 6) Restart Redmine
84
66
 
85
- Add backup owners:
67
+ Restart the app server after gem/helper changes so code reload is clean.
86
68
 
87
- ```bash
88
- gem owner redmineflux_icon_compat --add teammate@example.com
89
- ```
69
+ ## Troubleshooting
90
70
 
91
- Require MFA on RubyGems account for push/yank.
71
+ If you still see old icons:
72
+ - clear cache: `rm -rf tmp/cache/*`
73
+ - reinstall dependencies: `bundle install`
74
+ - restart Redmine
75
+ - hard refresh browser (`Ctrl+Shift+R`)
92
76
 
93
- ## Consume Published Gem
77
+ ## Run Tests
94
78
 
95
- In plugin `Gemfile`:
79
+ From Redmine root:
96
80
 
97
- ```ruby
98
- gem 'redmineflux_icon_compat', '~> 0.1.0'
81
+ ```bash
82
+ ruby plugins/redmineflux_icon_compat/test/helper_test.rb
99
83
  ```
100
84
 
101
- Then:
85
+ From this gem directory:
102
86
 
103
87
  ```bash
104
- bundle install
88
+ ruby test/helper_test.rb
105
89
  ```
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RedminefluxIconCompat
4
+ # View helper methods for rendering icon links that work on both
5
+ # Redmine 5 (legacy CSS icons) and Redmine 6 (SVG sprite icons).
4
6
  module Helper
5
7
  RF_ICON_MAP = {
6
8
  delete: { legacy: 'del', sprite: 'del' },
@@ -10,7 +12,13 @@ module RedminefluxIconCompat
10
12
  save: { legacy: 'save', sprite: 'save' }
11
13
  }.freeze
12
14
 
13
- # Centralized icon-link renderer for Redmine 5/6 compatibility.
15
+ # Builds a link with icon markup compatible with Redmine 5/6.
16
+ #
17
+ # @param icon [Symbol, String] icon key (for example: :add, :edit, :delete)
18
+ # @param label [String] human readable label text
19
+ # @param href [String] target URL
20
+ # @param html_options [Hash] HTML options passed to +link_to+
21
+ # @return [String] HTML link markup
14
22
  def rf_icon_link(icon, label, href = '#', html_options = {})
15
23
  icon_names = rf_icon_names(icon)
16
24
  options = (html_options || {}).dup
@@ -26,7 +34,9 @@ module RedminefluxIconCompat
26
34
  link_to(content, href, options)
27
35
  end
28
36
 
29
- # Redmine 6+ provides sprite icons through IconsHelper#sprite_icon.
37
+ # Detects whether SVG sprite rendering is currently available.
38
+ #
39
+ # @return [Boolean]
30
40
  def rf_sprite_icons_available?
31
41
  respond_to?(:sprite_icon, true) || rf_global_sprite_helper_available?
32
42
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RedminefluxIconCompat
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.2'
5
5
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Entry point for the redmineflux_icon_compat gem.
3
4
  require_relative 'redmineflux_icon_compat/version'
4
5
  require_relative 'redmineflux_icon_compat/helper'
5
6
  require_relative 'redmineflux_icon_compat/railtie' if defined?(Rails::Railtie)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmineflux_icon_compat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Redmineflux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-16 00:00:00.000000000 Z
11
+ date: 2026-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -46,6 +46,7 @@ executables: []
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
+ - CHANGELOG.md
49
50
  - LICENSE.txt
50
51
  - README.md
51
52
  - lib/redmineflux_icon_compat.rb