ikonic 0.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/ikonic.rb +24 -0
  3. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e75873bcd4e49404004d63648220e368ef0a8c584515c2fd407a8ed8ebf5865f
4
+ data.tar.gz: dd3ead219d6e665bf3bdfd564a48c3fcbb96eb435d843ab976ba4b304d6863a1
5
+ SHA512:
6
+ metadata.gz: 581c59be6db64729c6a81bac7faddb4ac0a83ab6c987aa295defc72c64bb0a5f166cf611e3c86253cf62193162c86b08e6833a1a55aee594548714168685d317
7
+ data.tar.gz: dfc74d21457a0c8b9d155d7cf9f4b312d7bfd64cd5994ab76e465b9d61c17df3189dab2229bf4258b89df43176022d094414d33d07754aa811ba2716043bfef5
data/lib/ikonic.rb ADDED
@@ -0,0 +1,24 @@
1
+ class Ikonic
2
+ def self.icon(name, options={})
3
+ DEFAULTS.each { |key, val| options[key] ||= val }
4
+
5
+ template = File.read(
6
+ File.join(__dir__, "../assets/#{options[:theme]}/#{options[:style]}/#{name}.svg"))
7
+
8
+ template.gsub!(
9
+ /stroke-width="(\d+)"/,
10
+ "stroke-width=\"#{options[:width]}\""
11
+ ) if options[:width]
12
+
13
+ template.insert(5, "class=\"#{options[:class]}\" ") if options[:class]
14
+
15
+ template
16
+ end
17
+
18
+ DEFAULTS = {
19
+ theme: 'heroicon',
20
+ style: 'outline',
21
+ size: 24,
22
+ width: 2
23
+ }
24
+ end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ikonic
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dave Kinkead
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-08-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A pure ruby wrapper around your favourite icon libraries
14
+ email: dave@kinkead.com.au
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/ikonic.rb
20
+ homepage: https://github.com/fatwombatstudios/ikonic
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubygems_version: 3.1.4
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: The best icons in one place
43
+ test_files: []