openproject-octicons_helper 19.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fdd6bd29e6e97ec86c576300a930b3d9e30cf47106695025c8e9cbc1ce412f41
4
+ data.tar.gz: 8b951e155cacd45f974889dcfdfa6936056e5f567a359ebfc18cf4e1e1523201
5
+ SHA512:
6
+ metadata.gz: ac7eec64201f05b38b229ebb0d9e331a14a9a61e3f16c11e344431fcf26b8fe6342d5c33d456d3ba3925fd4ce861f023e17dcf93bd14b21f62d647fc737fce1d
7
+ data.tar.gz: 7cb978def130a41ed3e1bc16a3585edd3c9a006030b80daaff953a3179c66726e7b66c1166e2f06bc93cdd7d63ddad40b78226eed19628937c6a2ca14ec6686b
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 GitHub Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # octicons_helper
2
+
3
+ [![Gem version](https://img.shields.io/gem/v/octicons_helper.svg)](https://rubygems.org/gems/octicons_helper)
4
+
5
+
6
+ This rails helper lets you easily include svg octicons in your rails apps.
7
+
8
+ ## Install
9
+
10
+ 1. Add this to your `Gemfile`
11
+
12
+ ```rb
13
+ gem 'octicons_helper'
14
+ ```
15
+
16
+ 3. Use this tag in your erbs
17
+
18
+ ```rb
19
+ <%= octicon "alert", :height => 32, :class => "right left", :"aria-label" => "hi" %>
20
+ ```
21
+ We recommend including the CSS in the [`@primer/octicons`](/packages/javascript) npm module. You can also npm install that package and include `build/build.css` in your styles.
@@ -0,0 +1,24 @@
1
+ require "octicons"
2
+ require "action_view"
3
+
4
+ module OcticonsHelper
5
+ include ActionView::Helpers::TagHelper
6
+
7
+ mattr_accessor :octicons_helper_cache, default: {}
8
+
9
+ def octicon(symbol, options = {})
10
+ return "" if symbol.nil?
11
+
12
+ cache_key = [symbol, options]
13
+
14
+ if tag = octicons_helper_cache[cache_key]
15
+ tag
16
+ else
17
+ icon = Octicons::Octicon.new(symbol, options)
18
+
19
+ tag = content_tag(:svg, icon.path.html_safe, icon.options).freeze # rubocop:disable Rails/OutputSafety
20
+ octicons_helper_cache[cache_key] = tag
21
+ tag
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,9 @@
1
+ require "rails"
2
+
3
+ module OcticonsHelper
4
+ class Railtie < Rails::Railtie
5
+ initializer "octicons_helper.helper" do
6
+ ActionView::Base.send :include, OcticonsHelper
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module OcticonsHelper
2
+ VERSION = "19.4.0".freeze
3
+ end
@@ -0,0 +1,3 @@
1
+ require "octicons_helper/version"
2
+ require "octicons_helper/helper"
3
+ require "octicons_helper/railtie" if defined?(Rails)
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: openproject-octicons_helper
3
+ version: !ruby/object:Gem::Version
4
+ version: 19.4.0
5
+ platform: ruby
6
+ authors:
7
+ - GitHub Inc.
8
+ - OpenProject GmbH
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2023-07-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: openproject-octicons
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '='
19
+ - !ruby/object:Gem::Version
20
+ version: 19.4.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '='
26
+ - !ruby/object:Gem::Version
27
+ version: 19.4.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: railties
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: actionview
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ description: A rails helper that makes including svg Octicons simple.
57
+ email:
58
+ - support@openproject.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - LICENSE
64
+ - README.md
65
+ - lib/octicons_helper.rb
66
+ - lib/octicons_helper/helper.rb
67
+ - lib/octicons_helper/railtie.rb
68
+ - lib/octicons_helper/version.rb
69
+ homepage: https://github.com/opf/openproject-octicons
70
+ licenses:
71
+ - MIT
72
+ metadata:
73
+ rubygems_mfa_required: 'false'
74
+ post_install_message:
75
+ rdoc_options: []
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ requirements: []
89
+ rubygems_version: 3.3.7
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: Octicons rails helper
93
+ test_files: []