icon_kit 0.1.2 → 0.1.3
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/lib/icon_kit/engine.rb +1 -1
- data/lib/icon_kit.rb +0 -1
- metadata +2 -3
- data/lib/icon_kit/icons_helper.rb +0 -17
- /data/app/helpers/{icons_helper.rb → icon_kit/icons_helper.rb} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 77e1c94bf3728e17117a27fe606dc8a0dd5a34f354f50272e2ac799db56a9dc1
|
|
4
|
+
data.tar.gz: 56ebbeac6050f6f5f23ed9239a6003c62c971c461c073bd26d945730f19bba47
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 80d4bfa717d941290fecd9790b108893f3b5697e102bc5cbbc044dc8cdc9efb4e89f63eb3518a3cecdbfab7e7dc09f26f07b76622931ac1c550efbd6b06c255e
|
|
7
|
+
data.tar.gz: 5f746afec378a84ea5202054c353173279d290a08220f123538a425696fcb28c19f1d559062287224a812415a81f4d7a0e4df0114ce14437e24ae1f7a8014d8f
|
data/lib/icon_kit/engine.rb
CHANGED
|
@@ -2,9 +2,9 @@ module IconKit
|
|
|
2
2
|
class Engine < ::Rails::Engine
|
|
3
3
|
isolate_namespace IconKit
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
initializer "icon_kit.helpers" do
|
|
6
7
|
ActiveSupport.on_load(:action_controller) do
|
|
7
|
-
require 'icon_kit/icons_helper' unless defined?(IconKit::IconsHelper)
|
|
8
8
|
helper IconKit::IconsHelper
|
|
9
9
|
end
|
|
10
10
|
end
|
data/lib/icon_kit.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: icon_kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Phani Bhusan Mohanty
|
|
@@ -39,10 +39,9 @@ extra_rdoc_files: []
|
|
|
39
39
|
files:
|
|
40
40
|
- MIT-LICENSE
|
|
41
41
|
- README.md
|
|
42
|
-
- app/helpers/icons_helper.rb
|
|
42
|
+
- app/helpers/icon_kit/icons_helper.rb
|
|
43
43
|
- lib/icon_kit.rb
|
|
44
44
|
- lib/icon_kit/engine.rb
|
|
45
|
-
- lib/icon_kit/icons_helper.rb
|
|
46
45
|
- lib/icon_kit/version.rb
|
|
47
46
|
homepage: https://github.com/Phani2425/icon_kit
|
|
48
47
|
licenses:
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module IconKit
|
|
2
|
-
module IconsHelper
|
|
3
|
-
def icon_tag(name, size: IconKit.default_size, color: IconKit.default_color)
|
|
4
|
-
file_path = IconKit::Engine.root.join("app/assets/images/icons/#{name}.svg")
|
|
5
|
-
|
|
6
|
-
unless File.exist?(file_path)
|
|
7
|
-
Rails.logger.warn "[IconKit] SVG icon '#{name}' not found at #{file_path}"
|
|
8
|
-
return ""
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
svg_content = File.read(file_path)
|
|
12
|
-
svg_content = svg_content.gsub(/<svg/, "<svg class=\"#{size} #{color}\"")
|
|
13
|
-
|
|
14
|
-
svg_content.html_safe
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
File without changes
|