healthicons 0.0.6 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -2
- data/lib/healthicons/errors.rb +1 -1
- data/lib/healthicons/icon.rb +4 -2
- data/lib/healthicons/transform.rb +4 -2
- data/lib/healthicons/version.rb +1 -1
- data/lib/healthicons.rb +1 -0
- metadata +7 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e78cf0b59dca74e2430e2fa5237468c8efc00b1d9fa5fc22c494715673d5f902
|
4
|
+
data.tar.gz: a15835c21e2e923fdba6f91cb98ac7cafab10801e2dacdf3a754268ee69e08ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72d4ce80748594d311650ff5dc7524bbac9317746507d44c2585c73d97bc3c8a57f2c12b32b2c148b67abb2bbcf6f6c434edf4225093abc8cab06da77fb2340f
|
7
|
+
data.tar.gz: 9446a7ef89e4235109b3290fd7d24ea4cc3c7b89f589ef220d605b2a32604987ec8ce97063d6bcfdc5eaa32630cb21bf3cb641d048d5b8c1b1f462f858354c6e
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,28 @@
|
|
1
1
|
# Changelog
|
2
|
+
|
2
3
|
All notable changes to this project will be documented in this file.
|
3
4
|
|
4
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
7
|
|
8
|
+
## [0.0.8] - 2023-11-30
|
9
|
+
|
10
|
+
- More minor cleanup
|
11
|
+
|
12
|
+
## [0.0.7] - 2023-11-30
|
13
|
+
|
14
|
+
- Resolve `Healthicons::Errors::UnknownIcon` not properly passing error message
|
15
|
+
- Update gemspec to support Rails 7+
|
16
|
+
- Update Gemfile.lock
|
17
|
+
- Include `activesupport/blank` require for some instances where `blank?` may be unavailable
|
18
|
+
- Resolve issue were tests are failing for some version of nokogiri
|
19
|
+
- Version bump
|
20
|
+
- Added Github Actions with linters and tests
|
21
|
+
|
7
22
|
## [0.0.6] - 2021-11-15
|
8
23
|
|
9
24
|
- FIXED: When the icons SVG tags are parsed it should conver `<path />` to `<path></path>` to fix and issue with IE not recognising path as a self-closing tag.
|
25
|
+
|
10
26
|
## [0.0.5] - 2021-07-27
|
11
27
|
|
12
28
|
- CHANGED: Updated icons to include healthicons latest SVG changes and newly added icons
|
@@ -14,8 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
14
30
|
|
15
31
|
## [0.0.4] - 2021-07-9
|
16
32
|
|
17
|
-
- CHANGED: Removing adding
|
18
|
-
- FIXED:
|
33
|
+
- CHANGED: Removing adding variant attribute to SVG/XML when a variant is specified
|
34
|
+
- FIXED: misspelling of `variant` so all icons were being defaulted to to `:outline`
|
19
35
|
|
20
36
|
## [0.0.1] - 2021-06-30
|
21
37
|
|
data/lib/healthicons/errors.rb
CHANGED
data/lib/healthicons/icon.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'active_support/core_ext/object/blank'
|
4
|
+
|
3
5
|
module Healthicons
|
4
6
|
class Icon
|
5
7
|
VARIANTS = %i[outline solid].freeze
|
@@ -54,7 +56,7 @@ module Healthicons
|
|
54
56
|
''
|
55
57
|
else
|
56
58
|
# Removes filenames that start with `.svg`, `./`svg, '../svg', or '/svg'
|
57
|
-
"#{@name&.gsub(%r{^[
|
59
|
+
"#{@name&.gsub(%r{^[./]+/?}, '')}.svg"
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
@@ -74,7 +76,7 @@ module Healthicons
|
|
74
76
|
# @return [String] SVG/XML file contents
|
75
77
|
def svg_file_contents
|
76
78
|
@_svg_file_contents ||= if File.exist?(file_path)
|
77
|
-
File.
|
79
|
+
File.read(file_path).force_encoding('UTF-8')
|
78
80
|
else
|
79
81
|
raise Healthicons::Errors::UnknownIcon, "Icon '#{@name}' could not be found."
|
80
82
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'nokogiri'
|
4
|
+
require 'active_support/core_ext/object/blank'
|
4
5
|
|
5
6
|
module Healthicons
|
6
7
|
class Transform
|
7
|
-
DEFAULT_OPTIONS = { 'aria-hidden' => true, focusable: false, role: 'img', size: 24 }.freeze
|
8
|
+
DEFAULT_OPTIONS = { 'aria-hidden' => true, stroke: 'currentColor', focusable: false, role: 'img', size: 24 }.freeze
|
8
9
|
HEIGHT_AND_WIDTH = %i[height width].freeze
|
9
10
|
KEYS_TO_REMOVE = %i[height width variant viewbox xmlns].freeze
|
10
11
|
|
@@ -76,7 +77,8 @@ module Healthicons
|
|
76
77
|
return if @options.blank? || !options.is_a?(Hash)
|
77
78
|
|
78
79
|
set_size_and_width
|
79
|
-
@options.reject { |k| k == :size }
|
80
|
+
@options = @options.reject { |k| k == :size }
|
81
|
+
@options.each do |key, val|
|
80
82
|
set_icon_attribute(key, val)
|
81
83
|
end
|
82
84
|
end
|
data/lib/healthicons/version.rb
CHANGED
data/lib/healthicons.rb
CHANGED
@@ -7,6 +7,7 @@ require_relative 'healthicons/icon'
|
|
7
7
|
require_relative 'healthicons/transform' # Used for adding, modifying, and/or modifying attributes to the SVG icon
|
8
8
|
require_relative 'healthicons/rails/railtie' # Used to initialize and lazyload the applications views
|
9
9
|
require_relative 'healthicons/rails/view_helpers'
|
10
|
+
require 'active_support/core_ext/object/blank'
|
10
11
|
|
11
12
|
module Healthicons
|
12
13
|
class Error < StandardError; end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: healthicons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Hicks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -31,9 +31,6 @@ dependencies:
|
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3.0'
|
34
|
-
- - "<"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: '5.0'
|
37
34
|
type: :development
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -41,23 +38,20 @@ dependencies:
|
|
41
38
|
- - ">="
|
42
39
|
- !ruby/object:Gem::Version
|
43
40
|
version: '3.0'
|
44
|
-
- - "<"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '5.0'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: rubocop
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
50
44
|
requirements:
|
51
|
-
- - "
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.
|
47
|
+
version: '1.7'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
51
|
requirements:
|
58
|
-
- - "
|
52
|
+
- - ">="
|
59
53
|
- !ruby/object:Gem::Version
|
60
|
-
version: 1.
|
54
|
+
version: '1.7'
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
56
|
name: rails
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,9 +59,6 @@ dependencies:
|
|
65
59
|
- - ">="
|
66
60
|
- !ruby/object:Gem::Version
|
67
61
|
version: '4'
|
68
|
-
- - "<="
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: '7.0'
|
71
62
|
type: :runtime
|
72
63
|
prerelease: false
|
73
64
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -75,9 +66,6 @@ dependencies:
|
|
75
66
|
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '4'
|
78
|
-
- - "<="
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: '7.0'
|
81
69
|
- !ruby/object:Gem::Dependency
|
82
70
|
name: nokogiri
|
83
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1005,7 +993,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1005
993
|
- !ruby/object:Gem::Version
|
1006
994
|
version: '0'
|
1007
995
|
requirements: []
|
1008
|
-
rubygems_version: 3.
|
996
|
+
rubygems_version: 3.4.22
|
1009
997
|
signing_key:
|
1010
998
|
specification_version: 4
|
1011
999
|
summary: An application helper to add healthicon SVG icons to your applications views.
|