uriji-icons-rails 2.3.0 → 2.5.0

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.
@@ -1,9 +1,13 @@
1
1
  module UrijiIcons
2
2
  module Rails
3
- # IconHelper methods for Uriji Icons
4
3
  module IconHelper
5
- # Creates an icon tag given an icon name and possible icon
6
- # modifiers.
4
+ COLOR_ICONS = {
5
+ 'bell': 10,
6
+ 'comments-dots': 8,
7
+ 'credit-card': 6,
8
+ 'rocket': 9
9
+ }.freeze
10
+
7
11
  def uj_icon(names = 'flag', original_options = {})
8
12
  options = original_options.deep_dup
9
13
  classes = []
@@ -15,7 +19,17 @@ module UrijiIcons
15
19
  Private.icon_join(icon, text, right_icon)
16
20
  end
17
21
 
18
- # Private methods for IconHelper
22
+ def uj_color_icon(key, options = {})
23
+ icon_name = "uj-#{key}-color"
24
+ options = options.merge(class: "#{icon_name} #{options[:class]}")
25
+ content_tag(:i, options) do
26
+ paths = COLOR_ICONS[key.to_sym]
27
+ paths.times.reduce(ActiveSupport::SafeBuffer.new) do |tags, i|
28
+ tags + content_tag(:span, nil, class: "path#{i + 1}")
29
+ end
30
+ end
31
+ end
32
+
19
33
  module Private
20
34
  extend ActionView::Helpers::OutputSafetyHelper
21
35
 
@@ -1,6 +1,6 @@
1
1
  module UrijiIcons
2
2
  module Rails
3
- UJ_VERSION = '2.3.0'.freeze
4
- VERSION = '2.3.0'.freeze
3
+ UJ_VERSION = '2.5.0'.freeze
4
+ VERSION = '2.5.0'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uriji-icons-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Serrada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-06 00:00:00.000000000 Z
11
+ date: 2019-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -123,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubyforge_project:
127
- rubygems_version: 2.7.8
126
+ rubygems_version: 3.0.6
128
127
  signing_key:
129
128
  specification_version: 4
130
129
  summary: An asset gemification of the uriji-icons font library