remixicon 1.0.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.
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'sassc-rails'
4
+
5
+ module Remixicon
6
+ module Rails
7
+ class Engine < ::Rails::Engine
8
+ initializer 'remixicon.assets' do |app|
9
+ %w(stylesheets fonts).each do |sub|
10
+ app.config.assets.paths << root.join('assets', sub).to_s
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Remixicon
4
+ VERSION = '1.0.0'
5
+ end
6
+
data/lib/remixicon.rb ADDED
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'remixicon/version'
4
+
5
+ module Remixicon
6
+ class << self
7
+ # Inspired by Kaminari
8
+ def load!
9
+ if rails?
10
+ register_rails_engine
11
+ elsif hanami?
12
+ register_hanami
13
+ elsif sprockets?
14
+ register_sprockets
15
+ elsif defined?(::Sass) && ::Sass.respond_to?(:load_paths)
16
+ # The deprecated `sass` gem:
17
+ ::Sass.load_paths << stylesheets_path
18
+ end
19
+
20
+ if defined?(::Sass::Script::Value::Number)
21
+ ::Sass::Script::Value::Number.precision = [6, ::Sass::Script::Value::Number.precision].max
22
+ end
23
+ end
24
+
25
+ # Paths
26
+ def gem_path
27
+ @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
28
+ end
29
+
30
+ def stylesheets_path
31
+ File.join assets_path, 'stylesheets'
32
+ end
33
+
34
+ def fonts_path
35
+ File.join assets_path, 'fonts'
36
+ end
37
+
38
+ def assets_path
39
+ @assets_path ||= File.join gem_path, 'assets'
40
+ end
41
+
42
+ # Environment detection helpers
43
+ def sprockets?
44
+ defined?(::Sprockets)
45
+ end
46
+
47
+ def rails?
48
+ defined?(::Rails)
49
+ end
50
+
51
+ def hanami?
52
+ defined?(::Hanami)
53
+ end
54
+
55
+ private
56
+
57
+ def register_rails_engine
58
+ require 'remixicon/engine'
59
+ end
60
+
61
+ def register_sprockets
62
+ Sprockets.append_path(stylesheets_path)
63
+ Sprockets.append_path(fonts_path)
64
+ end
65
+
66
+ def register_hanami
67
+ Hanami::Assets.sources << assets_path
68
+ end
69
+ end
70
+ end
71
+
72
+ Remixicon.load!
73
+
data/remixicon.gemspec ADDED
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'remixicon/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "remixicon"
9
+ spec.version = Remixicon::VERSION
10
+ spec.authors = ["hfpp2012"]
11
+ spec.email = ["hfpp2012@gmail.com"]
12
+ spec.license = 'MIT'
13
+
14
+ spec.summary = "Remixicon rubygem for Rails / Sprockets / Hanami / etc"
15
+ spec.homepage = "https://github.com/hfpp2012/remixicon-rails"
16
+ spec.required_ruby_version = ">= 2.3.3"
17
+
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+ spec.metadata["source_code_uri"] = "https://github.com/hfpp2012/remixicon-rails"
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = `git ls-files`.split("\n")
24
+
25
+ spec.add_runtime_dependency 'sassc-rails', '>= 2.0.0'
26
+ # Uncomment to register a new dependency of your gem
27
+ # spec.add_dependency "example-gem", "~> 1.0"
28
+
29
+ # For more information and examples about making a new gem, check out our
30
+ # guide at: https://bundler.io/guides/creating_gem.html
31
+ end
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: remixicon
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - hfpp2012
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-01-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sassc-rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.0
27
+ description:
28
+ email:
29
+ - hfpp2012@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - Gemfile
36
+ - README.md
37
+ - Rakefile
38
+ - assets/fonts/remixicon.eot
39
+ - assets/fonts/remixicon.svg
40
+ - assets/fonts/remixicon.ttf
41
+ - assets/fonts/remixicon.woff
42
+ - assets/fonts/remixicon.woff2
43
+ - assets/stylesheets/remixicon.css
44
+ - lib/remixicon.rb
45
+ - lib/remixicon/engine.rb
46
+ - lib/remixicon/version.rb
47
+ - remixicon.gemspec
48
+ homepage: https://github.com/hfpp2012/remixicon-rails
49
+ licenses:
50
+ - MIT
51
+ metadata:
52
+ homepage_uri: https://github.com/hfpp2012/remixicon-rails
53
+ source_code_uri: https://github.com/hfpp2012/remixicon-rails
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 2.3.3
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubygems_version: 3.2.3
70
+ signing_key:
71
+ specification_version: 4
72
+ summary: Remixicon rubygem for Rails / Sprockets / Hanami / etc
73
+ test_files: []