phlex-icons-hero 0.16.0 ā†’ 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6943668543a7559acc1fd13561cba5453b117da7eb0c2586548a34f9510693dc
4
- data.tar.gz: 6de7167a25715fb429b9cb230763184ef6cf82f87fb6bf30f0df60a519326d49
3
+ metadata.gz: 1b9ee7c665cfb1a834ed95631874f5550e9104d0fb5b8249844437382030dc53
4
+ data.tar.gz: d8948d465fb4bbaf3161cc4ff8c4b76a91caebf79016db7793d87d889082a3fd
5
5
  SHA512:
6
- metadata.gz: 1c9680ed445b6f2a3e6f23dee40c4a5577706799be9d7d4511e84cfdf904c635f08aea9227b1a57155b9324c6404ca9ee9be83748e04ef6973e58dd7a151f4e5
7
- data.tar.gz: b96ac5ab5deccfd85ee22dc3fd09bb5f5f6d286eb87731c36450fcba797b5826097a7f0e92ff184e17a6549bf972b1eef9be2b7179411467db887c37fe406a31
6
+ metadata.gz: d38fcb488aac3365125e61fa2ac8f8b0bf6200f0850a9210a630aaaa610a7ada2c1ebadfa22da498d4a58713371661c5f84f792bbbfe903d3479284c36aa4768
7
+ data.tar.gz: 9e1da194e3731cd7d27388785a5a56fe6c55e9103e711b5119f4f186b82b4c987310e55a01c6c2e94570b1fb82d9b7156df66d5ac31432842818d1e444728925
data/README.md CHANGED
@@ -124,7 +124,7 @@ Phlex::Icons::Tabler.configuration.default_variant = :outline # or :filled
124
124
  ### With `Phlex::Kit`
125
125
 
126
126
  ```ruby
127
- require 'phlex-icons'
127
+ require 'phlex-icons' # No need to require the gem if you are using it in a Rails application.
128
128
 
129
129
  class PhlexIcons < Phlex::HTML
130
130
  include Phlex::Icons
@@ -146,7 +146,7 @@ end
146
146
  ### Without `Phlex::Kit`
147
147
 
148
148
  ```ruby
149
- require 'phlex-icons'
149
+ require 'phlex-icons' # No need to require the gem if you are using it in a Rails application.
150
150
 
151
151
  class PhlexIcons < Phlex::HTML
152
152
  def view_template
@@ -172,8 +172,8 @@ Let's say you want to use only Heroicons and Flag Icons, you can use the followi
172
172
  Then, in your application, you can use the icons like this:
173
173
 
174
174
  ```ruby
175
- require 'phlex-icons-flag'
176
- require 'phlex-icons-hero'
175
+ require 'phlex-icons-flag' # No need to require the gem if you are using it in a Rails application.
176
+ require 'phlex-icons-hero' # No need to require the gem if you are using it in a Rails application.
177
177
 
178
178
  class PhlexIcons < Phlex::HTML
179
179
  include Phlex::Icons # If you want to use Phlex::Kit.
@@ -230,7 +230,7 @@ Now, you can use your custom icons like any other icon pack as described above.
230
230
 
231
231
  ## Update icon packs
232
232
 
233
- All icon packs provided in this gem are auto-generated by their generator under [`generators`](/generators) directory. You just need to clone the repo and run the generator for the icon pack you want to update. In future, I'm planning to add GitHub Actions to automatically generate the icon packs and update the gem.
233
+ All icon packs provided in this gem are auto-generated by their generator under [`generators`](/generators) directory. You just need to clone the repo and run the generator for the icon pack you want to update. Also, there is a GitHub Action that will run the generator for all icon packs and update the gem weekly on each Friday.
234
234
 
235
235
  ## Development
236
236
 
@@ -4,6 +4,7 @@ require_relative 'helper'
4
4
 
5
5
  REPO_URL = 'https://github.com/twbs/icons.git'
6
6
  REPO_NAME = 'twbs-icons'
7
+ ICONS_PACK_MODULE_PATH = 'lib/phlex/icons/bootstrap.rb'
7
8
  ICONS_PACK_PATH = 'lib/phlex/icons/bootstrap'
8
9
 
9
10
  TEMPLATE = ERB.new <<~TEMPLATE
@@ -39,7 +40,12 @@ REPLACEMENTS = {
39
40
  }.freeze
40
41
 
41
42
  def main
42
- run_generator { icon_file_paths.tqdm.each { create_icon_component(_1) } }
43
+ run_generator do
44
+ new_version = JSON.parse(File.read("generators/#{REPO_NAME}/package.json"))['version']
45
+ update_icon_path_version(new_version)
46
+
47
+ icon_file_paths.tqdm.each { create_icon_component(_1) }
48
+ end
43
49
  end
44
50
 
45
51
  def icon_file_paths
data/generators/flag.rb CHANGED
@@ -4,6 +4,7 @@ require_relative 'helper'
4
4
 
5
5
  REPO_URL = 'https://github.com/lipis/flag-icons.git'
6
6
  REPO_NAME = 'lipis-flag-icons'
7
+ ICONS_PACK_MODULE_PATH = 'lib/phlex/icons/flag.rb'
7
8
  ICONS_PACK_PATH = 'lib/phlex/icons/flag'
8
9
 
9
10
  TEMPLATE = ERB.new <<~TEMPLATE
@@ -29,7 +30,12 @@ TEMPLATE = ERB.new <<~TEMPLATE
29
30
  TEMPLATE
30
31
 
31
32
  def main
32
- run_generator { icon_file_names.tqdm.each { create_icon_component(_1) } }
33
+ run_generator do
34
+ new_version = JSON.parse(File.read("generators/#{REPO_NAME}/package.json"))['version']
35
+ update_icon_path_version(new_version)
36
+
37
+ icon_file_names.tqdm.each { create_icon_component(_1) }
38
+ end
33
39
  end
34
40
 
35
41
  def icon_file_names
data/generators/helper.rb CHANGED
@@ -55,6 +55,12 @@ def prepare_phlex_icons_pack_directory(icons_pack_path)
55
55
  puts "\e[2K\ršŸŽ‰ '#{icons_pack_path}' directory prepared successfully!"
56
56
  end
57
57
 
58
+ def update_icon_path_version(new_version)
59
+ content = File.read(ICONS_PACK_MODULE_PATH)
60
+ updated_content = content.sub(/VERSION = '.*'/, "VERSION = '#{new_version}'")
61
+ File.write(ICONS_PACK_MODULE_PATH, updated_content)
62
+ end
63
+
58
64
  def component_file_name(icon_file_name, replacements = nil)
59
65
  replacements ||= {}
60
66
 
data/generators/hero.rb CHANGED
@@ -4,6 +4,7 @@ require_relative 'helper'
4
4
 
5
5
  REPO_URL = 'https://github.com/tailwindlabs/heroicons.git'
6
6
  REPO_NAME = 'tailwindlabs-heroicons'
7
+ ICONS_PACK_MODULE_PATH = 'lib/phlex/icons/hero.rb'
7
8
  ICONS_PACK_PATH = 'lib/phlex/icons/hero'
8
9
 
9
10
  TEMPLATE = ERB.new <<~TEMPLATE
@@ -29,7 +30,12 @@ TEMPLATE = ERB.new <<~TEMPLATE
29
30
  TEMPLATE
30
31
 
31
32
  def main
32
- run_generator { icon_file_names.tqdm.each { create_icon_component(_1) } }
33
+ run_generator do
34
+ new_version = JSON.parse(File.read("generators/#{REPO_NAME}/package.json"))['version']
35
+ update_icon_path_version(new_version)
36
+
37
+ icon_file_names.tqdm.each { create_icon_component(_1) }
38
+ end
33
39
  end
34
40
 
35
41
  def icon_file_names
data/generators/lucide.rb CHANGED
@@ -4,6 +4,7 @@ require_relative 'helper'
4
4
 
5
5
  REPO_URL = 'https://github.com/lucide-icons/lucide.git'
6
6
  REPO_NAME = 'lucide-icons-lucide'
7
+ ICONS_PACK_MODULE_PATH = 'lib/phlex/icons/lucide.rb'
7
8
  ICONS_PACK_PATH = 'lib/phlex/icons/lucide'
8
9
 
9
10
  TEMPLATE = ERB.new <<~TEMPLATE
@@ -25,7 +26,15 @@ TEMPLATE = ERB.new <<~TEMPLATE
25
26
  TEMPLATE
26
27
 
27
28
  def main
28
- run_generator { icon_file_paths.tqdm.each { create_icon_component(_1) } }
29
+ run_generator do
30
+ cd_command = "cd generators/#{REPO_NAME}"
31
+ safe_directory_command = "git config --global --add safe.directory '*'"
32
+ get_latest_tag_command = 'git describe --tags --abbrev=0'
33
+ new_version = `#{cd_command} && #{safe_directory_command} && #{get_latest_tag_command}`.strip
34
+ update_icon_path_version(new_version)
35
+
36
+ icon_file_paths.tqdm.each { create_icon_component(_1) }
37
+ end
29
38
  end
30
39
 
31
40
  def icon_file_paths
data/generators/radix.rb CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  require_relative 'helper'
4
4
 
5
- REPO_URL = 'https://github.com/radix-ui/icons'
5
+ REPO_URL = 'https://github.com/radix-ui/icons.git'
6
6
  REPO_NAME = 'radix-ui-icons'
7
+ ICONS_PACK_MODULE_PATH = 'lib/phlex/icons/radix.rb'
7
8
  ICONS_PACK_PATH = 'lib/phlex/icons/radix'
8
9
 
9
10
  TEMPLATE = ERB.new <<~TEMPLATE
@@ -25,7 +26,12 @@ TEMPLATE = ERB.new <<~TEMPLATE
25
26
  TEMPLATE
26
27
 
27
28
  def main
28
- run_generator { icon_file_paths.tqdm.each { create_icon_component(_1) } }
29
+ run_generator do
30
+ new_version = JSON.parse(File.read("generators/#{REPO_NAME}/packages/radix-icons/package.json"))['version']
31
+ update_icon_path_version(new_version)
32
+
33
+ icon_file_paths.tqdm.each { create_icon_component(_1) }
34
+ end
29
35
  end
30
36
 
31
37
  def icon_file_paths
data/generators/remix.rb CHANGED
@@ -4,6 +4,7 @@ require_relative 'helper'
4
4
 
5
5
  REPO_URL = 'https://github.com/Remix-Design/RemixIcon.git'
6
6
  REPO_NAME = 'remix-design-remixicon'
7
+ ICONS_PACK_MODULE_PATH = 'lib/phlex/icons/remix.rb'
7
8
  ICONS_PACK_PATH = 'lib/phlex/icons/remix'
8
9
 
9
10
  TEMPLATE = ERB.new <<~TEMPLATE
@@ -30,7 +31,12 @@ REPLACEMENTS = {
30
31
  }.freeze
31
32
 
32
33
  def main
33
- run_generator { icon_file_paths.tqdm.each { create_icon_component(_1) } }
34
+ run_generator do
35
+ new_version = JSON.parse(File.read("generators/#{REPO_NAME}/package.json"))['version']
36
+ update_icon_path_version(new_version)
37
+
38
+ icon_file_paths.tqdm.each { create_icon_component(_1) }
39
+ end
34
40
  end
35
41
 
36
42
  def icon_file_paths
data/generators/tabler.rb CHANGED
@@ -4,6 +4,7 @@ require_relative 'helper'
4
4
 
5
5
  REPO_URL = 'https://github.com/tabler/tabler-icons.git'
6
6
  REPO_NAME = 'tabler-tabler-icons'
7
+ ICONS_PACK_MODULE_PATH = 'lib/phlex/icons/tabler.rb'
7
8
  ICONS_PACK_PATH = 'lib/phlex/icons/tabler'
8
9
 
9
10
  TEMPLATE = ERB.new <<~TEMPLATE
@@ -29,7 +30,12 @@ TEMPLATE = ERB.new <<~TEMPLATE
29
30
  TEMPLATE
30
31
 
31
32
  def main
32
- run_generator { icon_file_names.tqdm.each { create_icon_component(_1) } }
33
+ run_generator do
34
+ new_version = JSON.parse(File.read("generators/#{REPO_NAME}/package.json"))['version']
35
+ update_icon_path_version(new_version)
36
+
37
+ icon_file_names.tqdm.each { create_icon_component(_1) }
38
+ end
33
39
  end
34
40
 
35
41
  def icon_file_names
@@ -3,6 +3,8 @@
3
3
  module Phlex
4
4
  module Icons
5
5
  module Hero # rubocop:disable Metrics/ModuleLength
6
+ VERSION = '2.1.5'
7
+
6
8
  extend Phlex::Kit
7
9
 
8
10
  require_relative 'hero/base'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlex
4
4
  module Icons
5
- VERSION = '0.16.0'
5
+ VERSION = '0.17.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlex-icons-hero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ali Hamdi Ali Fadel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-03 00:00:00.000000000 Z
11
+ date: 2024-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex