treaty 0.0.1 → 0.2.0
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/README.md +106 -17
- data/Rakefile +4 -2
- data/config/locales/en.yml +96 -0
- data/lib/treaty/attribute/base.rb +174 -0
- data/lib/treaty/attribute/builder/base.rb +143 -0
- data/lib/treaty/attribute/collection.rb +65 -0
- data/lib/treaty/attribute/helper_mapper.rb +72 -0
- data/lib/treaty/attribute/option/base.rb +160 -0
- data/lib/treaty/attribute/option/modifiers/as_modifier.rb +88 -0
- data/lib/treaty/attribute/option/modifiers/default_modifier.rb +103 -0
- data/lib/treaty/attribute/option/registry.rb +128 -0
- data/lib/treaty/attribute/option/registry_initializer.rb +90 -0
- data/lib/treaty/attribute/option/validators/inclusion_validator.rb +80 -0
- data/lib/treaty/attribute/option/validators/required_validator.rb +92 -0
- data/lib/treaty/attribute/option/validators/type_validator.rb +159 -0
- data/lib/treaty/attribute/option_normalizer.rb +151 -0
- data/lib/treaty/attribute/option_orchestrator.rb +187 -0
- data/lib/treaty/attribute/validation/attribute_validator.rb +144 -0
- data/lib/treaty/attribute/validation/base.rb +92 -0
- data/lib/treaty/attribute/validation/nested_array_validator.rb +199 -0
- data/lib/treaty/attribute/validation/nested_object_validator.rb +103 -0
- data/lib/treaty/attribute/validation/nested_transformer.rb +246 -0
- data/lib/treaty/attribute/validation/orchestrator/base.rb +194 -0
- data/lib/treaty/base.rb +9 -0
- data/lib/treaty/configuration.rb +17 -0
- data/lib/treaty/context/callable.rb +24 -0
- data/lib/treaty/context/dsl.rb +12 -0
- data/lib/treaty/context/workspace.rb +28 -0
- data/lib/treaty/controller/dsl.rb +38 -0
- data/lib/treaty/engine.rb +37 -0
- data/lib/treaty/exceptions/base.rb +47 -0
- data/lib/treaty/exceptions/class_name.rb +50 -0
- data/lib/treaty/exceptions/deprecated.rb +54 -0
- data/lib/treaty/exceptions/execution.rb +66 -0
- data/lib/treaty/exceptions/method_name.rb +55 -0
- data/lib/treaty/exceptions/nested_attributes.rb +65 -0
- data/lib/treaty/exceptions/not_implemented.rb +32 -0
- data/lib/treaty/exceptions/strategy.rb +63 -0
- data/lib/treaty/exceptions/unexpected.rb +70 -0
- data/lib/treaty/exceptions/validation.rb +97 -0
- data/lib/treaty/info/builder.rb +122 -0
- data/lib/treaty/info/dsl.rb +26 -0
- data/lib/treaty/info/result.rb +13 -0
- data/lib/treaty/request/attribute/attribute.rb +24 -0
- data/lib/treaty/request/attribute/builder.rb +22 -0
- data/lib/treaty/request/attribute/validation/orchestrator.rb +27 -0
- data/lib/treaty/request/attribute/validator.rb +50 -0
- data/lib/treaty/request/factory.rb +32 -0
- data/lib/treaty/request/scope/collection.rb +21 -0
- data/lib/treaty/request/scope/factory.rb +42 -0
- data/lib/treaty/response/attribute/attribute.rb +24 -0
- data/lib/treaty/response/attribute/builder.rb +22 -0
- data/lib/treaty/response/attribute/validation/orchestrator.rb +27 -0
- data/lib/treaty/response/attribute/validator.rb +44 -0
- data/lib/treaty/response/factory.rb +38 -0
- data/lib/treaty/response/scope/collection.rb +21 -0
- data/lib/treaty/response/scope/factory.rb +42 -0
- data/lib/treaty/result.rb +22 -0
- data/lib/treaty/strategy.rb +31 -0
- data/lib/treaty/support/loader.rb +24 -0
- data/lib/treaty/version.rb +8 -1
- data/lib/treaty/versions/collection.rb +15 -0
- data/lib/treaty/versions/dsl.rb +30 -0
- data/lib/treaty/versions/execution/request.rb +147 -0
- data/lib/treaty/versions/executor.rb +14 -0
- data/lib/treaty/versions/factory.rb +92 -0
- data/lib/treaty/versions/resolver.rb +69 -0
- data/lib/treaty/versions/semantic.rb +22 -0
- data/lib/treaty/versions/workspace.rb +40 -0
- data/lib/treaty.rb +3 -3
- metadata +200 -27
- data/.standard.yml +0 -3
- data/CHANGELOG.md +0 -5
- data/CODE_OF_CONDUCT.md +0 -84
- data/LICENSE.txt +0 -21
- data/sig/treaty.rbs +0 -4
- data/treaty.gemspec +0 -35
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Treaty
|
|
4
|
+
module Versions
|
|
5
|
+
module Execution
|
|
6
|
+
class Request
|
|
7
|
+
def self.execute!(...)
|
|
8
|
+
new(...).execute!
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def initialize(version_factory:, validated_params:)
|
|
12
|
+
@version_factory = version_factory
|
|
13
|
+
@validated_params = validated_params
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def execute!
|
|
17
|
+
raise_executor_missing_error! if @version_factory.executor.nil?
|
|
18
|
+
|
|
19
|
+
extract_data_from_result
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
private
|
|
23
|
+
|
|
24
|
+
def extract_data_from_result
|
|
25
|
+
return execution_result if executor.is_a?(Proc)
|
|
26
|
+
return execution_result.data if execution_result.respond_to?(:data)
|
|
27
|
+
|
|
28
|
+
execution_result
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
########################################################################
|
|
32
|
+
|
|
33
|
+
def execution_result
|
|
34
|
+
@execution_result ||=
|
|
35
|
+
if executor.is_a?(Proc)
|
|
36
|
+
execute_proc
|
|
37
|
+
elsif servactory_service?
|
|
38
|
+
execute_servactory
|
|
39
|
+
else
|
|
40
|
+
execute_regular_class
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
########################################################################
|
|
45
|
+
|
|
46
|
+
def executor
|
|
47
|
+
@executor ||= resolve_executor(@version_factory.executor.executor)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
########################################################################
|
|
51
|
+
|
|
52
|
+
def resolve_executor(executor) # rubocop:disable Metrics/MethodLength
|
|
53
|
+
return executor if executor.is_a?(Proc) || executor.is_a?(Class)
|
|
54
|
+
|
|
55
|
+
if executor.is_a?(String) || executor.is_a?(Symbol)
|
|
56
|
+
string_executor = executor.to_s
|
|
57
|
+
|
|
58
|
+
if string_executor.empty?
|
|
59
|
+
raise Treaty::Exceptions::Execution,
|
|
60
|
+
I18n.t("treaty.execution.executor_empty")
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
constant_name = normalize_constant_name(executor)
|
|
64
|
+
|
|
65
|
+
begin
|
|
66
|
+
constant_name.constantize
|
|
67
|
+
rescue NameError
|
|
68
|
+
raise Treaty::Exceptions::Execution,
|
|
69
|
+
I18n.t("treaty.execution.executor_not_found", class_name: constant_name)
|
|
70
|
+
end
|
|
71
|
+
else
|
|
72
|
+
raise Treaty::Exceptions::Execution,
|
|
73
|
+
I18n.t("treaty.execution.executor_invalid_type", type: executor.class)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
########################################################################
|
|
78
|
+
|
|
79
|
+
def normalize_constant_name(name)
|
|
80
|
+
string = name.to_s
|
|
81
|
+
|
|
82
|
+
return string if string.include?("::")
|
|
83
|
+
return string.split("/").map(&:camelize).join("::") if string.include?("/")
|
|
84
|
+
|
|
85
|
+
string
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
########################################################################
|
|
89
|
+
########################################################################
|
|
90
|
+
########################################################################
|
|
91
|
+
|
|
92
|
+
def execute_proc
|
|
93
|
+
executor.call(params: @validated_params)
|
|
94
|
+
rescue StandardError => e
|
|
95
|
+
raise Treaty::Exceptions::Execution,
|
|
96
|
+
I18n.t("treaty.execution.proc_error", message: e.message)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def execute_servactory # rubocop:disable Metrics/MethodLength
|
|
100
|
+
executor.call!(params: @validated_params)
|
|
101
|
+
rescue ApplicationService::Exceptions::Input => e
|
|
102
|
+
raise Treaty::Exceptions::Execution,
|
|
103
|
+
I18n.t("treaty.execution.servactory_input_error", message: e.message)
|
|
104
|
+
rescue ApplicationService::Exceptions::Internal => e
|
|
105
|
+
raise Treaty::Exceptions::Execution,
|
|
106
|
+
I18n.t("treaty.execution.servactory_internal_error", message: e.message)
|
|
107
|
+
rescue ApplicationService::Exceptions::Output => e
|
|
108
|
+
raise Treaty::Exceptions::Execution,
|
|
109
|
+
I18n.t("treaty.execution.servactory_output_error", message: e.message)
|
|
110
|
+
rescue ApplicationService::Exceptions::Failure => e
|
|
111
|
+
raise Treaty::Exceptions::Execution,
|
|
112
|
+
I18n.t("treaty.execution.servactory_failure_error", message: e.message)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def execute_regular_class # rubocop:disable Metrics/MethodLength
|
|
116
|
+
method_name = @version_factory.executor.method
|
|
117
|
+
|
|
118
|
+
unless executor.respond_to?(method_name)
|
|
119
|
+
raise Treaty::Exceptions::Execution,
|
|
120
|
+
I18n.t("treaty.execution.method_not_found",
|
|
121
|
+
method: method_name,
|
|
122
|
+
class_name: executor)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
executor.public_send(method_name, params: @validated_params)
|
|
126
|
+
rescue StandardError => e
|
|
127
|
+
raise Treaty::Exceptions::Execution,
|
|
128
|
+
I18n.t("treaty.execution.regular_service_error", message: e.message)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
########################################################################
|
|
132
|
+
########################################################################
|
|
133
|
+
########################################################################
|
|
134
|
+
|
|
135
|
+
def raise_executor_missing_error!
|
|
136
|
+
raise Treaty::Exceptions::Execution,
|
|
137
|
+
I18n.t("treaty.execution.executor_missing", version: @version_factory.version)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def servactory_service?
|
|
141
|
+
executor.respond_to?(:servactory?) &&
|
|
142
|
+
executor.servactory?
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Treaty
|
|
4
|
+
module Versions
|
|
5
|
+
class Factory
|
|
6
|
+
attr_reader :version,
|
|
7
|
+
:default_result,
|
|
8
|
+
:summary_text,
|
|
9
|
+
:strategy_instance,
|
|
10
|
+
:deprecated_result,
|
|
11
|
+
:executor,
|
|
12
|
+
:request_factory,
|
|
13
|
+
:response_factory
|
|
14
|
+
|
|
15
|
+
def initialize(version:, default:)
|
|
16
|
+
@version = Semantic.new(version)
|
|
17
|
+
@default_result = default.is_a?(Proc) ? default.call : default
|
|
18
|
+
@summary_text = nil
|
|
19
|
+
@strategy_instance = Strategy.new(Strategy::ADAPTER) # without .validate!
|
|
20
|
+
@deprecated_result = false
|
|
21
|
+
@executor = nil
|
|
22
|
+
|
|
23
|
+
validate!
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def validate!
|
|
27
|
+
validate_default_option!
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def summary(text)
|
|
31
|
+
@summary_text = text
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def strategy(code)
|
|
35
|
+
@strategy_instance = Strategy.new(code).validate!
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def deprecated(condition = nil)
|
|
39
|
+
result =
|
|
40
|
+
if condition.is_a?(Proc)
|
|
41
|
+
condition.call
|
|
42
|
+
elsif condition.is_a?(TrueClass) || condition.is_a?(FalseClass)
|
|
43
|
+
condition
|
|
44
|
+
else
|
|
45
|
+
yield
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
@deprecated_result = result
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def request(&block)
|
|
52
|
+
@request_factory ||= Request::Factory.new
|
|
53
|
+
|
|
54
|
+
@request_factory.instance_eval(&block) if block_given?
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def response(status, &block)
|
|
58
|
+
@response_factory ||= Response::Factory.new(status)
|
|
59
|
+
|
|
60
|
+
@response_factory.instance_eval(&block) if block_given?
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def delegate_to(executor, method = :call)
|
|
64
|
+
@executor = Executor.new(executor, method)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
##########################################################################
|
|
68
|
+
|
|
69
|
+
private
|
|
70
|
+
|
|
71
|
+
def validate_default_option!
|
|
72
|
+
if @default_result.is_a?(TrueClass) || @default_result.is_a?(FalseClass) || @default_result.is_a?(Proc)
|
|
73
|
+
return @default_result
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
raise Treaty::Exceptions::Validation,
|
|
77
|
+
I18n.t("treaty.versioning.factory.invalid_default_option", type: @default_result.class)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
##########################################################################
|
|
81
|
+
|
|
82
|
+
def method_missing(name, *, &_block)
|
|
83
|
+
raise Treaty::Exceptions::MethodName,
|
|
84
|
+
I18n.t("treaty.versioning.factory.unknown_method", method: name)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def respond_to_missing?(name, *)
|
|
88
|
+
super
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Treaty
|
|
4
|
+
module Versions
|
|
5
|
+
class Resolver
|
|
6
|
+
def self.resolve!(...)
|
|
7
|
+
new(...).resolve!
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def initialize(controller:, collection_of_versions:)
|
|
11
|
+
@controller = controller
|
|
12
|
+
@collection_of_versions = collection_of_versions
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def resolve!
|
|
16
|
+
determined_factory =
|
|
17
|
+
if current_version_blank?
|
|
18
|
+
default_version_factory || raise_current_version_not_found!
|
|
19
|
+
else
|
|
20
|
+
version_factory || raise_version_not_found!
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
raise_version_deprecated! if determined_factory.deprecated_result
|
|
24
|
+
|
|
25
|
+
determined_factory
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
def current_version
|
|
31
|
+
@current_version ||=
|
|
32
|
+
Treaty::Engine.config.treaty.version.call(@controller)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def version_factory
|
|
36
|
+
@version_factory ||=
|
|
37
|
+
@collection_of_versions.find do |factory|
|
|
38
|
+
factory.version.version == current_version
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def default_version_factory
|
|
43
|
+
@default_version_factory ||=
|
|
44
|
+
@collection_of_versions.find(&:default_result)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def current_version_blank?
|
|
48
|
+
current_version.to_s.strip.empty?
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
##########################################################################
|
|
52
|
+
|
|
53
|
+
def raise_current_version_not_found!
|
|
54
|
+
raise Treaty::Exceptions::Validation,
|
|
55
|
+
I18n.t("treaty.versioning.resolver.current_version_required")
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def raise_version_not_found!
|
|
59
|
+
raise Treaty::Exceptions::Validation,
|
|
60
|
+
I18n.t("treaty.versioning.resolver.version_not_found", version: current_version)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def raise_version_deprecated!
|
|
64
|
+
raise Treaty::Exceptions::Deprecated,
|
|
65
|
+
I18n.t("treaty.versioning.resolver.version_deprecated", version: current_version)
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Treaty
|
|
4
|
+
module Versions
|
|
5
|
+
class Semantic
|
|
6
|
+
attr_reader :version
|
|
7
|
+
|
|
8
|
+
def initialize(version)
|
|
9
|
+
version =
|
|
10
|
+
if version.is_a?(Array)
|
|
11
|
+
version.join(".")
|
|
12
|
+
# elsif version.is_a?(Integer)
|
|
13
|
+
# version.to_s
|
|
14
|
+
else
|
|
15
|
+
version # rubocop:disable Style/RedundantSelfAssignmentBranch
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
@version = Gem::Version.new(version)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Treaty
|
|
4
|
+
module Versions
|
|
5
|
+
module Workspace
|
|
6
|
+
private
|
|
7
|
+
|
|
8
|
+
def call!(controller:, **) # rubocop:disable Metrics/MethodLength
|
|
9
|
+
super
|
|
10
|
+
|
|
11
|
+
version_factory = Resolver.resolve!(
|
|
12
|
+
controller:,
|
|
13
|
+
collection_of_versions: @collection_of_versions
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
validated_params = Request::Attribute::Validator.validate!(
|
|
17
|
+
controller:,
|
|
18
|
+
version_factory:
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
executor_result = Execution::Request.execute!(
|
|
22
|
+
version_factory:,
|
|
23
|
+
validated_params:
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
validated_response = Response::Attribute::Validator.validate!(
|
|
27
|
+
version_factory:,
|
|
28
|
+
response_data: executor_result
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
status = version_factory.response_factory&.status || 200
|
|
32
|
+
|
|
33
|
+
Treaty::Result.new(
|
|
34
|
+
data: validated_response,
|
|
35
|
+
status:
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
data/lib/treaty.rb
CHANGED
metadata
CHANGED
|
@@ -1,54 +1,227 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: treaty
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
bindir: exe
|
|
7
|
+
- Anton Sokolov
|
|
8
|
+
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
13
|
+
name: i18n
|
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
|
16
15
|
requirements:
|
|
17
|
-
- - "
|
|
16
|
+
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.
|
|
18
|
+
version: '1.14'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
|
-
- - "
|
|
23
|
+
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.
|
|
27
|
-
|
|
25
|
+
version: '1.14'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: rails
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '7.1'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '7.1'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: zeitwerk
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '2.6'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '2.6'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: appraisal
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '2.5'
|
|
61
|
+
type: :development
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - ">="
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '2.5'
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: rake
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '13.2'
|
|
75
|
+
type: :development
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - ">="
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '13.2'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: rspec
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '3.13'
|
|
89
|
+
type: :development
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '3.13'
|
|
96
|
+
- !ruby/object:Gem::Dependency
|
|
97
|
+
name: rspec-rails
|
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - ">="
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: '7.0'
|
|
103
|
+
type: :development
|
|
104
|
+
prerelease: false
|
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
+
requirements:
|
|
107
|
+
- - ">="
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: '7.0'
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: servactory
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - ">="
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '2.16'
|
|
117
|
+
type: :development
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - ">="
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '2.16'
|
|
124
|
+
- !ruby/object:Gem::Dependency
|
|
125
|
+
name: servactory-rubocop
|
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - ">="
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '0.9'
|
|
131
|
+
type: :development
|
|
132
|
+
prerelease: false
|
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
134
|
+
requirements:
|
|
135
|
+
- - ">="
|
|
136
|
+
- !ruby/object:Gem::Version
|
|
137
|
+
version: '0.9'
|
|
138
|
+
description: A Ruby library for defining and managing REST API contracts with versioning
|
|
139
|
+
support
|
|
28
140
|
email:
|
|
29
|
-
-
|
|
141
|
+
- profox.rus@gmail.com
|
|
30
142
|
executables: []
|
|
31
143
|
extensions: []
|
|
32
144
|
extra_rdoc_files: []
|
|
33
145
|
files:
|
|
34
|
-
- ".standard.yml"
|
|
35
|
-
- CHANGELOG.md
|
|
36
|
-
- CODE_OF_CONDUCT.md
|
|
37
|
-
- LICENSE.txt
|
|
38
146
|
- README.md
|
|
39
147
|
- Rakefile
|
|
148
|
+
- config/locales/en.yml
|
|
40
149
|
- lib/treaty.rb
|
|
150
|
+
- lib/treaty/attribute/base.rb
|
|
151
|
+
- lib/treaty/attribute/builder/base.rb
|
|
152
|
+
- lib/treaty/attribute/collection.rb
|
|
153
|
+
- lib/treaty/attribute/helper_mapper.rb
|
|
154
|
+
- lib/treaty/attribute/option/base.rb
|
|
155
|
+
- lib/treaty/attribute/option/modifiers/as_modifier.rb
|
|
156
|
+
- lib/treaty/attribute/option/modifiers/default_modifier.rb
|
|
157
|
+
- lib/treaty/attribute/option/registry.rb
|
|
158
|
+
- lib/treaty/attribute/option/registry_initializer.rb
|
|
159
|
+
- lib/treaty/attribute/option/validators/inclusion_validator.rb
|
|
160
|
+
- lib/treaty/attribute/option/validators/required_validator.rb
|
|
161
|
+
- lib/treaty/attribute/option/validators/type_validator.rb
|
|
162
|
+
- lib/treaty/attribute/option_normalizer.rb
|
|
163
|
+
- lib/treaty/attribute/option_orchestrator.rb
|
|
164
|
+
- lib/treaty/attribute/validation/attribute_validator.rb
|
|
165
|
+
- lib/treaty/attribute/validation/base.rb
|
|
166
|
+
- lib/treaty/attribute/validation/nested_array_validator.rb
|
|
167
|
+
- lib/treaty/attribute/validation/nested_object_validator.rb
|
|
168
|
+
- lib/treaty/attribute/validation/nested_transformer.rb
|
|
169
|
+
- lib/treaty/attribute/validation/orchestrator/base.rb
|
|
170
|
+
- lib/treaty/base.rb
|
|
171
|
+
- lib/treaty/configuration.rb
|
|
172
|
+
- lib/treaty/context/callable.rb
|
|
173
|
+
- lib/treaty/context/dsl.rb
|
|
174
|
+
- lib/treaty/context/workspace.rb
|
|
175
|
+
- lib/treaty/controller/dsl.rb
|
|
176
|
+
- lib/treaty/engine.rb
|
|
177
|
+
- lib/treaty/exceptions/base.rb
|
|
178
|
+
- lib/treaty/exceptions/class_name.rb
|
|
179
|
+
- lib/treaty/exceptions/deprecated.rb
|
|
180
|
+
- lib/treaty/exceptions/execution.rb
|
|
181
|
+
- lib/treaty/exceptions/method_name.rb
|
|
182
|
+
- lib/treaty/exceptions/nested_attributes.rb
|
|
183
|
+
- lib/treaty/exceptions/not_implemented.rb
|
|
184
|
+
- lib/treaty/exceptions/strategy.rb
|
|
185
|
+
- lib/treaty/exceptions/unexpected.rb
|
|
186
|
+
- lib/treaty/exceptions/validation.rb
|
|
187
|
+
- lib/treaty/info/builder.rb
|
|
188
|
+
- lib/treaty/info/dsl.rb
|
|
189
|
+
- lib/treaty/info/result.rb
|
|
190
|
+
- lib/treaty/request/attribute/attribute.rb
|
|
191
|
+
- lib/treaty/request/attribute/builder.rb
|
|
192
|
+
- lib/treaty/request/attribute/validation/orchestrator.rb
|
|
193
|
+
- lib/treaty/request/attribute/validator.rb
|
|
194
|
+
- lib/treaty/request/factory.rb
|
|
195
|
+
- lib/treaty/request/scope/collection.rb
|
|
196
|
+
- lib/treaty/request/scope/factory.rb
|
|
197
|
+
- lib/treaty/response/attribute/attribute.rb
|
|
198
|
+
- lib/treaty/response/attribute/builder.rb
|
|
199
|
+
- lib/treaty/response/attribute/validation/orchestrator.rb
|
|
200
|
+
- lib/treaty/response/attribute/validator.rb
|
|
201
|
+
- lib/treaty/response/factory.rb
|
|
202
|
+
- lib/treaty/response/scope/collection.rb
|
|
203
|
+
- lib/treaty/response/scope/factory.rb
|
|
204
|
+
- lib/treaty/result.rb
|
|
205
|
+
- lib/treaty/strategy.rb
|
|
206
|
+
- lib/treaty/support/loader.rb
|
|
41
207
|
- lib/treaty/version.rb
|
|
42
|
-
-
|
|
43
|
-
- treaty.
|
|
44
|
-
|
|
208
|
+
- lib/treaty/versions/collection.rb
|
|
209
|
+
- lib/treaty/versions/dsl.rb
|
|
210
|
+
- lib/treaty/versions/execution/request.rb
|
|
211
|
+
- lib/treaty/versions/executor.rb
|
|
212
|
+
- lib/treaty/versions/factory.rb
|
|
213
|
+
- lib/treaty/versions/resolver.rb
|
|
214
|
+
- lib/treaty/versions/semantic.rb
|
|
215
|
+
- lib/treaty/versions/workspace.rb
|
|
216
|
+
homepage: https://github.com/servactory/treaty
|
|
45
217
|
licenses:
|
|
46
218
|
- MIT
|
|
47
219
|
metadata:
|
|
48
|
-
homepage_uri: https://github.com/
|
|
49
|
-
source_code_uri: https://github.com/
|
|
50
|
-
|
|
51
|
-
|
|
220
|
+
homepage_uri: https://github.com/servactory/treaty
|
|
221
|
+
source_code_uri: https://github.com/servactory/treaty
|
|
222
|
+
bug_tracker_uri: https://github.com/servactory/treaty/issues
|
|
223
|
+
changelog_uri: https://github.com/servactory/treaty/blob/master/CHANGELOG.md
|
|
224
|
+
rubygems_mfa_required: 'true'
|
|
52
225
|
rdoc_options: []
|
|
53
226
|
require_paths:
|
|
54
227
|
- lib
|
|
@@ -56,15 +229,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
56
229
|
requirements:
|
|
57
230
|
- - ">="
|
|
58
231
|
- !ruby/object:Gem::Version
|
|
59
|
-
version: 2
|
|
232
|
+
version: '3.2'
|
|
60
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
234
|
requirements:
|
|
62
235
|
- - ">="
|
|
63
236
|
- !ruby/object:Gem::Version
|
|
64
237
|
version: '0'
|
|
65
238
|
requirements: []
|
|
66
|
-
rubygems_version: 3.
|
|
67
|
-
signing_key:
|
|
239
|
+
rubygems_version: 3.6.9
|
|
68
240
|
specification_version: 4
|
|
69
|
-
summary:
|
|
241
|
+
summary: A Ruby library for defining and managing REST API contracts with versioning
|
|
242
|
+
support
|
|
70
243
|
test_files: []
|
data/.standard.yml
DELETED