icons 0.6.0 → 0.7.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: 51e3e16d162ac808ec00a952e454e2abf791b46271104dd8358903b1b024afe9
4
- data.tar.gz: eed4b6e42ab224d3536df61ddea19655306db57abfe65f5d4900faf0255217f8
3
+ metadata.gz: cb1944e491a1d63e48a5ad200b05f35545efa9e6faef2beafa92cb36422e510c
4
+ data.tar.gz: fa1028a4ce3e7ff85ab6dbd19a26937d898a8a01851bd965b32862917bcfd379
5
5
  SHA512:
6
- metadata.gz: b9a8dd5fb810c3e42f3b1adb9ff8e15742fc3fc231aa34d95629b6d81305ea82da49709bd1ed1e1027c2cd346a186e529ddfa8a42e74e81bde9a165f7901c735
7
- data.tar.gz: 48403f58263e32d07a966ee02bd2027d5c6d85f89bcfd46b795dcdb9a92055c4c2bfc532b4244ad73bc67e0fe31d3d39c4f4bb4943dcef3eb25aac20193dc403
6
+ metadata.gz: 37747df5216a66b21086e818f509eca4cd630640de96da40ea99f131720684b9719039d563e7471664a6b8f9a61ef8dde597abcf0e80de0dfeda9071102f07ef
7
+ data.tar.gz: a21cb21a0701422e5d0e431d3449568c3e3956bbdd9edac95417aa16c58077ce734131e195d4f77bcb8a1186b441eaff4cd22de798443eeb1287328d575e12c7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- icons (0.6.0)
4
+ icons (0.7.0)
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.6.0)
122
+ icons (0.7.0)
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
@@ -18,18 +18,21 @@ bundle install
18
18
 
19
19
  ## Usage
20
20
 
21
- The core gem is designed to be configured by higher-level layers but can be used directly if needed.
21
+ The core gem is designed to be configured by higher-level layers (as seen with [rails_icons](https://github.com/Rails-Designer/rails_icons)) but can be used directly if needed.
22
22
 
23
23
  Example:
24
24
  ```ruby
25
25
  Icons.configure do |config|
26
26
  config.icons_path = "app/assets/svg/icons"
27
- config.default_library = :feather
27
+ config.default_library = :lucide
28
28
  config.default_variant = :outline
29
29
  end
30
30
 
31
+ # Sync any library from their respective (GitHub) repository
32
+ Icons::Sync.new("lucide").now
33
+
31
34
  # Render an icon
32
- icon = Icons::Icon.new(name: "check", library: "feather", arguments: { class: "text-gray-500" }, variant: "outline")
35
+ icon = Icons::Icon.new(name: "check", library: "lucide", variant: "outline", arguments: { class: "text-gray-500" })
33
36
  svg = icon.svg
34
37
  ```
35
38
 
@@ -38,17 +41,17 @@ The resulting SVG will include the proper attributes and the SVG content from th
38
41
 
39
42
  ## First-party libraries
40
43
 
41
- - boxicons
42
- - feather
43
- - flags
44
- - heroicons
45
- - linear
46
- - lucide
47
- - phosphor
48
- - radix
49
- - sidekickicons
50
- - tabler
51
- - weather
44
+ - [Boxicons](https://railsdesigner.com/rails-icons/boxicons/) (1600+ icons)
45
+ - [Feather](https://railsdesigner.com/rails-icons/feather/) (280+ icons)
46
+ - [Flags](https://railsdesigner.com/rails-icons/flags/) (540+ icons)
47
+ - [Heroicons](https://railsdesigner.com/rails-icons/heroicons/) (300+ icons)
48
+ - [Linear](https://railsdesigner.com/rails-icons/linear/) (170+ icons)
49
+ - [Lucide](https://railsdesigner.com/rails-icons/lucide/) (1500+ icons)
50
+ - [Phosphor](https://railsdesigner.com/rails-icons/phosphor/) (9000+ icons)
51
+ - [Radix](https://railsdesigner.com/rails-icons/radix/) (300+ icons)
52
+ - [SidekickIcons](https://railsdesigner.com/rails-icons/sidekickicons/) (49 icons, complementing [Heroicons](https://railsdesigner.com/rails-icons/heroicons/))
53
+ - [Tabler](https://railsdesigner.com/rails-icons/tabler/) (5700+ icons)
54
+ - [Weather](https://railsdesigner.com/rails-icons/weather/) (215+ icons)
52
55
 
53
56
 
54
57
  ## Libraries using Icons
@@ -20,11 +20,7 @@ module Icons
20
20
 
21
21
  return custom_library_path if custom_library?
22
22
 
23
- icon_path = icons_path_in_app
24
-
25
- raise Icons::IconNotFound if icon_path.nil?
26
-
27
- icon_path
23
+ app_path
28
24
  end
29
25
 
30
26
  private
@@ -51,12 +47,6 @@ module Icons
51
47
  Icons.config.base_path.join(library_config.custom_path, "#{@name}.svg")
52
48
  end
53
49
 
54
- def icons_path_in_app
55
- path = app_path
56
-
57
- path if File.exist?(path)
58
- end
59
-
60
50
  def app_path
61
51
  Icons.config.base_path.join(*parts)
62
52
  end
data/lib/icons/icon.rb CHANGED
@@ -16,12 +16,12 @@ class Icons::Icon
16
16
  end
17
17
 
18
18
  def svg
19
- raise Icons::IconNotFound, error_message unless File.exist?(file_path)
20
-
21
19
  Nokogiri::HTML::DocumentFragment.parse(File.read(file_path))
22
20
  .at_css("svg")
23
21
  .tap { |svg| attach_attributes(to: svg) }
24
22
  .to_html
23
+ rescue Errno::ENOENT
24
+ raise Icons::IconNotFound, error_message
25
25
  end
26
26
 
27
27
  private
data/lib/icons/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Icons
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
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.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rails Designer
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubygems_version: 4.0.4
95
+ rubygems_version: 4.0.6
96
96
  specification_version: 4
97
97
  summary: Add any icon library to a Ruby app
98
98
  test_files: []