icons 0.8.0 → 0.8.1
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/Gemfile.lock +2 -2
- data/README.md +1 -0
- data/lib/icons/icon/attributes.rb +0 -2
- data/lib/icons/icon/file_path.rb +8 -7
- data/lib/icons/icon.rb +5 -4
- data/lib/icons/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 258de5224f1792f19bc6024149d3b83796c215fb2dafcdb4ad832817396fa497
|
|
4
|
+
data.tar.gz: 735659b38f49f975bfd758c7260e7ea5ac56971a9cd3942293b8f0ae2c240f3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62fa8a1399597b1e99e524f16db444af2680a42e23b5b86d938ed9855fa0859e134f2810aed56d51e398e79f366c71a9106bd12de70e0f62a26ccdbe449e1e32
|
|
7
|
+
data.tar.gz: 233185f2705e719ec0230091aec8b2390a70e7ea74bdbe09376942388fa6db1dbf5ab6f5757afbf5fab89f5f83b0c7ce90c2a72ea732a9dfc52ac5e96db1f6cc
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
icons (0.8.
|
|
4
|
+
icons (0.8.1)
|
|
5
5
|
nokogiri (~> 1.16, >= 1.16.4)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -119,7 +119,7 @@ CHECKSUMS
|
|
|
119
119
|
date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
|
|
120
120
|
debug (1.11.1) sha256=2e0b0ac6119f2207a6f8ac7d4a73ca8eb4e440f64da0a3136c30343146e952b6
|
|
121
121
|
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
|
|
122
|
-
icons (0.8.
|
|
122
|
+
icons (0.8.1)
|
|
123
123
|
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
|
|
124
124
|
irb (1.16.0) sha256=2abe56c9ac947cdcb2f150572904ba798c1e93c890c256f8429981a7675b0806
|
|
125
125
|
json (2.18.0) sha256=b10506aee4183f5cf49e0efc48073d7b75843ce3782c68dbeb763351c08fd505
|
data/README.md
CHANGED
|
@@ -45,6 +45,7 @@ The resulting SVG will include the proper attributes and the SVG content from th
|
|
|
45
45
|
- [Feather](https://railsdesigner.com/open-source/rails-icons/feather/) (280+ icons)
|
|
46
46
|
- [Flags](https://railsdesigner.com/open-source/rails-icons/flags/) (540+ icons)
|
|
47
47
|
- [Heroicons](https://railsdesigner.com/open-source/rails-icons/heroicons/) (300+ icons)
|
|
48
|
+
- [Hugeicons](https://railsdesigner.com/open-source/rails-icons/hugeicons/) (4600+ icons)
|
|
48
49
|
- [Linear](https://railsdesigner.com/open-source/rails-icons/linear/) (170+ icons)
|
|
49
50
|
- [Lucide](https://railsdesigner.com/open-source/rails-icons/lucide/) (1500+ icons)
|
|
50
51
|
- [Phosphor](https://railsdesigner.com/open-source/rails-icons/phosphor/) (9000+ icons)
|
|
@@ -28,7 +28,6 @@ module Icons
|
|
|
28
28
|
def token_list(value)
|
|
29
29
|
case value
|
|
30
30
|
when Array
|
|
31
|
-
# Flatten and process each element
|
|
32
31
|
value.flatten.map { |v|
|
|
33
32
|
if v.is_a?(Hash)
|
|
34
33
|
v.select { |_, val| val }.keys.map(&:to_s).join(" ")
|
|
@@ -37,7 +36,6 @@ module Icons
|
|
|
37
36
|
end
|
|
38
37
|
}.compact.reject(&:empty?).join(" ")
|
|
39
38
|
when Hash
|
|
40
|
-
# Handle both string and symbol keys, filter truthy values
|
|
41
39
|
value.select { |_, v| v }.keys.map(&:to_s).join(" ")
|
|
42
40
|
else
|
|
43
41
|
value.to_s
|
data/lib/icons/icon/file_path.rb
CHANGED
|
@@ -7,8 +7,8 @@ module Icons
|
|
|
7
7
|
class FilePath
|
|
8
8
|
def initialize(name:, library:, variant:)
|
|
9
9
|
@name = name
|
|
10
|
-
@library = library.
|
|
11
|
-
@variant = variant
|
|
10
|
+
@library = library.to_sym
|
|
11
|
+
@variant = variant&.to_sym
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def call
|
|
@@ -26,7 +26,7 @@ module Icons
|
|
|
26
26
|
private
|
|
27
27
|
|
|
28
28
|
def animated_library?
|
|
29
|
-
@library ==
|
|
29
|
+
@library == :animated
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def animated_icons_path
|
|
@@ -39,11 +39,12 @@ module Icons
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def custom_library?
|
|
42
|
-
Icons.libraries[@library
|
|
42
|
+
Icons.libraries[@library]&.respond_to?(:custom_path)
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def custom_library_path
|
|
46
|
-
library_config = Icons.libraries[@library
|
|
46
|
+
library_config = Icons.libraries[@library]
|
|
47
|
+
|
|
47
48
|
Icons.config.base_path.join(library_config.custom_path, "#{@name}.svg")
|
|
48
49
|
end
|
|
49
50
|
|
|
@@ -54,8 +55,8 @@ module Icons
|
|
|
54
55
|
def parts
|
|
55
56
|
[
|
|
56
57
|
Icons.configuration.icons_path,
|
|
57
|
-
@library,
|
|
58
|
-
(@variant unless @variant == "."),
|
|
58
|
+
@library.to_s,
|
|
59
|
+
(@variant&.to_s unless @variant == :"."), # Don't include "." as a directory
|
|
59
60
|
"#{@name}.svg"
|
|
60
61
|
].compact.reject { |p| p.to_s.empty? }
|
|
61
62
|
end
|
data/lib/icons/icon.rb
CHANGED
|
@@ -10,8 +10,8 @@ class Icons::Icon
|
|
|
10
10
|
@config = Icons.configuration
|
|
11
11
|
|
|
12
12
|
@name = name
|
|
13
|
-
@library = library.
|
|
14
|
-
@variant = (variant || set_variant)
|
|
13
|
+
@library = library.to_sym
|
|
14
|
+
@variant = (variant || set_variant)&.to_sym
|
|
15
15
|
@arguments = arguments
|
|
16
16
|
end
|
|
17
17
|
|
|
@@ -27,7 +27,7 @@ class Icons::Icon
|
|
|
27
27
|
private
|
|
28
28
|
|
|
29
29
|
def set_variant
|
|
30
|
-
value = @config.libraries.dig(@library
|
|
30
|
+
value = @config.libraries.dig(@library, :default_variant) ||
|
|
31
31
|
@config.default_variant
|
|
32
32
|
|
|
33
33
|
value.to_s.empty? ? nil : value
|
|
@@ -66,7 +66,8 @@ class Icons::Icon
|
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
def library_attributes
|
|
69
|
-
keys = [@library, @variant].compact
|
|
69
|
+
keys = [@library, @variant].compact
|
|
70
|
+
|
|
70
71
|
@config.libraries.dig(*keys) || {}
|
|
71
72
|
end
|
|
72
73
|
end
|
data/lib/icons/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: icons
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rails Designer
|
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
94
|
version: '0'
|
|
95
95
|
requirements: []
|
|
96
|
-
rubygems_version: 4.0.
|
|
96
|
+
rubygems_version: 4.0.8
|
|
97
97
|
specification_version: 4
|
|
98
98
|
summary: Add any icon library to a Ruby app
|
|
99
99
|
test_files: []
|