classy-yaml 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/classy/yaml/component_helpers.rb +1 -1
- data/lib/classy/yaml/helpers.rb +2 -2
- data/lib/classy/yaml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e550c3f72e3974d27db9f90ce7ff91b76e717373fd3965e2e3621442b7cbbd16
|
4
|
+
data.tar.gz: 4bb718adfce915e86a357e91c8497de69a08e7e79ad6b14169d8f81ad0bcea4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae98344136a170b10ffc6c507518832d60583d0e7555cf536333998270ad04e6be83b82d3b555969271787bfebb71eb21988fe2b5a48c6924bd80725fd7f8167
|
7
|
+
data.tar.gz: 9277260199b1d3b84b13739f72b28ae1f4d93bb2c45b7e3fe330ed4fcffe15fac9ca9f6b338b4953ac259b464735e7f13e18b0a929b5a0668ab83714448ca57a
|
data/README.md
CHANGED
@@ -90,6 +90,13 @@ Or install it yourself as:
|
|
90
90
|
$ gem install classy-yaml
|
91
91
|
```
|
92
92
|
|
93
|
+
If using purging for styles, be sure to add the YAML files to the purge directories. For example, below is a tailwind.config.js:
|
94
|
+
```
|
95
|
+
purge: [
|
96
|
+
"./config/utility_classes.yml",
|
97
|
+
"./app/components/**/*.yml" // If using view component sidecar assets
|
98
|
+
]
|
99
|
+
```
|
93
100
|
## Contributing
|
94
101
|
This is my first attempt at an actual gem usable for all. Any and all suggestions are absolutely welcome. I'm not the cleanest programmer, so code quality suggestions are welcome too 👍 I extracted this logic from my private work and I felt it was useful enought to be worth publishing.
|
95
102
|
|
@@ -4,7 +4,7 @@ module Classy
|
|
4
4
|
def yass(*args)
|
5
5
|
component_name = caller.first.split("/").last.split(".").first
|
6
6
|
calling_path = caller.first.split("/")[0...-1].join("/")
|
7
|
-
classy_file = if Dir.
|
7
|
+
classy_file = if Dir.exist?("#{calling_path}/#{component_name}")
|
8
8
|
"#{calling_path}/#{component_name}/#{component_name}.yml"
|
9
9
|
else
|
10
10
|
"#{calling_path}/#{component_name}.yml"
|
data/lib/classy/yaml/helpers.rb
CHANGED
@@ -3,12 +3,12 @@ module Classy
|
|
3
3
|
module Helpers
|
4
4
|
def yass(*args)
|
5
5
|
classy_yamls = []
|
6
|
-
classy_yamls << YAML.load_file(Rails.root.join("config/utility_classes.yml")) if File.
|
6
|
+
classy_yamls << YAML.load_file(Rails.root.join("config/utility_classes.yml")) if File.exist?(Rails.root.join("config/utility_classes.yml"))
|
7
7
|
|
8
8
|
classy_files_hash = args.find { |arg| arg.is_a?(Hash) && arg.keys.include?(:classy_files) }
|
9
9
|
if classy_files_hash.present?
|
10
10
|
classy_files_hash[:classy_files].each do |file|
|
11
|
-
if File.
|
11
|
+
if File.exist?(file) && YAML.load_file(file)
|
12
12
|
file = YAML.load_file(file)
|
13
13
|
classy_yamls << file if file
|
14
14
|
end
|
data/lib/classy/yaml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: classy-yaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tonksthebear
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|