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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f2bbcaf13dc8050d37b50983ddf0104c4626ff60e5efcece128432a832e10d0
4
- data.tar.gz: 4cea76accbbc1d740122e5681bb62581bbcfb60b673e7b4f5f2b32b3f688e2bd
3
+ metadata.gz: e550c3f72e3974d27db9f90ce7ff91b76e717373fd3965e2e3621442b7cbbd16
4
+ data.tar.gz: 4bb718adfce915e86a357e91c8497de69a08e7e79ad6b14169d8f81ad0bcea4e
5
5
  SHA512:
6
- metadata.gz: 2c3c032a132ffb460435854af6574802ce18ccdc1f8fd84a3fd313e2356c416561698e66d65423fb0b778a8dcf7cfad62359102dc1d28fb13e98ebbb675fa3e6
7
- data.tar.gz: 60258705311d93b2818e1406d41578a6a1f6d6598e45893be0b61cf54c36cef20856135e827b6b597cede43033c9ac38da38919d57a2d1a35734c623e70594c1
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.exists?("#{calling_path}/#{component_name}")
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"
@@ -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.exists?(Rails.root.join("config/utility_classes.yml"))
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.exists?(file) && YAML.load_file(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
@@ -1,5 +1,5 @@
1
1
  module Classy
2
2
  module Yaml
3
- VERSION = '0.6.1'
3
+ VERSION = '0.7.0'
4
4
  end
5
5
  end
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.6.1
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-16 00:00:00.000000000 Z
11
+ date: 2021-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport