utility_palettes 1.0.1 → 1.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7db3ff622d508b9b3ec237a56f185e7e530c0e71fe01bdb35ce44ba909914876
4
- data.tar.gz: d2a05bcb1c34d3ae1a98e16cbacabc7e354441608f7bc03a452c07239b15b6d5
3
+ metadata.gz: 37bae5b884478e400c43d1d18113250ef5f15ba217c56306dcabead269b547dc
4
+ data.tar.gz: d014852967e3b8a10f048451db576e4e65cb6dfee0550589126ac393d74e0064
5
5
  SHA512:
6
- metadata.gz: 00e88a3d02edd7aba94e4a4c1bce0f7a926e0bc47c3f95bcd7c29d62dd7c878b5cf74c3a8de65a0b5da75c526620b8012371486937b220600363a705d07ec2f0
7
- data.tar.gz: acaa16e80c37e7895a67e7314038fd86218dcf12290ae3bfa55144fee7fbff412624e8ac86f8199a7dfd8c245d51aa46c493b17ea9c77f939d08677ac7dcefaf
6
+ metadata.gz: aa21c246fe9c7ae17bd3528ac21a8e8360209f677127a7f0432e7c3310d97956489eaf1e0ac460881852894c759ced6dd963e37681926a4f24d293946e45bf6f
7
+ data.tar.gz: 61d1516307cdbd72c6c1615d1584d459b641c0ddb94a3f3a580cfb1bce8fff5336454226999909a12ec769dccf36ebd1e872c2bcab5ea69f2bfbee6e287adac9
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # UtilityPalettes
2
2
 
3
- ![Static Badge](https://img.shields.io/badge/Gem_Version-1.0.0-blue)
3
+ ![Static Badge](https://img.shields.io/badge/Gem_Version-1.0.4-blue)
4
4
  [![Static Badge](https://img.shields.io/badge/RubyGems-red)](https://rubygems.org/gems/utility_palettes)
5
5
 
6
6
  > Generate your own colour palettes in an instance.
@@ -1,13 +1,20 @@
1
- # frozen_string_literal: true
2
-
3
- module UtilityPalettes
4
- module Generators
5
- class ConfigGenerator < Rails::Generators::Base
6
- source_root File.expand_path('../../..', __dir__)
7
-
8
- def copy_config
9
- copy_file 'lib/generators/templates/config/utility_palettes.rb', 'config/initializers/utility_palettes.rb'
10
- end
11
- end
12
- end
13
- end
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require 'rails/generators'
5
+ require 'rails/generators/base'
6
+ rescue LoadError => e
7
+ raise LoadError, "railties gem is required for generators. Add 'railties' to your Gemfile: #{e.message}"
8
+ end
9
+
10
+ module UtilityPalettes
11
+ module Generators
12
+ class ConfigGenerator < Rails::Generators::Base
13
+ source_root File.expand_path('../../..', __dir__)
14
+
15
+ def copy_config
16
+ copy_file 'lib/generators/templates/config/utility_palettes.rb', 'config/initializers/utility_palettes.rb'
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,29 +1,36 @@
1
- # frozen_string_literal: true
2
-
3
- module UtilityPalettes
4
- module Generators
5
- class GenerateGenerator < Rails::Generators::Base
6
- def generate_utility_palettes
7
- self.class.config_format_warn if File.exist?('config/utility_palettes.yml') || File.exist?('config/utility_palettes.json')
8
-
9
- if UtilityPalettes.configuration.enable_environments.include?(Rails.env.to_sym)
10
- UtilityPalettes::Palettes.generate
11
- else
12
- self.class.disabled_warn
13
- end
14
- end
15
-
16
- private
17
-
18
- # TODO: add links to README for migration
19
- def self.config_format_warn
20
- warn 'WARNING: Utility Palettes now uses an initializer to set config. You need to migrate and remove your YML/JSON file.'
21
- end
22
-
23
- # TODO: add links to README for environment setting
24
- def self.disabled_warn
25
- warn 'ERROR: Utility Palettes is disabled for this environment. Palettes will not be generated.'
26
- end
27
- end
28
- end
29
- end
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require 'rails/generators'
5
+ require 'rails/generators/base'
6
+ rescue LoadError => e
7
+ raise LoadError, "railties gem is required for generators. Add 'railties' to your Gemfile: #{e.message}"
8
+ end
9
+
10
+ module UtilityPalettes
11
+ module Generators
12
+ class GenerateGenerator < Rails::Generators::Base
13
+ def generate_utility_palettes
14
+ self.class.config_format_warn if File.exist?('config/utility_palettes.yml') || File.exist?('config/utility_palettes.json')
15
+
16
+ if UtilityPalettes.configuration.enable_environments.include?(Rails.env.to_sym)
17
+ UtilityPalettes::Palettes.generate
18
+ else
19
+ self.class.disabled_warn
20
+ end
21
+ end
22
+
23
+ private
24
+
25
+ # TODO: add links to README for migration
26
+ def self.config_format_warn
27
+ warn 'WARNING: Utility Palettes now uses an initializer to set config. You need to migrate and remove your YML/JSON file.'
28
+ end
29
+
30
+ # TODO: add links to README for environment setting
31
+ def self.disabled_warn
32
+ warn 'ERROR: Utility Palettes is disabled for this environment. Palettes will not be generated.'
33
+ end
34
+ end
35
+ end
36
+ end
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- module UtilityPalettes
4
- VERSION = '1.0.1'
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ module UtilityPalettes
4
+ VERSION = '1.0.4'
5
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utility_palettes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis Davis
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-09-04 00:00:00.000000000 Z
10
+ date: 2025-09-05 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: color_converters
@@ -23,6 +23,20 @@ dependencies:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
25
  version: 0.1.2
26
+ - !ruby/object:Gem::Dependency
27
+ name: railties
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '4.0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '4.0'
26
40
  description: Create broad colour palettes based on specific colour swatches, or more
27
41
  specific light/dark variant palettes. Be in control of the colours you use and shorten
28
42
  the iterative process when deciding on how to build your palettes.