abstract-synthesizer 0.0.13 → 0.0.14

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: bd22536e9934988589c35c25e4acf34ea9ee56478ddb87f4fdfe14b0c024d188
4
- data.tar.gz: 99e310a36e06db50b6cab9eb3a995f314891f0bf5a62298cb40aa8c9c9348928
3
+ metadata.gz: 464ebe4ab26cb13becade2b40754e2d158885813780308fbead99ba9d204649e
4
+ data.tar.gz: ff6cfc9eced8061ee6565c4662a9b813ec31bff199404f7f68a99e8bca0e2998
5
5
  SHA512:
6
- metadata.gz: dd3529fb0995c5879b19aa1ef90362f4456fb60dc04b10fa53b4cd6970185e62e1b7750e190c37c80c50dc04eff09abc9b08d06ab0be65917ea4af2fc74133ed
7
- data.tar.gz: a5141faba09bc99a67057dcf97253dbdc8b5d40a71d4232c2de79e73af35ee26028a9c7c4aeba404723b5385e54e024356c037e803d28e89ec40a5d9c912df74
6
+ metadata.gz: 3879dc3a011f6a73c481a84b356ace5279e8396594008924ef50271d339a0f4d7e9c86580c48343b07ee4b8e0b6c687bd77a603d0f73262f0250ed0a56bae9f3
7
+ data.tar.gz: fb12e562983180e8e5fb125306189262467468d2be875dd9c9878bf32b07536554aac85a6e92182017a62bc2b217bb70ca3c1365a75b7caa091e6cc66db94cc5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- abstract-synthesizer (0.0.13)
4
+ abstract-synthesizer (0.0.14)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/docs/usage.md CHANGED
@@ -113,4 +113,4 @@ The gem provides specific error classes for common issues:
113
113
 
114
114
  - `InvalidSynthesizerKeyError`: Raised when you try to use a method in your DSL that was not included in the `keys` provided to `SynthesizerFactory.create_synthesizer`.
115
115
  - `TooManyFieldValuesError`: Raised when a field assignment method receives more than one argument.
116
- - `NotEnoughResourceKeys`: Raised when a resource definition does not receive the expected number of arguments (e.g., if a top-level resource expects two identifiers but only one is provided).
116
+
data/gemset.nix CHANGED
@@ -6,7 +6,7 @@
6
6
  path = ./.;
7
7
  type = "path";
8
8
  };
9
- version = "0.0.13";
9
+ version = "0.0.14";
10
10
  };
11
11
  ast = {
12
12
  groups = ["default" "development"];
data/lib/GEMINI.md CHANGED
@@ -16,7 +16,7 @@ Key features and methods:
16
16
  - `manifest`: An alias for `synthesis`.
17
17
  - `valid_method?(method, keys)`: Internal method to check if a method call is valid within the current context (resource definition or field assignment).
18
18
  - `validate_method(method, keys)`: Raises `InvalidSynthesizerKeyError` if a method is not valid.
19
- - `validate_args(args)`: Validates the number of arguments based on the current context, raising `NotEnoughResourceKeys` or `TooManyFieldValuesError`.
19
+ - `validate_args(args)`: Validates the number of arguments based on the current context, raising `TooManyFieldValuesError`.
20
20
  - `abstract_method_missing(method, keys, *args)`: This is the core of the DSL. It dynamically handles method calls, interpreting them as resource keys or field assignments, and building the `translation[:manifest]` accordingly. It uses the `Bury` module for nested data insertion.
21
21
 
22
22
  ## SynthesizerFactory Module
@@ -3,5 +3,5 @@
3
3
  This directory contains custom error classes used by the `abstract-synthesizer` gem. These errors are raised when specific conditions are not met during the synthesis process, providing clear feedback to the user.
4
4
 
5
5
  - `invalid_synthesizer_key_error.rb`: Defines `InvalidSynthesizerKeyError`. This error is raised when the synthesizer attempts to process a key (method call) that is not defined or recognized as a valid resource key within the DSL.
6
- - `not_enough_resource_keys.rb`: Defines `NotEnoughResourceKeys`. This error is raised when an insufficient number of resource keys are provided, typically during the initial definition of a resource.
6
+
7
7
  - `too_many_field_values.rb`: Defines `TooManyFieldValuesError`. This error is raised when too many field values are provided for a given field, indicating an incorrect usage of the DSL.
@@ -1,3 +1,3 @@
1
1
  module Meta
2
- VERSION = %(0.0.13).freeze
2
+ VERSION = %(0.0.14).freeze
3
3
  end
@@ -1,6 +1,6 @@
1
1
  require_relative %(abstract-synthesizer/errors/invalid_synthesizer_key_error)
2
2
  require_relative %(abstract-synthesizer/errors/too_many_field_values)
3
- require_relative %(abstract-synthesizer/errors/not_enough_resource_keys)
3
+
4
4
  require_relative %(abstract-synthesizer/primitives/bury)
5
5
 
6
6
  class AbstractSynthesizer
@@ -65,20 +65,14 @@ class AbstractSynthesizer
65
65
  raise InvalidSynthesizerKeyError, err_msg unless valid_method?(method, keys)
66
66
  end
67
67
 
68
- def validate_args(args)
69
- if translation[:ancestors].empty?
70
- raise NotEnoughResourceKeys unless args.length.eql?(2)
71
- elsif !args.length.eql?(1)
72
- raise TooManyFieldValuesError
73
- end
74
- end
68
+
75
69
 
76
70
  def abstract_method_missing(method, keys, *args)
77
71
  keys = keys.map(&:to_sym)
78
72
  method = method.to_sym
79
73
 
80
74
  validate_method(method, keys)
81
- validate_args(args)
75
+
82
76
 
83
77
  keys.each do |key|
84
78
  if key.eql?(translation[:context])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abstract-synthesizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - drzzln@protonmail.com
@@ -79,7 +79,6 @@ files:
79
79
  - lib/abstract-synthesizer/GEMINI.md
80
80
  - lib/abstract-synthesizer/errors/GEMINI.md
81
81
  - lib/abstract-synthesizer/errors/invalid_synthesizer_key_error.rb
82
- - lib/abstract-synthesizer/errors/not_enough_resource_keys.rb
83
82
  - lib/abstract-synthesizer/errors/too_many_field_values.rb
84
83
  - lib/abstract-synthesizer/primitives/GEMINI.md
85
84
  - lib/abstract-synthesizer/primitives/bury.rb
@@ -1 +0,0 @@
1
- class NotEnoughResourceKeys < StandardError; end