rails_icons 1.3.0 → 1.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: ea0d1a2d414fe4308cfd7a65732fe7422e9a1f10edab64f6673cf0a667ef351f
4
- data.tar.gz: 9fa4bab3788760957dce0e13135777fd9a432774fdd2172da077f9d716f5ed5e
3
+ metadata.gz: ae559df8ec6324c772dce7173e10984a680ef5997261a0e252129f80e6642794
4
+ data.tar.gz: b5d1771d610c7e2757703f3b066457b07a8caa0a3622e2829ac892d261ce349a
5
5
  SHA512:
6
- metadata.gz: 35389cf6c698b29f48229d34db04108c2471f8cb48f6e7b1d1dca8b812a381bcd6c1601fd39e360339aaa3487944130580881c2fa09323b9eeba1023be9714f3
7
- data.tar.gz: 5ce92e169233c6a19c6e2e6b626996436d2ddda6b0f1c1c2e14d8b20d58b0550ccbab7b47767cabd0f7106ef8646483abdbfca20a3a7dbaf25108746fbf6158c
6
+ metadata.gz: e4984a1423f44b7a4c57011f5f299f94ae46bc19411670b35c3a49bd295290d1bccdc86dc7824d1cc022326b5d22ea3a0356ef8ecce03d7ddd02f2fd595db1ab
7
+ data.tar.gz: 2d0e131f64176d49f4fbe23da5a7cf2adf230119735b462cb22b36aa38f06592b4887b86885db7420011ecac121e004b206ce4e4a4c82eca75997b0928033b19
data/Gemfile CHANGED
@@ -5,7 +5,8 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in rails_icons.gemspec
6
6
  gemspec
7
7
 
8
- gem "rails", "~> 7.0.6"
8
+ # gem "rails", "~> 7.0.6"
9
+ gem "appraisal"
9
10
  gem "propshaft"
10
11
 
11
12
  group :development do
data/Gemfile.lock CHANGED
@@ -1,99 +1,117 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_icons (1.3.0)
4
+ rails_icons (1.5.0)
5
5
  nokogiri (~> 1.16, >= 1.16.4)
6
- rails (> 6.1)
6
+ rails (>= 7.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (7.0.8.1)
12
- actionpack (= 7.0.8.1)
13
- activesupport (= 7.0.8.1)
11
+ actioncable (8.0.2)
12
+ actionpack (= 8.0.2)
13
+ activesupport (= 8.0.2)
14
14
  nio4r (~> 2.0)
15
15
  websocket-driver (>= 0.6.1)
16
- actionmailbox (7.0.8.1)
17
- actionpack (= 7.0.8.1)
18
- activejob (= 7.0.8.1)
19
- activerecord (= 7.0.8.1)
20
- activestorage (= 7.0.8.1)
21
- activesupport (= 7.0.8.1)
22
- mail (>= 2.7.1)
23
- net-imap
24
- net-pop
25
- net-smtp
26
- actionmailer (7.0.8.1)
27
- actionpack (= 7.0.8.1)
28
- actionview (= 7.0.8.1)
29
- activejob (= 7.0.8.1)
30
- activesupport (= 7.0.8.1)
31
- mail (~> 2.5, >= 2.5.4)
32
- net-imap
33
- net-pop
34
- net-smtp
35
- rails-dom-testing (~> 2.0)
36
- actionpack (7.0.8.1)
37
- actionview (= 7.0.8.1)
38
- activesupport (= 7.0.8.1)
39
- rack (~> 2.0, >= 2.2.4)
16
+ zeitwerk (~> 2.6)
17
+ actionmailbox (8.0.2)
18
+ actionpack (= 8.0.2)
19
+ activejob (= 8.0.2)
20
+ activerecord (= 8.0.2)
21
+ activestorage (= 8.0.2)
22
+ activesupport (= 8.0.2)
23
+ mail (>= 2.8.0)
24
+ actionmailer (8.0.2)
25
+ actionpack (= 8.0.2)
26
+ actionview (= 8.0.2)
27
+ activejob (= 8.0.2)
28
+ activesupport (= 8.0.2)
29
+ mail (>= 2.8.0)
30
+ rails-dom-testing (~> 2.2)
31
+ actionpack (8.0.2)
32
+ actionview (= 8.0.2)
33
+ activesupport (= 8.0.2)
34
+ nokogiri (>= 1.8.5)
35
+ rack (>= 2.2.4)
36
+ rack-session (>= 1.0.1)
40
37
  rack-test (>= 0.6.3)
41
- rails-dom-testing (~> 2.0)
42
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
43
- actiontext (7.0.8.1)
44
- actionpack (= 7.0.8.1)
45
- activerecord (= 7.0.8.1)
46
- activestorage (= 7.0.8.1)
47
- activesupport (= 7.0.8.1)
38
+ rails-dom-testing (~> 2.2)
39
+ rails-html-sanitizer (~> 1.6)
40
+ useragent (~> 0.16)
41
+ actiontext (8.0.2)
42
+ actionpack (= 8.0.2)
43
+ activerecord (= 8.0.2)
44
+ activestorage (= 8.0.2)
45
+ activesupport (= 8.0.2)
48
46
  globalid (>= 0.6.0)
49
47
  nokogiri (>= 1.8.5)
50
- actionview (7.0.8.1)
51
- activesupport (= 7.0.8.1)
48
+ actionview (8.0.2)
49
+ activesupport (= 8.0.2)
52
50
  builder (~> 3.1)
53
- erubi (~> 1.4)
54
- rails-dom-testing (~> 2.0)
55
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
56
- activejob (7.0.8.1)
57
- activesupport (= 7.0.8.1)
51
+ erubi (~> 1.11)
52
+ rails-dom-testing (~> 2.2)
53
+ rails-html-sanitizer (~> 1.6)
54
+ activejob (8.0.2)
55
+ activesupport (= 8.0.2)
58
56
  globalid (>= 0.3.6)
59
- activemodel (7.0.8.1)
60
- activesupport (= 7.0.8.1)
61
- activerecord (7.0.8.1)
62
- activemodel (= 7.0.8.1)
63
- activesupport (= 7.0.8.1)
64
- activestorage (7.0.8.1)
65
- actionpack (= 7.0.8.1)
66
- activejob (= 7.0.8.1)
67
- activerecord (= 7.0.8.1)
68
- activesupport (= 7.0.8.1)
57
+ activemodel (8.0.2)
58
+ activesupport (= 8.0.2)
59
+ activerecord (8.0.2)
60
+ activemodel (= 8.0.2)
61
+ activesupport (= 8.0.2)
62
+ timeout (>= 0.4.0)
63
+ activestorage (8.0.2)
64
+ actionpack (= 8.0.2)
65
+ activejob (= 8.0.2)
66
+ activerecord (= 8.0.2)
67
+ activesupport (= 8.0.2)
69
68
  marcel (~> 1.0)
70
- mini_mime (>= 1.1.0)
71
- activesupport (7.0.8.1)
72
- concurrent-ruby (~> 1.0, >= 1.0.2)
69
+ activesupport (8.0.2)
70
+ base64
71
+ benchmark (>= 0.3)
72
+ bigdecimal
73
+ concurrent-ruby (~> 1.0, >= 1.3.1)
74
+ connection_pool (>= 2.2.5)
75
+ drb
73
76
  i18n (>= 1.6, < 2)
77
+ logger (>= 1.4.2)
74
78
  minitest (>= 5.1)
75
- tzinfo (~> 2.0)
76
- ast (2.4.2)
77
- builder (3.2.4)
78
- concurrent-ruby (1.2.3)
79
+ securerandom (>= 0.3)
80
+ tzinfo (~> 2.0, >= 2.0.5)
81
+ uri (>= 0.13.1)
82
+ appraisal (2.5.0)
83
+ bundler
84
+ rake
85
+ thor (>= 0.14.0)
86
+ ast (2.4.3)
87
+ base64 (0.3.0)
88
+ benchmark (0.4.1)
89
+ bigdecimal (3.2.2)
90
+ builder (3.3.0)
91
+ concurrent-ruby (1.3.5)
92
+ connection_pool (2.5.3)
79
93
  crass (1.0.6)
80
- date (3.3.4)
81
- debug (1.9.2)
94
+ date (3.4.1)
95
+ debug (1.11.0)
82
96
  irb (~> 1.10)
83
97
  reline (>= 0.3.8)
84
- erubi (1.12.0)
98
+ drb (2.2.3)
99
+ erb (5.0.2)
100
+ erubi (1.13.1)
85
101
  globalid (1.2.1)
86
102
  activesupport (>= 6.1)
87
- i18n (1.14.4)
103
+ i18n (1.14.7)
88
104
  concurrent-ruby (~> 1.0)
89
- io-console (0.7.2)
90
- irb (1.12.0)
91
- rdoc
105
+ io-console (0.8.1)
106
+ irb (1.15.2)
107
+ pp (>= 0.6.0)
108
+ rdoc (>= 4.0.0)
92
109
  reline (>= 0.4.2)
93
- json (2.7.1)
94
- language_server-protocol (3.17.0.3)
110
+ json (2.13.0)
111
+ language_server-protocol (3.17.0.5)
95
112
  lint_roller (1.1.0)
96
- loofah (2.22.0)
113
+ logger (1.7.0)
114
+ loofah (2.24.1)
97
115
  crass (~> 1.0.2)
98
116
  nokogiri (>= 1.12.0)
99
117
  mail (2.8.1)
@@ -102,115 +120,134 @@ GEM
102
120
  net-pop
103
121
  net-smtp
104
122
  marcel (1.0.4)
105
- method_source (1.0.0)
106
123
  mini_mime (1.1.5)
107
- mini_portile2 (2.8.8)
108
- minitest (5.22.3)
109
- net-imap (0.4.10)
124
+ mini_portile2 (2.8.9)
125
+ minitest (5.25.5)
126
+ net-imap (0.5.9)
110
127
  date
111
128
  net-protocol
112
129
  net-pop (0.1.2)
113
130
  net-protocol
114
131
  net-protocol (0.2.2)
115
132
  timeout
116
- net-smtp (0.5.0)
133
+ net-smtp (0.5.1)
117
134
  net-protocol
118
- nio4r (2.7.1)
119
- nokogiri (1.18.3)
135
+ nio4r (2.7.4)
136
+ nokogiri (1.18.9)
120
137
  mini_portile2 (~> 2.8.2)
121
138
  racc (~> 1.4)
122
- nokogiri (1.18.3-arm64-darwin)
139
+ nokogiri (1.18.9-arm64-darwin)
140
+ racc (~> 1.4)
141
+ nokogiri (1.18.9-x86_64-linux-gnu)
123
142
  racc (~> 1.4)
124
- parallel (1.24.0)
125
- parser (3.3.0.5)
143
+ parallel (1.27.0)
144
+ parser (3.3.8.0)
126
145
  ast (~> 2.4.1)
127
146
  racc
128
- propshaft (0.8.0)
147
+ pp (0.6.2)
148
+ prettyprint
149
+ prettyprint (0.2.0)
150
+ prism (1.4.0)
151
+ propshaft (1.2.1)
129
152
  actionpack (>= 7.0.0)
130
153
  activesupport (>= 7.0.0)
131
154
  rack
132
- railties (>= 7.0.0)
133
- psych (5.1.2)
155
+ psych (5.2.6)
156
+ date
134
157
  stringio
135
158
  racc (1.8.1)
136
- rack (2.2.9)
137
- rack-test (2.1.0)
159
+ rack (3.1.16)
160
+ rack-session (2.1.1)
161
+ base64 (>= 0.1.0)
162
+ rack (>= 3.0.0)
163
+ rack-test (2.2.0)
138
164
  rack (>= 1.3)
139
- rails (7.0.8.1)
140
- actioncable (= 7.0.8.1)
141
- actionmailbox (= 7.0.8.1)
142
- actionmailer (= 7.0.8.1)
143
- actionpack (= 7.0.8.1)
144
- actiontext (= 7.0.8.1)
145
- actionview (= 7.0.8.1)
146
- activejob (= 7.0.8.1)
147
- activemodel (= 7.0.8.1)
148
- activerecord (= 7.0.8.1)
149
- activestorage (= 7.0.8.1)
150
- activesupport (= 7.0.8.1)
165
+ rackup (2.2.1)
166
+ rack (>= 3)
167
+ rails (8.0.2)
168
+ actioncable (= 8.0.2)
169
+ actionmailbox (= 8.0.2)
170
+ actionmailer (= 8.0.2)
171
+ actionpack (= 8.0.2)
172
+ actiontext (= 8.0.2)
173
+ actionview (= 8.0.2)
174
+ activejob (= 8.0.2)
175
+ activemodel (= 8.0.2)
176
+ activerecord (= 8.0.2)
177
+ activestorage (= 8.0.2)
178
+ activesupport (= 8.0.2)
151
179
  bundler (>= 1.15.0)
152
- railties (= 7.0.8.1)
153
- rails-dom-testing (2.2.0)
180
+ railties (= 8.0.2)
181
+ rails-dom-testing (2.3.0)
154
182
  activesupport (>= 5.0.0)
155
183
  minitest
156
184
  nokogiri (>= 1.6)
157
- rails-html-sanitizer (1.6.0)
185
+ rails-html-sanitizer (1.6.2)
158
186
  loofah (~> 2.21)
159
- nokogiri (~> 1.14)
160
- railties (7.0.8.1)
161
- actionpack (= 7.0.8.1)
162
- activesupport (= 7.0.8.1)
163
- method_source
187
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
188
+ railties (8.0.2)
189
+ actionpack (= 8.0.2)
190
+ activesupport (= 8.0.2)
191
+ irb (~> 1.13)
192
+ rackup (>= 1.0.0)
164
193
  rake (>= 12.2)
165
- thor (~> 1.0)
166
- zeitwerk (~> 2.5)
194
+ thor (~> 1.0, >= 1.2.2)
195
+ zeitwerk (~> 2.6)
167
196
  rainbow (3.1.1)
168
- rake (13.2.1)
169
- rdoc (6.6.3.1)
197
+ rake (13.3.0)
198
+ rdoc (6.14.2)
199
+ erb
170
200
  psych (>= 4.0.0)
171
- regexp_parser (2.9.0)
172
- reline (0.5.0)
201
+ regexp_parser (2.10.0)
202
+ reline (0.6.2)
173
203
  io-console (~> 0.5)
174
- rexml (3.2.6)
175
- rubocop (1.62.1)
204
+ rubocop (1.75.8)
176
205
  json (~> 2.3)
177
- language_server-protocol (>= 3.17.0)
206
+ language_server-protocol (~> 3.17.0.2)
207
+ lint_roller (~> 1.1.0)
178
208
  parallel (~> 1.10)
179
209
  parser (>= 3.3.0.2)
180
210
  rainbow (>= 2.2.2, < 4.0)
181
- regexp_parser (>= 1.8, < 3.0)
182
- rexml (>= 3.2.5, < 4.0)
183
- rubocop-ast (>= 1.31.1, < 2.0)
211
+ regexp_parser (>= 2.9.3, < 3.0)
212
+ rubocop-ast (>= 1.44.0, < 2.0)
184
213
  ruby-progressbar (~> 1.7)
185
- unicode-display_width (>= 2.4.0, < 3.0)
186
- rubocop-ast (1.31.2)
187
- parser (>= 3.3.0.4)
188
- rubocop-performance (1.20.2)
189
- rubocop (>= 1.48.1, < 2.0)
190
- rubocop-ast (>= 1.30.0, < 2.0)
214
+ unicode-display_width (>= 2.4.0, < 4.0)
215
+ rubocop-ast (1.46.0)
216
+ parser (>= 3.3.7.2)
217
+ prism (~> 1.4)
218
+ rubocop-performance (1.25.0)
219
+ lint_roller (~> 1.1)
220
+ rubocop (>= 1.75.0, < 2.0)
221
+ rubocop-ast (>= 1.38.0, < 2.0)
191
222
  ruby-progressbar (1.13.0)
192
- standard (1.35.1)
223
+ securerandom (0.4.1)
224
+ standard (1.50.0)
193
225
  language_server-protocol (~> 3.17.0.2)
194
226
  lint_roller (~> 1.0)
195
- rubocop (~> 1.62.0)
227
+ rubocop (~> 1.75.5)
196
228
  standard-custom (~> 1.0.0)
197
- standard-performance (~> 1.3)
229
+ standard-performance (~> 1.8)
198
230
  standard-custom (1.0.2)
199
231
  lint_roller (~> 1.0)
200
232
  rubocop (~> 1.50)
201
- standard-performance (1.3.1)
233
+ standard-performance (1.8.0)
202
234
  lint_roller (~> 1.1)
203
- rubocop-performance (~> 1.20.2)
204
- stringio (3.1.0)
205
- thor (1.3.1)
206
- timeout (0.4.1)
235
+ rubocop-performance (~> 1.25.0)
236
+ stringio (3.1.7)
237
+ thor (1.4.0)
238
+ timeout (0.4.3)
207
239
  tzinfo (2.0.6)
208
240
  concurrent-ruby (~> 1.0)
209
- unicode-display_width (2.5.0)
210
- websocket-driver (0.7.6)
241
+ unicode-display_width (3.1.4)
242
+ unicode-emoji (~> 4.0, >= 4.0.4)
243
+ unicode-emoji (4.0.4)
244
+ uri (1.0.3)
245
+ useragent (0.16.11)
246
+ websocket-driver (0.8.0)
247
+ base64
211
248
  websocket-extensions (>= 0.1.0)
212
249
  websocket-extensions (0.1.5)
213
- zeitwerk (2.6.13)
250
+ zeitwerk (2.7.3)
214
251
 
215
252
  PLATFORMS
216
253
  arm64-darwin-22
@@ -218,10 +255,10 @@ PLATFORMS
218
255
  x86_64-linux
219
256
 
220
257
  DEPENDENCIES
258
+ appraisal
221
259
  debug (~> 1.9, >= 1.9.2)
222
260
  minitest
223
261
  propshaft
224
- rails (~> 7.0.6)
225
262
  rails_icons!
226
263
  standard
227
264
 
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Add any icon library to a Rails app. Rails Icons has first-party support for a [handful of libraries](#first-party-libraries). It is library agnostic so it can be used with any icon library using the same interface.
4
4
 
5
+ ![Rails Icons - A collection of icons from popular libraries like Feather, Lucide, and Heroicons arranged in a grid pattern around the title text](https://raw.githubusercontent.com/Rails-Designer/rails_icons/HEAD/.github/cover.jpg)
6
+
5
7
  ```erb
6
8
  # Using the default icon library
7
9
  icon "check", class: "text-gray-500"
@@ -23,17 +25,15 @@ The icons are sourced directly from their respective GitHub repositories, ensuri
23
25
  </picture>
24
26
  </a>
25
27
 
26
- Want to make JavaScript your second-favorite language? 👉 [JavaScript for Rails Developers](https://javascriptforrails.com/)
27
-
28
28
 
29
29
  ## Install
30
30
 
31
- Add the gem
31
+ Add the gem:
32
32
  ```bash
33
33
  bundle add rails_icons
34
34
  ```
35
35
 
36
- Install, choosing one of the supported libraries
36
+ Install, choosing one of the supported libraries:
37
37
  ```bash
38
38
  rails generate rails_icons:install --libraries=LIBRARY_NAME
39
39
  ```
@@ -99,17 +99,17 @@ Rails Icons also includes a few animated icons. Great for loading states and so
99
99
  - `fading-dots`
100
100
  - `bouncing-dots`
101
101
 
102
- Use like this: `icon "faded-spinner", library: "animated"`. The same attributes as the others libraries are available.
102
+ Use like this: `icon "faded-spinner", library: "animated"`. The same attributes as the other libraries are available.
103
103
 
104
104
 
105
105
  ## Custom icon library
106
106
 
107
- Need to use an icon from another library?
107
+ Need to use an icon from another library (for example [Simple Icons](https://simpleicons.org/))?
108
108
 
109
109
  1. run `rails generate rails_icons:initializer --custom=simple_icons`;
110
- 2. add the (SVG) icons to the created directory *app/assets/svg/icons/simple_icons*;
110
+ 2. add the SVG icons to the created directory (*app/assets/svg/icons/simple_icons*);
111
111
 
112
- Every custom icon can now be used with the same interface as first-party icon libraries.
112
+ Every custom icon can now be used with the same interface as first-party icon libraries:
113
113
  ```ruby
114
114
  icon "apple", library: "simple_icons", class: "text-black"
115
115
  ```
@@ -117,12 +117,12 @@ icon "apple", library: "simple_icons", class: "text-black"
117
117
 
118
118
  ## Sync icons
119
119
 
120
- To sync all libraries, run
120
+ To sync all libraries, run:
121
121
  ```bash
122
122
  rails generate rails_icons:sync
123
123
  ```
124
124
 
125
- To sync only a specific library, run
125
+ To sync only a specific library, run:
126
126
  ```bash
127
127
  rails generate rails_icons:sync --libraries=heroicons
128
128
 
@@ -131,6 +131,13 @@ rails generate rails_icons:sync --libraries=heroicons lucide
131
131
  ```
132
132
 
133
133
 
134
+ ## Projects using Rails Icons
135
+
136
+ - [Rails Designer UI Components](https://railsdesigner.com/components/) — The first professionally-designed UI components library for Ruby on Rails apps
137
+ - [Helptail](https://helptail.com/) — Put your routine tasks on autopilot
138
+ - [Forge](https://forge.railsdesigner.com/) — Self-hosted Community Software
139
+
140
+
134
141
  ## Contributing
135
142
 
136
143
  This project uses [Standard](https://github.com/testdouble/standard) for formatting Ruby code. Please make sure to run `be standardrb` before submitting pull requests. Run tests via `rails test`.
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle fill="currentColor" stroke="none" cx="4" cy="12" r="2.5"><animateTransform attributeName="transform" dur="1s" type="translate" values="0 3.6 ; 0 -3.6; 0 3.6" repeatCount="indefinite" begin="0.1"></animateTransform></circle><circle fill="currentColor" stroke="none" cx="12" cy="12" r="2.5"><animateTransform attributeName="transform" dur="1s" type="translate" values="0 2.4 ; 0 -2.4; 0 2.4" repeatCount="indefinite" begin="0.2"></animateTransform></circle><circle fill="currentColor" stroke="none" cx="20" cy="12" r="2.5"><animateTransform attributeName="transform" dur="1s" type="translate" values="0 1.2 ; 0 -1.2; 0 1.2" repeatCount="indefinite" begin="0.3"></animateTransform></circle></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="4" cy="12" r="2.5" fill="currentColor"><animateTransform attributeName="transform" begin=".1" dur="1s" repeatCount="indefinite" type="translate" values="0 3.6 ; 0 -3.6; 0 3.6"/></circle><circle cx="12" cy="12" r="2.5" fill="currentColor"><animateTransform attributeName="transform" begin=".2" dur="1s" repeatCount="indefinite" type="translate" values="0 2.4 ; 0 -2.4; 0 2.4"/></circle><circle cx="20" cy="12" r="2.5" fill="currentColor"><animateTransform attributeName="transform" begin=".3" dur="1s" repeatCount="indefinite" type="translate" values="0 1.2 ; 0 -1.2; 0 1.2"/></circle></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" ><defs><style>@keyframes spin {to{transform:rotate(360deg);}}</style></defs><g style="transform-origin:center;animation:spin 1s linear infinite"><circle style="opacity: 0.25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" fill="none"/><path style="opacity: 0.75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"/></g></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" stroke-width="4" viewBox="0 0 24 24"><style>@keyframes spin{to{transform:rotate(360deg)}}</style><g style="transform-origin:center;animation:spin 1s linear infinite"><circle cx="12" cy="12" r="10" fill="none" stroke="currentColor" style="opacity:.25"/><path fill="none" stroke="currentColor" stroke-linecap="round" d="M12 2a10 10 0 0 1 10 10" style="opacity:.75"/></g></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle fill="currentColor" stroke="none" cx="4" cy="12" r="2.5"> <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1"></animate></circle><circle fill="currentColor" stroke="none" cx="12" cy="12" r="2.5"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.2"></animate></circle><circle fill="currentColor" stroke="none" cx="20" cy="12" r="2.5"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3"></animate></circle></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="4" cy="12" r="2.5" fill="currentColor"><animate attributeName="opacity" begin=".1" dur="1s" repeatCount="indefinite" values="0;1;0"/></circle><circle cx="12" cy="12" r="2.5" fill="currentColor"><animate attributeName="opacity" begin=".2" dur="1s" repeatCount="indefinite" values="0;1;0"/></circle><circle cx="20" cy="12" r="2.5" fill="currentColor"><animate attributeName="opacity" begin=".3" dur="1s" repeatCount="indefinite" values="0;1;0"/></circle></svg>
@@ -1 +1 @@
1
- <svg stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner{transform-origin:center; animation:spinner_outside 2s linear infinite}.spinner circle{stroke-linecap:round;animation:spinner_inside 1.5s ease-in-out infinite}@keyframes spinner_outside{100%{transform:rotate(360deg)}}@keyframes spinner_inside{0%{stroke-dasharray:0 150;stroke-dashoffset:0}47.5%{stroke-dasharray:42 150;stroke-dashoffset:-16}95%,100%{stroke-dasharray:42 150;stroke-dashoffset:-59}}</style><g class="spinner"><circle cx="12" cy="12" r="9.5" fill="none" stroke-width="4"></circle></g></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" stroke="currentColor" stroke-width="4" viewBox="0 0 24 24"><style>@keyframes spinner_outside{to{transform:rotate(360deg)}}@keyframes spinner_inside{0%{stroke-dasharray:0 150;stroke-dashoffset:0}47.5%{stroke-dasharray:42 150;stroke-dashoffset:-16}95%,to{stroke-dasharray:42 150;stroke-dashoffset:-59}}</style><g class="spinner" style="transform-origin:center;animation:spinner_outside 2s linear infinite"><circle cx="12" cy="12" r="9.5" fill="none" style="stroke-linecap:round;animation:spinner_inside 1.5s ease-in-out infinite"/></g></svg>
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsIcons
4
+ module IconHelper
5
+ def icon(name, library: RailsIcons.configuration.default_library, from: library, variant: nil, **arguments)
6
+ RailsIcons::Icon.new(
7
+ name: name,
8
+ library: from || library,
9
+ variant: variant,
10
+ arguments: arguments
11
+ ).svg
12
+ end
13
+
14
+ def encoded_icon(name, library: RailsIcons.configuration.default_library, from: library, variant: nil, **arguments)
15
+ svg_content = RailsIcons::Icon.new(
16
+ name: name,
17
+ library: from || library,
18
+ variant: variant,
19
+ arguments: arguments
20
+ ).svg
21
+
22
+ "data:image/svg+xml;base64,#{Base64.strict_encode64(svg_content)}"
23
+ end
24
+ end
25
+ end
@@ -9,7 +9,7 @@ module RailsIcons
9
9
  desc "Create the Rails Icons initializer."
10
10
 
11
11
  class_option :libraries, type: :array, default: [], desc: "Choose libraries (#{RailsIcons.libraries.keys.join("/")})"
12
- class_option :destination, type: :string, default: RailsIcons.configuration.destination_path, desc: "Specify destination folder for icons"
12
+ class_option :destination, type: :string, default: RailsIcons.configuration.icons_path, desc: "Specify icons folder"
13
13
  class_option :custom, type: :string, desc: "Name of the custom library"
14
14
 
15
15
  def copy_initializer
@@ -32,12 +32,12 @@ module RailsIcons
32
32
  end
33
33
  end
34
34
 
35
- def insert_custom_destination_path
36
- return if options[:destination] && options[:destination] == RailsIcons.configuration.destination_path
35
+ def insert_custom_icons_path
36
+ return if options[:destination] && options[:destination] == RailsIcons.configuration.icons_path
37
37
 
38
38
  insert_into_file INITIALIZER, <<~RB.indent(2), after: "RailsIcons.configure do |config|\n"
39
- # Default destination path
40
- config.destination_path = "#{options[:destination]}"
39
+ # Default icons path
40
+ config.icons_path = "#{options[:destination]}"
41
41
 
42
42
  RB
43
43
  end
@@ -60,19 +60,15 @@ module RailsIcons
60
60
  def insert_custom_configuration
61
61
  unless file_contains?(INITIALIZER, "config.libraries.merge!")
62
62
  custom_default_configuration = <<~RB.indent(2)
63
- config.libraries.merge!(
64
63
 
65
- {
66
- custom: {
67
- }
68
- }
64
+ config.libraries.merge!(
69
65
  )
70
66
  RB
71
67
 
72
68
  insert_into_file INITIALIZER, custom_default_configuration, before: "end"
73
69
  end
74
70
 
75
- insert_into_file INITIALIZER, "\n#{custom_configuration}", after: "custom: {"
71
+ insert_into_file INITIALIZER, "\n#{custom_configuration}", after: "config.libraries.merge!("
76
72
  end
77
73
 
78
74
  def create_custom_directory = FileUtils.mkdir_p(File.join(options[:destination], options[:custom]))
@@ -82,7 +78,7 @@ module RailsIcons
82
78
  end
83
79
 
84
80
  def custom_configuration
85
- <<~RB.indent(8)
81
+ <<~RB.indent(4)
86
82
  #{options[:custom]}: {
87
83
  # path: "app/assets/svg/icons/#{options[:custom]}/",
88
84
  default: {
@@ -99,5 +95,7 @@ module RailsIcons
99
95
  end
100
96
 
101
97
  def libraries = options[:libraries].map(&:downcase)
98
+
99
+ def validatable? = true
102
100
  end
103
101
  end
@@ -9,7 +9,7 @@ module RailsIcons
9
9
  desc "Install Rails Icons with the chosen libraries. This creates the configuration initializer and will sync the icons."
10
10
 
11
11
  class_option :libraries, type: :array, default: [], desc: "Choose libraries (#{RailsIcons.libraries.keys.join("/")})"
12
- class_option :destination, type: :string, default: RailsIcons.configuration.destination_path, desc: "Specify destination folder for icons"
12
+ class_option :destination, type: :string, default: RailsIcons.configuration.icons_path, desc: "Specify destination folder for icons"
13
13
  class_option :skip_sync, type: :boolean, default: false
14
14
 
15
15
  def initializer_generator
@@ -25,5 +25,7 @@ module RailsIcons
25
25
  private
26
26
 
27
27
  def attributes = ["--libraries=#{options[:libraries].map(&:downcase).join(" ")}", "--destination=#{options[:destination]}"].join(" ")
28
+
29
+ def validatable? = true
28
30
  end
29
31
  end
@@ -21,7 +21,7 @@ module RailsIcons
21
21
 
22
22
  def synced_libraries
23
23
  RailsIcons.libraries.keys.map(&:to_s).select do |library|
24
- Dir.exist?(File.join(RailsIcons.configuration.destination_path, library.to_s))
24
+ Dir.exist?(File.join(RailsIcons.configuration.icons_path, library.to_s))
25
25
  end
26
26
  end
27
27
  end
@@ -5,9 +5,9 @@ module RailsIcons
5
5
  hide!
6
6
 
7
7
  def initialize(*arguments)
8
- super(*arguments)
8
+ super
9
9
 
10
- validate!
10
+ validate! if validatable?
11
11
  end
12
12
 
13
13
  private
@@ -19,6 +19,8 @@ module RailsIcons
19
19
  raise RailsIcons::LibraryNotFound.new(invalid_libraries.join(", ")) if invalid_libraries.any?
20
20
  end
21
21
 
22
+ def validatable? = false
23
+
22
24
  def invalid_libraries = options.libraries.map(&:to_sym).map(&:downcase).reject { RailsIcons.libraries.key?(_1) }
23
25
 
24
26
  def custom_library? = options.custom.present?
@@ -17,6 +17,18 @@ module RailsIcons
17
17
  set_libraries_config
18
18
  end
19
19
 
20
+ def destination_path
21
+ ActiveSupport::Deprecation.new.warn("`destination_path` is deprecated. Use `icons_path` instead.")
22
+
23
+ @config.icons_path
24
+ end
25
+
26
+ def destination_path=(value)
27
+ ActiveSupport::Deprecation.new.warn("`destination_path=` is deprecated. Use `icons_path=` instead.")
28
+
29
+ @config.icons_path = value
30
+ end
31
+
20
32
  def method_missing(method_name, ...)
21
33
  if @config.respond_to?(method_name)
22
34
  @config.send(method_name, ...)
@@ -33,7 +45,7 @@ module RailsIcons
33
45
 
34
46
  def set_default_config
35
47
  @config.default_library = nil
36
- @config.destination_path = "app/assets/svg/icons"
48
+ @config.icons_path = "app/assets/svg/icons"
37
49
  end
38
50
 
39
51
  def set_libraries_config
@@ -46,7 +46,7 @@ module RailsIcons
46
46
 
47
47
  def parts
48
48
  [
49
- RailsIcons.configuration.destination_path,
49
+ RailsIcons.configuration.icons_path,
50
50
  @library,
51
51
  @variant,
52
52
  "#{@name}.svg"
@@ -2,8 +2,8 @@ require "rails_icons/icon/file_path"
2
2
  require "rails_icons/icon/attributes"
3
3
 
4
4
  class RailsIcons::Icon
5
- def initialize(name:, library:, arguments:, variant: nil, config: RailsIcons.configuration)
6
- @config = config # set first, config is used during initialization
5
+ def initialize(name:, library:, arguments:, variant: nil)
6
+ @config = RailsIcons.configuration
7
7
 
8
8
  @name = name
9
9
  @library = library.to_s.inquiry
@@ -57,20 +57,6 @@ class RailsIcons::Icon
57
57
  def default(key) = library_attributes.dig(:default, key)
58
58
 
59
59
  def library_attributes
60
- custom_library? ? custom_library : @config.libraries.dig(@library, @variant) || {}
60
+ @config.libraries.dig(*[@library, @variant].select(&:present?)) || {}
61
61
  end
62
-
63
- def custom_library
64
- RailsIcons
65
- .configuration
66
- .libraries
67
- &.dig("custom")
68
- &.dig(@library.to_sym)&.with_defaults(
69
- {
70
- path: [@config.destination_path, @library].join("/")
71
- }
72
- ) || {}
73
- end
74
-
75
- def custom_library? = custom_library.present?
76
62
  end
@@ -1,19 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rails_icons/helpers/icon_helper"
4
-
5
3
  module RailsIcons
6
4
  class Railtie < Rails::Railtie
7
- initializer "rails_icons.view_helpers" do
5
+ initializer "rails_icons.helpers" do
8
6
  ActiveSupport.on_load(:action_view) do
9
- include RailsIcons::Helpers::IconHelper
7
+ include RailsIcons::IconHelper
10
8
  end
11
9
  end
12
-
13
- initializer "rails_icons.assets" do |app|
14
- gem_root = Pathname.new(Gem.loaded_specs["rails_icons"].gem_dir)
15
-
16
- app.config.assets.paths << gem_root.join("app", "assets", "svg")
17
- end
18
10
  end
19
11
  end
@@ -39,7 +39,7 @@ module RailsIcons
39
39
  def clone_repository
40
40
  raise "[Rails Icons] Failed to clone repository" unless system("git clone '#{@library[:url]}' '#{@temp_directory}'")
41
41
 
42
- say "[Rails Icons] '#{@name}' repository cloned successfully."
42
+ say "[Rails Icons] '#{@name}' repository cloned"
43
43
  end
44
44
 
45
45
  def process_variants = Sync::ProcessVariants.new(@temp_directory, @name, @library).process
@@ -49,16 +49,16 @@ module RailsIcons
49
49
  .select { _1.file? && _1.extname != ".svg" }
50
50
  .each(&:delete)
51
51
 
52
- say "[Rails Icons] Non-SVG files removed successfully"
52
+ say "[Rails Icons] Non-SVG files removed"
53
53
  end
54
54
 
55
55
  def move_library
56
- destination = File.join(RailsIcons.configuration.destination_path, @name)
56
+ destination = File.join(RailsIcons.configuration.icons_path, @name)
57
57
 
58
58
  FileUtils.mkdir_p(destination)
59
59
  FileUtils.mv(Dir.glob("#{@temp_directory}/*"), destination, force: true)
60
60
 
61
- say "[Rails Icons] Synced '#{@name}' library successfully #{%w[😃 🎉 ✨].sample}", :green
61
+ say "[Rails Icons] Synced '#{@name}' library #{%w[😃 🎉 ✨].sample}", :green
62
62
  end
63
63
 
64
64
  def purge_temp_directory = FileUtils.rm_rf(TEMP_DIRECTORY)
@@ -64,7 +64,7 @@ module RailsIcons
64
64
 
65
65
  def remove_previously_downloaded(variants)
66
66
  variants.each do |variant|
67
- FileUtils.rm_rf(File.join(RailsIcons.configuration.destination_path, @name, variant.to_s))
67
+ FileUtils.rm_rf(File.join(RailsIcons.configuration.icons_path, @name, variant.to_s))
68
68
  end
69
69
  end
70
70
 
@@ -1,3 +1,3 @@
1
1
  module RailsIcons
2
- VERSION = "1.3.0"
2
+ VERSION = "1.5.0"
3
3
  end
data/rails_icons.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.files = Dir["{bin,app,config,db,lib,public}/**/*", "Rakefile", "README.md", "rails_icons.gemspec", "Gemfile", "Gemfile.lock"]
20
20
 
21
- spec.required_ruby_version = ">= 3.1.0"
22
- spec.add_dependency "rails", "> 6.1"
21
+ # spec.required_ruby_version = ">= 3.1.0"
22
+ spec.add_dependency "rails", ">= 7.0"
23
23
  spec.add_runtime_dependency "nokogiri", "~> 1.16", ">= 1.16.4"
24
24
  end
metadata CHANGED
@@ -1,29 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_icons
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rails Designer Developers
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-04-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">"
16
+ - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '6.1'
18
+ version: '7.0'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - ">"
23
+ - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '6.1'
25
+ version: '7.0'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: nokogiri
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -61,6 +60,7 @@ files:
61
60
  - app/assets/svg/rails_icons/icons/animated/faded-spinner.svg
62
61
  - app/assets/svg/rails_icons/icons/animated/fading-dots.svg
63
62
  - app/assets/svg/rails_icons/icons/animated/trailing-spinner.svg
63
+ - app/helpers/rails_icons/icon_helper.rb
64
64
  - bin/console
65
65
  - bin/rails
66
66
  - bin/release
@@ -86,7 +86,6 @@ files:
86
86
  - lib/rails_icons/configuration/weather.rb
87
87
  - lib/rails_icons/engine.rb
88
88
  - lib/rails_icons/errors.rb
89
- - lib/rails_icons/helpers/icon_helper.rb
90
89
  - lib/rails_icons/icon.rb
91
90
  - lib/rails_icons/icon/attributes.rb
92
91
  - lib/rails_icons/icon/file_path.rb
@@ -103,7 +102,6 @@ licenses:
103
102
  metadata:
104
103
  homepage_uri: https://railsdesigner.com/rails-icons/
105
104
  source_code_uri: https://github.com/Rails-Designer/rails_icons/
106
- post_install_message:
107
105
  rdoc_options: []
108
106
  require_paths:
109
107
  - lib
@@ -111,15 +109,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
109
  requirements:
112
110
  - - ">="
113
111
  - !ruby/object:Gem::Version
114
- version: 3.1.0
112
+ version: '0'
115
113
  required_rubygems_version: !ruby/object:Gem::Requirement
116
114
  requirements:
117
115
  - - ">="
118
116
  - !ruby/object:Gem::Version
119
117
  version: '0'
120
118
  requirements: []
121
- rubygems_version: 3.3.7
122
- signing_key:
119
+ rubygems_version: 3.6.9
123
120
  specification_version: 4
124
121
  summary: Add any icon library to a Rails app
125
122
  test_files: []
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "../configuration"
4
-
5
- module RailsIcons
6
- module Helpers
7
- module IconHelper
8
- def icon(name, library: RailsIcons.configuration.default_library, from: library, variant: nil, **arguments)
9
- RailsIcons::Icon.new(
10
- name: name,
11
- library: from || library,
12
- variant: variant,
13
- arguments: arguments
14
- ).svg
15
- end
16
- end
17
- end
18
- end