view_component_scoped_css 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: 13e334a551bf85880f71fc0715acce086e2f21fc7285b589045bbf321fc70b05
4
+ data.tar.gz: 27dc36fd76aaf20fb13669d19d0f467b9d292c46cb801f8f424bd83b74a75295
5
+ SHA512:
6
+ metadata.gz: 2b848bc1dcc7c63259b379920af745ed03982607fd531eb95cc36e3c98b3e5a7e246dde1b0596f7c008c115ce358e1cc7a587b94a622f7632a44cdaf2de5c972
7
+ data.tar.gz: 4bffca78d07c0c7975caa3046e6c5bac62a135199e49145d30251691f1848bb06300bace1566206f095d0bf880eb878e8798b275b535b7dbd2ee2d0e16afd3ee
@@ -0,0 +1,16 @@
1
+ name: Ruby
2
+
3
+ on: [push,pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: 3.0.2
14
+ bundler-cache: true
15
+ - name: Run the default task
16
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,21 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+ - rubocop-rake
5
+
6
+ AllCops:
7
+ NewCops: enable
8
+ TargetRubyVersion: 3
9
+ SuggestExtensions:
10
+ Enabled: true
11
+
12
+ Style/StringLiterals:
13
+ Enabled: true
14
+ EnforcedStyle: double_quotes
15
+
16
+ Style/StringLiteralsInInterpolation:
17
+ Enabled: true
18
+ EnforcedStyle: double_quotes
19
+
20
+ Layout/LineLength:
21
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-10-01
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at masa@aileron.cc. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in view_component_styled.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.7"
13
+
14
+ gem "pry"
data/Gemfile.lock ADDED
@@ -0,0 +1,81 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ view_component_styled (0.1.0)
5
+ activesupport (>= 6.0.0)
6
+ css_parser
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activesupport (7.0.4)
12
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ i18n (>= 1.6, < 2)
14
+ minitest (>= 5.1)
15
+ tzinfo (~> 2.0)
16
+ addressable (2.8.1)
17
+ public_suffix (>= 2.0.2, < 6.0)
18
+ ast (2.4.2)
19
+ coderay (1.1.3)
20
+ concurrent-ruby (1.1.10)
21
+ css_parser (1.12.0)
22
+ addressable
23
+ diff-lcs (1.5.0)
24
+ i18n (1.12.0)
25
+ concurrent-ruby (~> 1.0)
26
+ json (2.6.2)
27
+ method_source (1.0.0)
28
+ minitest (5.16.3)
29
+ parallel (1.22.1)
30
+ parser (3.1.2.1)
31
+ ast (~> 2.4.1)
32
+ pry (0.14.1)
33
+ coderay (~> 1.1)
34
+ method_source (~> 1.0)
35
+ public_suffix (5.0.0)
36
+ rainbow (3.1.1)
37
+ rake (13.0.6)
38
+ regexp_parser (2.6.0)
39
+ rexml (3.2.5)
40
+ rspec (3.11.0)
41
+ rspec-core (~> 3.11.0)
42
+ rspec-expectations (~> 3.11.0)
43
+ rspec-mocks (~> 3.11.0)
44
+ rspec-core (3.11.0)
45
+ rspec-support (~> 3.11.0)
46
+ rspec-expectations (3.11.1)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.11.0)
49
+ rspec-mocks (3.11.1)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.11.0)
52
+ rspec-support (3.11.1)
53
+ rubocop (1.36.0)
54
+ json (~> 2.3)
55
+ parallel (~> 1.10)
56
+ parser (>= 3.1.2.1)
57
+ rainbow (>= 2.2.2, < 4.0)
58
+ regexp_parser (>= 1.8, < 3.0)
59
+ rexml (>= 3.2.5, < 4.0)
60
+ rubocop-ast (>= 1.20.1, < 2.0)
61
+ ruby-progressbar (~> 1.7)
62
+ unicode-display_width (>= 1.4.0, < 3.0)
63
+ rubocop-ast (1.21.0)
64
+ parser (>= 3.1.1.0)
65
+ ruby-progressbar (1.11.0)
66
+ tzinfo (2.0.5)
67
+ concurrent-ruby (~> 1.0)
68
+ unicode-display_width (2.3.0)
69
+
70
+ PLATFORMS
71
+ arm64-darwin-20
72
+
73
+ DEPENDENCIES
74
+ pry
75
+ rake (~> 13.0)
76
+ rspec (~> 3.0)
77
+ rubocop (~> 1.7)
78
+ view_component_styled!
79
+
80
+ BUNDLED WITH
81
+ 2.2.22
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Masa (Aileron 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
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,43 @@
1
+ # ViewComponentScopedCss
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/view_component_in_css`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'view_component_in_css'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install view_component_in_css
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/aileron-inc/view_component_in_css. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/aileron-inc/view_component_in_css/blob/main/CODE_OF_CONDUCT.md).
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the ViewComponentStyled project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/view_component_styled/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "view_component_styled"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "css_parser"
15
+
16
+ sample_source = <<CSS
17
+ module(.component) .header { color: red }
18
+ module(.component) .body { color: black }
19
+ module(.component) .footer { color: blue }
20
+ CSS
21
+
22
+ parser = CssParser::Parser.new
23
+ parser.add_block! sample_source
24
+
25
+ require "irb"
26
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ViewComponentScopedCss
4
+ #
5
+ # A class for providing styles to a view component.
6
+ # If you include this class, you will be able to describe scss in the namespace of each component
7
+ #
8
+ module Base
9
+ extend ActiveSupport::Concern
10
+
11
+ included do
12
+ include ViewComponentScopedCss::Hook
13
+ end
14
+
15
+ class_methods do
16
+ def reload_component_css_tag
17
+ @component_css_tag = ViewComponentScopedCss::Tag.new(self).call
18
+ end
19
+
20
+ def component_css_tag
21
+ @component_css_tag ||= ViewComponentScopedCss::Tag.new(self).call
22
+ end
23
+
24
+ def component_identifier
25
+ @component_identifier ||= name.sub("::Component", "").underscore.split("/").join("::")
26
+ end
27
+
28
+ def component_identifier_for_css
29
+ @component_identifier_for_css ||= ["viewcomponent", component_identifier, "component"].compact.join("::")
30
+ end
31
+ end
32
+
33
+ def component_options
34
+ {}
35
+ end
36
+
37
+ def component_tag_class
38
+ self.class.component_identifier_for_css
39
+ end
40
+
41
+ def component_tag(name = ViewComponentScopedCss.config.component_tag, &block)
42
+ content_tag(
43
+ name,
44
+ class: [self.class.component_identifier_for_css, component_options[:class]].compact.join(" "),
45
+ **component_options,
46
+ &block
47
+ )
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ViewComponentScopedCss
4
+ #
5
+ # compiling scss files to provide final css
6
+ #
7
+ class Compiler
8
+ def initialize(path:, identifier:)
9
+ @identifier = identifier
10
+ @css = Sass.compile(path).css
11
+ rescue Sass::CompileError => e
12
+ raise "scss[#{path}] #{e.message}"
13
+ end
14
+
15
+ def call
16
+ @css.lines.map do |line|
17
+ case line
18
+ when /:module\((.*?)\)/
19
+ css_class_name = [".viewcomponent", @identifier, ::Regexp.last_match(1)].compact.join('\:\:')
20
+ line.gsub(Regexp.last_match[0], css_class_name)
21
+ else
22
+ line
23
+ end
24
+ end.join
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ViewComponentScopedCss
4
+ #
5
+ # ViewComponentScopedCss config
6
+ #
7
+ class Config
8
+ include ActiveSupport::Configurable
9
+ config_accessor(:component_tag) { :div }
10
+ config_accessor(:compile_cache) { true }
11
+ end
12
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ViewComponentScopedCss
4
+ #
5
+ # Class for holding the <style></style> of the component called on each request.
6
+ #
7
+ class CurrentContext < ActiveSupport::CurrentAttributes
8
+ attribute :css
9
+
10
+ def self.render(view)
11
+ return if css.empty?
12
+
13
+ view.safe_join(css.values)
14
+ end
15
+
16
+ def self.add(view_component)
17
+ self.css ||= {}
18
+ self.css[view_component.class.name] ||= view_component.class.component_css_tag
19
+ end
20
+
21
+ resets { self.css = {} }
22
+ end
23
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ViewComponentScopedCss
4
+ #
5
+ # Hook before_render to view component to provide inline css
6
+ #
7
+ module Hook
8
+ extend ActiveSupport::Concern
9
+ included do
10
+ include ActiveSupport::Callbacks
11
+ define_callbacks :render
12
+ end
13
+
14
+ if ViewComponentScopedCss.config.compile_cache
15
+ def before_render
16
+ run_callbacks :render do
17
+ ViewComponentScopedCss::CurrentContext.add(self)
18
+ end
19
+ end
20
+ else
21
+ def before_render
22
+ run_callbacks :render do
23
+ self.class.reload_component_css_tag
24
+ ViewComponentScopedCss::CurrentContext.add(self)
25
+ end
26
+ end
27
+ end
28
+
29
+ class_methods do
30
+ def before_render(&block)
31
+ set_callback(:render, :before, &block)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ViewComponentScopedCss
4
+ #
5
+ # Resolve css module naming after loading and compiling scss files to provide final css
6
+ #
7
+ class Loader
8
+ # class_attribute :compile_options, default: { source_map: true, style: { output: :compressed } }
9
+
10
+ def initialize(view_component_class)
11
+ @identifier = view_component_class.name.sub("::Component", "").underscore.split("/").join('\:\:')
12
+ @path = "app/components#{view_component_class.virtual_path}.scss"
13
+ end
14
+
15
+ def call
16
+ ViewComponentScopedCss::Compiler.new(path: @path, identifier: @identifier).call
17
+ rescue Sass::CompileError => e
18
+ raise "scss[#{@path}] #{e.message}"
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ViewComponentScopedCss
4
+ class Railtie < Rails::Railtie
5
+ config.to_prepare do
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ViewComponentScopedCss
4
+ #
5
+ # style tag for outputting inline css
6
+ #
7
+ class Tag
8
+ def initialize(component_class)
9
+ @component_class = component_class
10
+ end
11
+
12
+ def call
13
+ "<style data-component-name=\"#{@component_class.name}\">#{css}</style>".html_safe
14
+ end
15
+
16
+ def css
17
+ ViewComponentScopedCss::Loader.new(@component_class).call.html_safe
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ViewComponentScopedCss
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "view_component_scoped_css/version"
4
+ require "active_support"
5
+ require "sass-embedded"
6
+
7
+ #
8
+ # Provide a style for each view component that can be handled as css in js.
9
+ #
10
+ module ViewComponentScopedCss
11
+ class Error < StandardError; end
12
+ # Your code goes here...
13
+
14
+ extend ActiveSupport::Autoload
15
+ autoload :Loader
16
+ autoload :CurrentContext
17
+ autoload :Hook
18
+ autoload :Base
19
+ autoload :Config
20
+ autoload :Tag
21
+ autoload :Compiler
22
+
23
+ def self.configure
24
+ yield config
25
+ end
26
+
27
+ def self.config
28
+ @config ||= Config.new
29
+ end
30
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/view_component_scoped_css/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "view_component_scoped_css"
7
+ spec.version = ViewComponentScopedCss::VERSION
8
+ spec.authors = ["Masa (Aileron inc)"]
9
+ spec.email = ["masa@aileron.cc"]
10
+
11
+ spec.summary = "Provides view_component with scss in the form of css modules"
12
+ spec.description = "
13
+ Inspired by the css in js component, it provides functionality to allow the same
14
+ component-by-component implementation of styles in rails' standard component, view_components.
15
+ "
16
+ spec.homepage = "https://github.com/aileron-inc/view_component_in_css"
17
+ spec.license = "MIT"
18
+ spec.required_ruby_version = ">= 3.0"
19
+
20
+ spec.metadata["homepage_uri"] = spec.homepage
21
+ spec.metadata["source_code_uri"] = "https://github.com/aileron-inc/view_component_scoped_css"
22
+ spec.metadata["changelog_uri"] = "https://github.com/aileron-inc/view_component_scoped_css/blob/master/CHANGELOG.md"
23
+
24
+ # Specify which files should be added to the gem when it is released.
25
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
27
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
28
+ end
29
+ spec.bindir = "exe"
30
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ["lib"]
32
+
33
+ # Uncomment to register a new dependency of your gem
34
+ spec.add_dependency "activesupport", ">= 6.0.0"
35
+ spec.add_dependency "sass-embedded"
36
+
37
+ # For more information and examples about making a new gem, checkout our
38
+ # guide at: https://bundler.io/guides/creating_gem.html
39
+ spec.metadata["rubygems_mfa_required"] = "true"
40
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: view_component_scoped_css
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Masa (Aileron inc)
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-11-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 6.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: 6.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: sass-embedded
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: "\n Inspired by the css in js component, it provides functionality
42
+ to allow the same\n component-by-component implementation of styles in rails'
43
+ standard component, view_components.\n "
44
+ email:
45
+ - masa@aileron.cc
46
+ executables: []
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - ".github/workflows/main.yml"
51
+ - ".gitignore"
52
+ - ".rspec"
53
+ - ".rubocop.yml"
54
+ - CHANGELOG.md
55
+ - CODE_OF_CONDUCT.md
56
+ - Gemfile
57
+ - Gemfile.lock
58
+ - LICENSE.txt
59
+ - README.md
60
+ - Rakefile
61
+ - bin/console
62
+ - bin/setup
63
+ - lib/view_component_scoped_css.rb
64
+ - lib/view_component_scoped_css/base.rb
65
+ - lib/view_component_scoped_css/compiler.rb
66
+ - lib/view_component_scoped_css/config.rb
67
+ - lib/view_component_scoped_css/current_context.rb
68
+ - lib/view_component_scoped_css/hook.rb
69
+ - lib/view_component_scoped_css/loader.rb
70
+ - lib/view_component_scoped_css/railtie.rb
71
+ - lib/view_component_scoped_css/tag.rb
72
+ - lib/view_component_scoped_css/version.rb
73
+ - view_component_scoped_css.gemspec
74
+ homepage: https://github.com/aileron-inc/view_component_in_css
75
+ licenses:
76
+ - MIT
77
+ metadata:
78
+ homepage_uri: https://github.com/aileron-inc/view_component_in_css
79
+ source_code_uri: https://github.com/aileron-inc/view_component_scoped_css
80
+ changelog_uri: https://github.com/aileron-inc/view_component_scoped_css/blob/master/CHANGELOG.md
81
+ rubygems_mfa_required: 'true'
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '3.0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubygems_version: 3.2.22
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Provides view_component with scss in the form of css modules
101
+ test_files: []