fa_rails 0.1.27 → 0.1.28

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: 79592033f8cde3a69b9c151928289df8ea5564c6657c3c32aba9464ea5a80014
4
- data.tar.gz: 5e30a6766b53e7563dd1759656ab04e50720fb270e72509196fbdb1045bf9813
3
+ metadata.gz: 9670b89c2000c40f98e40430780d4dfa64333f9f2ae3eae8ede2e971473e29f3
4
+ data.tar.gz: ec45f70df4df7dc76f5ef6003189231dbb62e378cb3b56b6f521e4c09da91dc3
5
5
  SHA512:
6
- metadata.gz: a43c475dd94f739d326a2f855f69bd525d47935113eb77a193787eded0879bee3985548da66fa99a1628b9fc9afe04ceba9ee63e450cc2b94d03b3f855a42b8d
7
- data.tar.gz: 45338d64be37baddb0ef1802a0b13a8338d304104305e262ec2f201dbb5009bea8f2c3f5afdfbf3ccd9f561a66c182cd8923a3b768e5e16a00103d4039f396c6
6
+ metadata.gz: aae23259c630902cdeea637fdb22aea29a1e150f868d045bd37912d3494bef1b1b1fba93a353655941613207aedf775af896f191b02757ff730bcf7fc3f986ac
7
+ data.tar.gz: f637e25cef5d2b3ed29bb973a28ddff3072d2f6f69bbe2601473a1009d9b57f4a045d76e5fc01c5108a0b6ba4e67613699147006fef6d5e03849a3de35c46e89
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fa_rails (0.1.27)
4
+ fa_rails (0.1.28)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/fa_rails.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'fa_rails'
3
- s.version = '0.1.27'
4
- s.date = '2021-05-26'
3
+ s.version = '0.1.28'
4
+ s.date = '2022-09-01'
5
5
  s.summary = 'FontAwesome helper for Rails'
6
6
  s.description = 'A helper module for using FontAwesome icons in Rails.'
7
7
  s.homepage = 'http://rubygems.org/gems/fa_rails'
data/lib/fa/base.rb CHANGED
@@ -1,13 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FA
4
- # FontAwesome 5 (Pro) Helper core class for inheritance
4
+ # FontAwesome 6 (Pro) Helper core class for inheritance
5
5
  class Base
6
6
  STYLES = {
7
+ nil => 's',
7
8
  solid: 's', regular: 'r', light: 'l', thin: 't',
8
9
  duotone: 'd', brands: 'b', kit_upload: 'k'
9
10
  }.freeze
10
11
 
12
+ MODES = {
13
+ nil => '',
14
+ sharp: 's'
15
+ }.freeze
16
+
11
17
  # Outputs the formatted string directly.
12
18
  def raw
13
19
  #
@@ -141,9 +147,10 @@ module FA
141
147
 
142
148
  def parse_style(options)
143
149
  return if options[:css].to_s.match?(/\bfa[#{STYLES.values.join}]\b/)
144
- return 'fas' unless STYLES.keys.include?(options[:style])
145
150
 
146
- 'fa' + STYLES[options[:style]]
151
+ style = 'fa'
152
+ style += STYLES[options[:style]]
153
+ style += MODES[options[:mode]]
147
154
  end
148
155
  end
149
156
  end
data/spec/lib/fa_spec.rb CHANGED
@@ -91,6 +91,12 @@ RSpec.describe FA do
91
91
  )
92
92
  end
93
93
 
94
+ it 'generates the correct sharp icon' do
95
+ expect(FA::Icon.p(:house, mode: :sharp)).to eql(
96
+ "<i class='fass fa-house fa-1x' style='' data-fa-transform='' title=''></i>"
97
+ )
98
+ end
99
+
94
100
  it 'should generate the correct icon with styles' do
95
101
  expect(
96
102
  FA::Icon.p(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fa_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.27
4
+ version: 0.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-26 00:00:00.000000000 Z
11
+ date: 2022-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -114,8 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubyforge_project:
118
- rubygems_version: 2.7.6
117
+ rubygems_version: 3.2.30
119
118
  signing_key:
120
119
  specification_version: 4
121
120
  summary: FontAwesome helper for Rails