healthicons 0.0.6 → 0.0.7

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: 8e266c4885c939c09e183e23d218c09c6d88ef4a9a9ce3b5c7d5660fd5d4db38
4
- data.tar.gz: 781a49c6f18352355f25871beb27d9336f373db2df7f34df8eacc8a8b60fd453
3
+ metadata.gz: cbd073520f4ddc99a699018401af47a004cff409d9e536a7673ba7405374c28a
4
+ data.tar.gz: 95f6d7d03b9694b1f4a80c61483e546ce07cd33cc5f4bfcff23e3e4853f2afb1
5
5
  SHA512:
6
- metadata.gz: 1ee468d4c6efecce55c320d9d6147fdde0efb418b78cc0e630eaf1f6d9e0ddffb2b828391db8825ea81b3d445d5d4570099ae8f6963335462d3535f2601909d1
7
- data.tar.gz: 57f2811c2469d3819bbed696dd5c46b4b45bb389169801f3e793295826dac423f0b5d7cac7fec85bcf5fcf9931a7d0a94a4700bf92d65402a9f5ea0cb40b3721
6
+ metadata.gz: 6553af313372e2ec25b5a4a3cdc1553f4b254f9b3b4c1b0c22dbef7b9e12ec6c6e249467b192b60ebe1b8fcaa739758e1dbe34481fd4a521d536f3dae9b11b96
7
+ data.tar.gz: 65f10c2e90b01597db234b23fb72205987ddd109ebb11704e20e916c29d9366692325abff58e7a2946185ae644a186b02a723aeead3ce551e6f7dd5c2936e02f
data/CHANGELOG.md CHANGED
@@ -1,12 +1,23 @@
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.7] - 2023-1130
9
+
10
+ - Resolve `Healthicons::Errors::UnknownIcon` not properly passing error message
11
+ - Update gemspec to support Rails 7+
12
+ - Update Gemfile.lock
13
+ - Include `activesupport/blank` require for some instances where `blank?` may be unavailable
14
+ - Resolve issue were tests are failing for some version of nokogiri
15
+ - Version bump
16
+
7
17
  ## [0.0.6] - 2021-11-15
8
18
 
9
19
  - 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.
20
+
10
21
  ## [0.0.5] - 2021-07-27
11
22
 
12
23
  - CHANGED: Updated icons to include healthicons latest SVG changes and newly added icons
@@ -14,8 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
25
 
15
26
  ## [0.0.4] - 2021-07-9
16
27
 
17
- - CHANGED: Removing adding varient attribute to SVG/XML when a variant is specified
18
- - FIXED: mispelling of `variant` so all icons were being defaulted to to `:outline`
28
+ - CHANGED: Removing adding variant attribute to SVG/XML when a variant is specified
29
+ - FIXED: misspelling of `variant` so all icons were being defaulted to to `:outline`
19
30
 
20
31
  ## [0.0.1] - 2021-06-30
21
32
 
@@ -7,7 +7,7 @@ module Healthicons
7
7
  #
8
8
  # @param icon [String]
9
9
  # @return [String]
10
- def initilize(icon = '')
10
+ def initialize(icon = '')
11
11
  msg = "The #{icon} icon could not be found."
12
12
  super(msg)
13
13
  end
@@ -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
@@ -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.open(file_path).read.force_encoding('UTF-8')
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 }.each do |key, val|
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Healthicons
4
- VERSION = '0.0.6'
4
+ VERSION = '0.0.7'
5
5
  end
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Hicks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-15 00:00:00.000000000 Z
11
+ date: 2023-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -1005,7 +1005,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1005
1005
  - !ruby/object:Gem::Version
1006
1006
  version: '0'
1007
1007
  requirements: []
1008
- rubygems_version: 3.2.11
1008
+ rubygems_version: 3.4.22
1009
1009
  signing_key:
1010
1010
  specification_version: 4
1011
1011
  summary: An application helper to add healthicon SVG icons to your applications views.