servactory 1.5.0 → 1.5.1
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 +4 -4
- data/lib/servactory/context/callable.rb +1 -2
- data/lib/servactory/input_arguments/dsl.rb +0 -5
- data/lib/servactory/input_arguments/input_argument.rb +6 -6
- data/lib/servactory/input_arguments/tools/check.rb +4 -5
- data/lib/servactory/input_arguments/workbench.rb +3 -5
- data/lib/servactory/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 77f19d5b6971cbec1d9f9c5861d14cfe511d4bdcd7d4636349909d2fc66136cd
         | 
| 4 | 
            +
              data.tar.gz: a0db50ba89379e4de2155b3b3d4b574bf0284aa23ef672071f1f0afa74ec5fb5
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 33720d025d61d2874b17181a5aa6d9f74ac060f1bb606da70495426c431afc1fb0e9d4ffdb8575a389a9d675fa0a900ef96a769df6653cc478d2df27176e894a
         | 
| 7 | 
            +
              data.tar.gz: 7e2ec6b1c657b943154e2f41ca7b43fe45fb77bc172664811a48a6575e6459ae154759f800ce59d1b179f3ff760a0f8ebf6dd97f4a3eb67f78d094e9cf55870b
         | 
| @@ -58,8 +58,7 @@ module Servactory | |
| 58 58 | 
             
                  def assign_data_with(arguments)
         | 
| 59 59 | 
             
                    input_arguments_workbench.assign(
         | 
| 60 60 | 
             
                      context: context_store.context,
         | 
| 61 | 
            -
                      arguments: arguments | 
| 62 | 
            -
                      collection_of_input_options: collection_of_input_options
         | 
| 61 | 
            +
                      arguments: arguments
         | 
| 63 62 | 
             
                    )
         | 
| 64 63 |  | 
| 65 64 | 
             
                    internal_arguments_workbench.assign(context: context_store.context)
         | 
| @@ -19,7 +19,6 @@ module Servactory | |
| 19 19 | 
             
                    def input(name, **options)
         | 
| 20 20 | 
             
                      collection_of_input_arguments << InputArgument.new(
         | 
| 21 21 | 
             
                        name,
         | 
| 22 | 
            -
                        collection_of_options: collection_of_input_options,
         | 
| 23 22 | 
             
                        **options
         | 
| 24 23 | 
             
                      )
         | 
| 25 24 | 
             
                    end
         | 
| @@ -28,10 +27,6 @@ module Servactory | |
| 28 27 | 
             
                      @collection_of_input_arguments ||= Collection.new
         | 
| 29 28 | 
             
                    end
         | 
| 30 29 |  | 
| 31 | 
            -
                    def collection_of_input_options
         | 
| 32 | 
            -
                      @collection_of_input_options ||= OptionsCollection.new
         | 
| 33 | 
            -
                    end
         | 
| 34 | 
            -
             | 
| 35 30 | 
             
                    def input_arguments_workbench
         | 
| 36 31 | 
             
                      @input_arguments_workbench ||= Workbench.work_with(collection_of_input_arguments)
         | 
| 37 32 | 
             
                    end
         | 
| @@ -6,24 +6,20 @@ module Servactory | |
| 6 6 | 
             
                  ARRAY_DEFAULT_VALUE = ->(is: false, message: nil) { { is: is, message: message } }
         | 
| 7 7 |  | 
| 8 8 | 
             
                  attr_reader :name,
         | 
| 9 | 
            -
                              :internal_name | 
| 10 | 
            -
                              :collection_of_options
         | 
| 9 | 
            +
                              :internal_name
         | 
| 11 10 |  | 
| 12 11 | 
             
                  # rubocop:disable Style/KeywordParametersOrder
         | 
| 13 12 | 
             
                  def initialize(
         | 
| 14 13 | 
             
                    name,
         | 
| 15 14 | 
             
                    as: nil,
         | 
| 16 | 
            -
                    collection_of_options:,
         | 
| 17 15 | 
             
                    type:,
         | 
| 18 16 | 
             
                    **options
         | 
| 19 17 | 
             
                  )
         | 
| 20 18 | 
             
                    @name = name
         | 
| 21 19 | 
             
                    @internal_name = as.present? ? as : name
         | 
| 22 | 
            -
                    @collection_of_options = collection_of_options
         | 
| 23 | 
            -
             | 
| 24 20 | 
             
                    add_basic_options_with(type: type, options: options)
         | 
| 25 21 |  | 
| 26 | 
            -
                     | 
| 22 | 
            +
                    collection_of_options.each do |option|
         | 
| 27 23 | 
             
                      self.class.attr_reader(:"#{option.name}")
         | 
| 28 24 |  | 
| 29 25 | 
             
                      instance_variable_set(:"@#{option.name}", option.value)
         | 
| @@ -182,6 +178,10 @@ module Servactory | |
| 182 178 | 
             
                    )
         | 
| 183 179 | 
             
                  end
         | 
| 184 180 |  | 
| 181 | 
            +
                  def collection_of_options
         | 
| 182 | 
            +
                    @collection_of_options ||= OptionsCollection.new
         | 
| 183 | 
            +
                  end
         | 
| 184 | 
            +
             | 
| 185 185 | 
             
                  def options_for_checks
         | 
| 186 186 | 
             
                    collection_of_options.options_for_checks
         | 
| 187 187 | 
             
                  end
         | 
| @@ -8,11 +8,10 @@ module Servactory | |
| 8 8 | 
             
                      new(...).check!
         | 
| 9 9 | 
             
                    end
         | 
| 10 10 |  | 
| 11 | 
            -
                    def initialize(context, incoming_arguments, collection_of_input_arguments | 
| 11 | 
            +
                    def initialize(context, incoming_arguments, collection_of_input_arguments)
         | 
| 12 12 | 
             
                      @context = context
         | 
| 13 13 | 
             
                      @incoming_arguments = incoming_arguments
         | 
| 14 14 | 
             
                      @collection_of_input_arguments = collection_of_input_arguments
         | 
| 15 | 
            -
                      @collection_of_input_options = collection_of_input_options
         | 
| 16 15 | 
             
                    end
         | 
| 17 16 |  | 
| 18 17 | 
             
                    def check!
         | 
| @@ -32,7 +31,7 @@ module Servactory | |
| 32 31 | 
             
                    end
         | 
| 33 32 |  | 
| 34 33 | 
             
                    def process_option(check_key, check_options, input:)
         | 
| 35 | 
            -
                       | 
| 34 | 
            +
                      check_classes_from(input).each do |check_class|
         | 
| 36 35 | 
             
                        errors_from_checks = process_check_class(
         | 
| 37 36 | 
             
                          check_class,
         | 
| 38 37 | 
             
                          input: input,
         | 
| @@ -56,8 +55,8 @@ module Servactory | |
| 56 55 |  | 
| 57 56 | 
             
                    ########################################################################
         | 
| 58 57 |  | 
| 59 | 
            -
                    def  | 
| 60 | 
            -
                       | 
| 58 | 
            +
                    def check_classes_from(input)
         | 
| 59 | 
            +
                      input.collection_of_options.check_classes
         | 
| 61 60 | 
             
                    end
         | 
| 62 61 |  | 
| 63 62 | 
             
                    ########################################################################
         | 
| @@ -11,10 +11,9 @@ module Servactory | |
| 11 11 | 
             
                    @collection_of_input_arguments = collection_of_input_arguments
         | 
| 12 12 | 
             
                  end
         | 
| 13 13 |  | 
| 14 | 
            -
                  def assign(context:, arguments | 
| 14 | 
            +
                  def assign(context:, arguments:)
         | 
| 15 15 | 
             
                    @context = context
         | 
| 16 16 | 
             
                    @incoming_arguments = arguments
         | 
| 17 | 
            -
                    @collection_of_input_options = collection_of_input_options
         | 
| 18 17 | 
             
                  end
         | 
| 19 18 |  | 
| 20 19 | 
             
                  def find_unnecessary!
         | 
| @@ -30,14 +29,13 @@ module Servactory | |
| 30 29 | 
             
                  end
         | 
| 31 30 |  | 
| 32 31 | 
             
                  def check!
         | 
| 33 | 
            -
                    Tools::Check.check!(context, @incoming_arguments, collection_of_input_arguments | 
| 32 | 
            +
                    Tools::Check.check!(context, @incoming_arguments, collection_of_input_arguments)
         | 
| 34 33 | 
             
                  end
         | 
| 35 34 |  | 
| 36 35 | 
             
                  private
         | 
| 37 36 |  | 
| 38 37 | 
             
                  attr_reader :context,
         | 
| 39 | 
            -
                              :collection_of_input_arguments | 
| 40 | 
            -
                              :collection_of_input_options
         | 
| 38 | 
            +
                              :collection_of_input_arguments
         | 
| 41 39 | 
             
                end
         | 
| 42 40 | 
             
              end
         | 
| 43 41 | 
             
            end
         | 
    
        data/lib/servactory/version.rb
    CHANGED