phlex-icons-bootstrap 2.0.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/generators/flag.rb +27 -0
- data/generators/helper.rb +5 -1
- data/generators/hero.rb +27 -0
- data/generators/tabler.rb +27 -0
- data/lib/phlex-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: 24dbf1ebcd49b39d74e9cb57eadcc178e4d6e7fd42c661e5da37eacda8248d57
|
4
|
+
data.tar.gz: 2934de76a99541b53833b4e0be9df9dacf2af93ffa30d9a253261323450ab656
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9290a51b511b795fe90ebd2b35da180d210ec5453741b98f266d8f1f730f99b9b146f607b8b73778989aa8b29f91b1724905258a289518234323b91698e09c87
|
7
|
+
data.tar.gz: bd6edcbb3207f6f8ca65167e766b991aaa69db00d63a964c9125debb39e5ae2daf2938afb0d0066c1bd8937510e24d21b17adc85e95dff0f5d7e0f55b9c44e81
|
data/generators/flag.rb
CHANGED
@@ -6,6 +6,7 @@ REPO_URL = 'https://github.com/lipis/flag-icons.git'
|
|
6
6
|
REPO_NAME = 'lipis-flag-icons'
|
7
7
|
ICONS_PACK_MODULE_PATH = 'lib/phlex-icons/flag.rb'
|
8
8
|
ICONS_PACK_PATH = 'lib/phlex-icons/flag'
|
9
|
+
VARIANTS = %i[square rectangle].freeze
|
9
10
|
|
10
11
|
TEMPLATE = ERB.new <<~TEMPLATE
|
11
12
|
# frozen_string_literal: true
|
@@ -27,6 +28,22 @@ TEMPLATE = ERB.new <<~TEMPLATE
|
|
27
28
|
# rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
|
28
29
|
TEMPLATE
|
29
30
|
|
31
|
+
VARIANT_TEMPLATE = ERB.new <<~VARIANT_TEMPLATE
|
32
|
+
# frozen_string_literal: true
|
33
|
+
|
34
|
+
# rubocop:disable #{ROBOCOP_DISABLE_WARNINGS}
|
35
|
+
module PhlexIcons
|
36
|
+
module Flag
|
37
|
+
class <%= icon_name %><%= variant.to_s.capitalize %> < Base
|
38
|
+
def view_template
|
39
|
+
render <%= icon_name %>.new(variant: :<%= variant %>)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
# rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
|
45
|
+
VARIANT_TEMPLATE
|
46
|
+
|
30
47
|
def main
|
31
48
|
run_generator do
|
32
49
|
new_version = JSON.parse(File.read("generators/#{REPO_NAME}/package.json"))['version']
|
@@ -49,6 +66,16 @@ def create_icon_component(icon_file_name)
|
|
49
66
|
rectangle_icon: read_and_convert_icon(rectangle_icon_file_path(icon_file_name))
|
50
67
|
)
|
51
68
|
)
|
69
|
+
|
70
|
+
VARIANTS.each do |variant|
|
71
|
+
File.write(
|
72
|
+
File.join(ICONS_PACK_PATH, variant_component_file_name(icon_file_name, variant)),
|
73
|
+
VARIANT_TEMPLATE.result_with_hash(
|
74
|
+
icon_name: component_class_name(icon_file_name),
|
75
|
+
variant: variant
|
76
|
+
)
|
77
|
+
)
|
78
|
+
end
|
52
79
|
end
|
53
80
|
|
54
81
|
def read_and_convert_icon(icon_file_path)
|
data/generators/helper.rb
CHANGED
@@ -73,6 +73,10 @@ def component_file_name(icon_file_name, replacements = nil)
|
|
73
73
|
"#{icon_name.gsub('-', '_')}.rb"
|
74
74
|
end
|
75
75
|
|
76
|
+
def variant_component_file_name(icon_file_name, variant)
|
77
|
+
"#{component_file_name(icon_file_name).gsub('.rb', '')}_#{variant.to_s.downcase}.rb"
|
78
|
+
end
|
79
|
+
|
76
80
|
def component_class_name(icon_file_name, replacements = nil)
|
77
81
|
replacements ||= {}
|
78
82
|
|
@@ -96,7 +100,7 @@ def make_components_lazy_loadable(path)
|
|
96
100
|
|
97
101
|
new_content = File.read("#{path}.rb").gsub(
|
98
102
|
/# auto-generated autoload: start.*# auto-generated autoload: end/m,
|
99
|
-
"# auto-generated autoload: start\n#{autoload_lines}\n
|
103
|
+
"# auto-generated autoload: start\n#{autoload_lines}\n # auto-generated autoload: end"
|
100
104
|
)
|
101
105
|
|
102
106
|
File.write("#{path}.rb", new_content)
|
data/generators/hero.rb
CHANGED
@@ -6,6 +6,7 @@ REPO_URL = 'https://github.com/tailwindlabs/heroicons.git'
|
|
6
6
|
REPO_NAME = 'tailwindlabs-heroicons'
|
7
7
|
ICONS_PACK_MODULE_PATH = 'lib/phlex-icons/hero.rb'
|
8
8
|
ICONS_PACK_PATH = 'lib/phlex-icons/hero'
|
9
|
+
VARIANTS = %i[solid outline].freeze
|
9
10
|
|
10
11
|
TEMPLATE = ERB.new <<~TEMPLATE
|
11
12
|
# frozen_string_literal: true
|
@@ -27,6 +28,22 @@ TEMPLATE = ERB.new <<~TEMPLATE
|
|
27
28
|
# rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
|
28
29
|
TEMPLATE
|
29
30
|
|
31
|
+
VARIANT_TEMPLATE = ERB.new <<~VARIANT_TEMPLATE
|
32
|
+
# frozen_string_literal: true
|
33
|
+
|
34
|
+
# rubocop:disable #{ROBOCOP_DISABLE_WARNINGS}
|
35
|
+
module PhlexIcons
|
36
|
+
module Hero
|
37
|
+
class <%= icon_name %><%= variant.to_s.capitalize %> < Base
|
38
|
+
def view_template
|
39
|
+
render <%= icon_name %>.new(variant: :<%= variant %>)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
# rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
|
45
|
+
VARIANT_TEMPLATE
|
46
|
+
|
30
47
|
def main
|
31
48
|
run_generator do
|
32
49
|
new_version = JSON.parse(File.read("generators/#{REPO_NAME}/package.json"))['version']
|
@@ -49,6 +66,16 @@ def create_icon_component(icon_file_name)
|
|
49
66
|
outline_icon: read_and_convert_icon(outline_icon_file_path(icon_file_name))
|
50
67
|
)
|
51
68
|
)
|
69
|
+
|
70
|
+
VARIANTS.each do |variant|
|
71
|
+
File.write(
|
72
|
+
File.join(ICONS_PACK_PATH, variant_component_file_name(icon_file_name, variant)),
|
73
|
+
VARIANT_TEMPLATE.result_with_hash(
|
74
|
+
icon_name: component_class_name(icon_file_name),
|
75
|
+
variant: variant
|
76
|
+
)
|
77
|
+
)
|
78
|
+
end
|
52
79
|
end
|
53
80
|
|
54
81
|
def read_and_convert_icon(icon_file_path)
|
data/generators/tabler.rb
CHANGED
@@ -6,6 +6,7 @@ REPO_URL = 'https://github.com/tabler/tabler-icons.git'
|
|
6
6
|
REPO_NAME = 'tabler-tabler-icons'
|
7
7
|
ICONS_PACK_MODULE_PATH = 'lib/phlex-icons/tabler.rb'
|
8
8
|
ICONS_PACK_PATH = 'lib/phlex-icons/tabler'
|
9
|
+
VARIANTS = %i[filled outline].freeze
|
9
10
|
|
10
11
|
TEMPLATE = ERB.new <<~TEMPLATE
|
11
12
|
# frozen_string_literal: true
|
@@ -27,6 +28,22 @@ TEMPLATE = ERB.new <<~TEMPLATE
|
|
27
28
|
# rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
|
28
29
|
TEMPLATE
|
29
30
|
|
31
|
+
VARIANT_TEMPLATE = ERB.new <<~VARIANT_TEMPLATE
|
32
|
+
# frozen_string_literal: true
|
33
|
+
|
34
|
+
# rubocop:disable #{ROBOCOP_DISABLE_WARNINGS}
|
35
|
+
module PhlexIcons
|
36
|
+
module Tabler
|
37
|
+
class <%= icon_name %><%= variant.to_s.capitalize %> < Base
|
38
|
+
def view_template
|
39
|
+
render <%= icon_name %>.new(variant: :<%= variant %>)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
# rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
|
45
|
+
VARIANT_TEMPLATE
|
46
|
+
|
30
47
|
def main
|
31
48
|
run_generator do
|
32
49
|
new_version = JSON.parse(File.read("generators/#{REPO_NAME}/package.json"))['version']
|
@@ -49,6 +66,16 @@ def create_icon_component(icon_file_name)
|
|
49
66
|
outline_icon: read_and_convert_icon(outline_icon_file_path(icon_file_name))
|
50
67
|
)
|
51
68
|
)
|
69
|
+
|
70
|
+
VARIANTS.each do |variant|
|
71
|
+
File.write(
|
72
|
+
File.join(ICONS_PACK_PATH, variant_component_file_name(icon_file_name, variant)),
|
73
|
+
VARIANT_TEMPLATE.result_with_hash(
|
74
|
+
icon_name: component_class_name(icon_file_name),
|
75
|
+
variant: variant
|
76
|
+
)
|
77
|
+
)
|
78
|
+
end
|
52
79
|
end
|
53
80
|
|
54
81
|
def read_and_convert_icon(icon_file_path)
|
data/lib/phlex-icons/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phlex-icons-bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.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-12-
|
11
|
+
date: 2024-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|