heroicons_helper 0.1.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: 668ee3c4c63423a55043c27767e157662c42eae1b79dd983f2112482eee0f661
4
+ data.tar.gz: a73d673d85a739017cf0b98b383629418a6c8730b1dc98fd9367cb34b574e01f
5
+ SHA512:
6
+ metadata.gz: 43c906d2e65a78ce00fc56c164788930d7e4a6c0c12edaf7c416357a927a5e50e2c8edb8ba210b6f033717761f3ddf6aa4fafb171158a4b81ee893c4971e2d40
7
+ data.tar.gz: 19adfe1de1ee6e9ca95cf225afd6d69b9ff9667e2307fb8080b5ca4b7547026800fcab3dbf374a231e9475e5e97aeebfefe61f5216755e0cd56313c1078e67a6
data/.rubocop.yml ADDED
@@ -0,0 +1,4 @@
1
+ inherit_gem:
2
+ rubocop-standard:
3
+ - config/default.yml
4
+ - config/minitest.yml
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-06-08
4
+
5
+ - Initial release
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in heroicons_helper.gemspec
6
+ gemspec
7
+
8
+ group :development, :test do
9
+ gem "rake", "~> 13.0"
10
+ gem "rubocop-standard", "~> 7.0"
11
+ end
12
+
13
+ group :test do
14
+ gem "minitest", "~> 5.15"
15
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Garen J. Torikian
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # HeroiconsHelper
2
+
3
+ This gem helps you use Heroicons in your Ruby projects. It's inspired by [heroicons-ruby](https://github.com/chunlea/heroicons-ruby) and [octicons](https://github.com/primer/octicons).
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ $ bundle add heroicons_helper
10
+
11
+ If bundler is not being used to manage dependencies, install the gem by executing:
12
+
13
+ $ gem install heroicons_helper
14
+
15
+ ## Usage
16
+
17
+ This gem is super simple! Require the gem, and include the module:
18
+
19
+ ```ruby
20
+ require "heroicons_helper"
21
+
22
+ include HeroiconsHelper
23
+ ```
24
+
25
+ You'll have a brand new method called `heroicons` whose signature looks like this:
26
+
27
+ ```ruby
28
+ heroicons(symbol, variant, attributes: {})
29
+ ```
30
+
31
+ where
32
+
33
+ * `symbol` is the heroicons name
34
+ * `variant` is the type of Heroicons (eg., `outline` or `solid`)
35
+ * `attributes` are any additional HTML attributes to add on to the resulting `svg` element
36
+
37
+ This one method call returns an object that represents the Heroicon, and you should call `to_svg` to get the resulting SVG string:
38
+
39
+ ```ruby
40
+ outline_icon = heroicons("x", "outline")
41
+ puts outline_icon.to_svg
42
+ ```
43
+ ```
44
+ => <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg>
45
+ ```
46
+
47
+ ## Development
48
+
49
+ To update the Heroicons set:
50
+
51
+ 1. Run `npm install`
52
+ 2. Run `script/update_heroicons`
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
+ end
11
+
12
+ require "rubocop/rake_task"
13
+
14
+ RuboCop::RakeTask.new
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/heroicons_helper/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "heroicons_helper"
7
+ spec.version = HeroiconsHelper::VERSION
8
+ spec.authors = ["Garen J. Torikian"]
9
+ spec.email = ["gjtorikian@users.noreply.github.com"]
10
+
11
+ spec.summary = "Heroicons port for Ruby"
12
+ spec.description = "A package that distributes Heroicons as a gem, for easy inclusion in Ruby projects."
13
+ spec.homepage = "https://github.com/gjtorikian/heroicons_helper"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.7.0", "< 4.0.0"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = spec.homepage
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(__dir__) do
23
+ %x(git ls-files -z).split("\x0").reject do |f|
24
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
25
+ end
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ # Uncomment to register a new dependency of your gem
32
+ # spec.add_dependency "example-gem", "~> 1.0"
33
+
34
+ # For more information and examples about making a new gem, check out our
35
+ # guide at: https://bundler.io/guides/creating_gem.html
36
+ end