treaty 0.0.1 → 0.1.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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -18
  3. data/Rakefile +4 -2
  4. data/lib/treaty/attribute/base.rb +172 -0
  5. data/lib/treaty/attribute/builder/base.rb +142 -0
  6. data/lib/treaty/attribute/collection.rb +65 -0
  7. data/lib/treaty/attribute/helper_mapper.rb +72 -0
  8. data/lib/treaty/attribute/option/base.rb +159 -0
  9. data/lib/treaty/attribute/option/modifiers/as_modifier.rb +87 -0
  10. data/lib/treaty/attribute/option/modifiers/default_modifier.rb +103 -0
  11. data/lib/treaty/attribute/option/registry.rb +128 -0
  12. data/lib/treaty/attribute/option/registry_initializer.rb +90 -0
  13. data/lib/treaty/attribute/option/validators/inclusion_validator.rb +80 -0
  14. data/lib/treaty/attribute/option/validators/required_validator.rb +94 -0
  15. data/lib/treaty/attribute/option/validators/type_validator.rb +153 -0
  16. data/lib/treaty/attribute/option_normalizer.rb +150 -0
  17. data/lib/treaty/attribute/option_orchestrator.rb +186 -0
  18. data/lib/treaty/attribute/validation/attribute_validator.rb +144 -0
  19. data/lib/treaty/attribute/validation/base.rb +93 -0
  20. data/lib/treaty/attribute/validation/nested_array_validator.rb +194 -0
  21. data/lib/treaty/attribute/validation/nested_object_validator.rb +103 -0
  22. data/lib/treaty/attribute/validation/nested_transformer.rb +240 -0
  23. data/lib/treaty/attribute/validation/orchestrator/base.rb +196 -0
  24. data/lib/treaty/base.rb +9 -0
  25. data/lib/treaty/configuration.rb +17 -0
  26. data/lib/treaty/context/callable.rb +24 -0
  27. data/lib/treaty/context/dsl.rb +12 -0
  28. data/lib/treaty/context/workspace.rb +28 -0
  29. data/lib/treaty/controller/dsl.rb +38 -0
  30. data/lib/treaty/engine.rb +37 -0
  31. data/lib/treaty/exceptions/base.rb +8 -0
  32. data/lib/treaty/exceptions/class_name.rb +11 -0
  33. data/lib/treaty/exceptions/deprecated.rb +8 -0
  34. data/lib/treaty/exceptions/execution.rb +8 -0
  35. data/lib/treaty/exceptions/method_name.rb +8 -0
  36. data/lib/treaty/exceptions/nested_attributes.rb +8 -0
  37. data/lib/treaty/exceptions/strategy.rb +8 -0
  38. data/lib/treaty/exceptions/unexpected.rb +8 -0
  39. data/lib/treaty/exceptions/validation.rb +8 -0
  40. data/lib/treaty/info/builder.rb +122 -0
  41. data/lib/treaty/info/dsl.rb +26 -0
  42. data/lib/treaty/info/result.rb +13 -0
  43. data/lib/treaty/request/attribute/attribute.rb +24 -0
  44. data/lib/treaty/request/attribute/builder.rb +22 -0
  45. data/lib/treaty/request/attribute/validation/orchestrator.rb +27 -0
  46. data/lib/treaty/request/attribute/validator.rb +50 -0
  47. data/lib/treaty/request/factory.rb +32 -0
  48. data/lib/treaty/request/scope/collection.rb +21 -0
  49. data/lib/treaty/request/scope/factory.rb +42 -0
  50. data/lib/treaty/response/attribute/attribute.rb +24 -0
  51. data/lib/treaty/response/attribute/builder.rb +22 -0
  52. data/lib/treaty/response/attribute/validation/orchestrator.rb +27 -0
  53. data/lib/treaty/response/attribute/validator.rb +44 -0
  54. data/lib/treaty/response/factory.rb +38 -0
  55. data/lib/treaty/response/scope/collection.rb +21 -0
  56. data/lib/treaty/response/scope/factory.rb +42 -0
  57. data/lib/treaty/result.rb +22 -0
  58. data/lib/treaty/strategy.rb +31 -0
  59. data/lib/treaty/support/loader.rb +24 -0
  60. data/lib/treaty/version.rb +8 -1
  61. data/lib/treaty/versions/collection.rb +15 -0
  62. data/lib/treaty/versions/dsl.rb +30 -0
  63. data/lib/treaty/versions/execution/request.rb +151 -0
  64. data/lib/treaty/versions/executor.rb +14 -0
  65. data/lib/treaty/versions/factory.rb +93 -0
  66. data/lib/treaty/versions/resolver.rb +72 -0
  67. data/lib/treaty/versions/semantic.rb +22 -0
  68. data/lib/treaty/versions/workspace.rb +40 -0
  69. data/lib/treaty.rb +3 -3
  70. metadata +184 -27
  71. data/.standard.yml +0 -3
  72. data/CHANGELOG.md +0 -5
  73. data/CODE_OF_CONDUCT.md +0 -84
  74. data/LICENSE.txt +0 -21
  75. data/sig/treaty.rbs +0 -4
  76. data/treaty.gemspec +0 -35
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Treaty
4
+ module Versions
5
+ class Executor
6
+ attr_reader :executor, :method
7
+
8
+ def initialize(executor, method)
9
+ @executor = executor
10
+ @method = method
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,93 @@
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
+ # TODO: It is necessary to implement a translation system (I18n).
77
+ raise Treaty::Exceptions::Validation,
78
+ "Default option for version must be true, false, or a Proc, got: #{@default_result.class}"
79
+ end
80
+
81
+ ##########################################################################
82
+
83
+ def method_missing(name, *, &_block)
84
+ # TODO: It is necessary to implement a translation system (I18n).
85
+ raise Treaty::Exceptions::MethodName, "Unknown method: #{name}"
86
+ end
87
+
88
+ def respond_to_missing?(name, *)
89
+ super
90
+ end
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,72 @@
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
+ # TODO: It is necessary to implement a translation system (I18n).
55
+ raise Treaty::Exceptions::Validation,
56
+ "Current version is required for validation"
57
+ end
58
+
59
+ def raise_version_not_found!
60
+ # TODO: It is necessary to implement a translation system (I18n).
61
+ raise Treaty::Exceptions::Validation,
62
+ "Version #{current_version} not found in treaty definition"
63
+ end
64
+
65
+ def raise_version_deprecated!
66
+ # TODO: It is necessary to implement a translation system (I18n).
67
+ raise Treaty::Exceptions::Deprecated,
68
+ "Version #{current_version} is deprecated and cannot be used"
69
+ end
70
+ end
71
+ end
72
+ 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
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "treaty/version"
3
+ require "treaty/support/loader"
4
4
 
5
5
  module Treaty
6
- class Error < StandardError; end
7
- # Your code goes here...
8
6
  end
7
+
8
+ require "treaty/engine" if defined?(Rails::Engine)
metadata CHANGED
@@ -1,54 +1,211 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: treaty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Florian Kraft
8
- autorequire:
9
- bindir: exe
7
+ - Anton Sokolov
8
+ bindir: bin
10
9
  cert_chain: []
11
- date: 2024-03-02 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: ffi
13
+ name: rails
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - "~>"
16
+ - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '1.1'
18
+ version: '7.1'
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.1'
27
- description: A mashup to replace pact-ruby with pact-verifier and FFI
25
+ version: '7.1'
26
+ - !ruby/object:Gem::Dependency
27
+ name: zeitwerk
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '2.6'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '2.6'
40
+ - !ruby/object:Gem::Dependency
41
+ name: appraisal
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '2.5'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '2.5'
54
+ - !ruby/object:Gem::Dependency
55
+ name: rake
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '13.2'
61
+ type: :development
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '13.2'
68
+ - !ruby/object:Gem::Dependency
69
+ name: rspec
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '3.13'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '3.13'
82
+ - !ruby/object:Gem::Dependency
83
+ name: rspec-rails
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '7.0'
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '7.0'
96
+ - !ruby/object:Gem::Dependency
97
+ name: servactory
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '2.16'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '2.16'
110
+ - !ruby/object:Gem::Dependency
111
+ name: servactory-rubocop
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0.9'
117
+ type: :development
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0.9'
124
+ description: Flexible DTO library combining data transfer objects, adapter pattern,
125
+ and embedded execution logic for clean architecture
28
126
  email:
29
- - schnuffifk@gmail.com
127
+ - profox.rus@gmail.com
30
128
  executables: []
31
129
  extensions: []
32
130
  extra_rdoc_files: []
33
131
  files:
34
- - ".standard.yml"
35
- - CHANGELOG.md
36
- - CODE_OF_CONDUCT.md
37
- - LICENSE.txt
38
132
  - README.md
39
133
  - Rakefile
40
134
  - lib/treaty.rb
135
+ - lib/treaty/attribute/base.rb
136
+ - lib/treaty/attribute/builder/base.rb
137
+ - lib/treaty/attribute/collection.rb
138
+ - lib/treaty/attribute/helper_mapper.rb
139
+ - lib/treaty/attribute/option/base.rb
140
+ - lib/treaty/attribute/option/modifiers/as_modifier.rb
141
+ - lib/treaty/attribute/option/modifiers/default_modifier.rb
142
+ - lib/treaty/attribute/option/registry.rb
143
+ - lib/treaty/attribute/option/registry_initializer.rb
144
+ - lib/treaty/attribute/option/validators/inclusion_validator.rb
145
+ - lib/treaty/attribute/option/validators/required_validator.rb
146
+ - lib/treaty/attribute/option/validators/type_validator.rb
147
+ - lib/treaty/attribute/option_normalizer.rb
148
+ - lib/treaty/attribute/option_orchestrator.rb
149
+ - lib/treaty/attribute/validation/attribute_validator.rb
150
+ - lib/treaty/attribute/validation/base.rb
151
+ - lib/treaty/attribute/validation/nested_array_validator.rb
152
+ - lib/treaty/attribute/validation/nested_object_validator.rb
153
+ - lib/treaty/attribute/validation/nested_transformer.rb
154
+ - lib/treaty/attribute/validation/orchestrator/base.rb
155
+ - lib/treaty/base.rb
156
+ - lib/treaty/configuration.rb
157
+ - lib/treaty/context/callable.rb
158
+ - lib/treaty/context/dsl.rb
159
+ - lib/treaty/context/workspace.rb
160
+ - lib/treaty/controller/dsl.rb
161
+ - lib/treaty/engine.rb
162
+ - lib/treaty/exceptions/base.rb
163
+ - lib/treaty/exceptions/class_name.rb
164
+ - lib/treaty/exceptions/deprecated.rb
165
+ - lib/treaty/exceptions/execution.rb
166
+ - lib/treaty/exceptions/method_name.rb
167
+ - lib/treaty/exceptions/nested_attributes.rb
168
+ - lib/treaty/exceptions/strategy.rb
169
+ - lib/treaty/exceptions/unexpected.rb
170
+ - lib/treaty/exceptions/validation.rb
171
+ - lib/treaty/info/builder.rb
172
+ - lib/treaty/info/dsl.rb
173
+ - lib/treaty/info/result.rb
174
+ - lib/treaty/request/attribute/attribute.rb
175
+ - lib/treaty/request/attribute/builder.rb
176
+ - lib/treaty/request/attribute/validation/orchestrator.rb
177
+ - lib/treaty/request/attribute/validator.rb
178
+ - lib/treaty/request/factory.rb
179
+ - lib/treaty/request/scope/collection.rb
180
+ - lib/treaty/request/scope/factory.rb
181
+ - lib/treaty/response/attribute/attribute.rb
182
+ - lib/treaty/response/attribute/builder.rb
183
+ - lib/treaty/response/attribute/validation/orchestrator.rb
184
+ - lib/treaty/response/attribute/validator.rb
185
+ - lib/treaty/response/factory.rb
186
+ - lib/treaty/response/scope/collection.rb
187
+ - lib/treaty/response/scope/factory.rb
188
+ - lib/treaty/result.rb
189
+ - lib/treaty/strategy.rb
190
+ - lib/treaty/support/loader.rb
41
191
  - lib/treaty/version.rb
42
- - sig/treaty.rbs
43
- - treaty.gemspec
44
- homepage: https://github.com/floriank/treaty
192
+ - lib/treaty/versions/collection.rb
193
+ - lib/treaty/versions/dsl.rb
194
+ - lib/treaty/versions/execution/request.rb
195
+ - lib/treaty/versions/executor.rb
196
+ - lib/treaty/versions/factory.rb
197
+ - lib/treaty/versions/resolver.rb
198
+ - lib/treaty/versions/semantic.rb
199
+ - lib/treaty/versions/workspace.rb
200
+ homepage: https://github.com/servactory/treaty
45
201
  licenses:
46
202
  - MIT
47
203
  metadata:
48
- homepage_uri: https://github.com/floriank/treaty
49
- source_code_uri: https://github.com/floriank/treaty
50
- changelog_uri: https://github.com/floriank/treaty/blob/main/CHANGLEOG.md
51
- post_install_message:
204
+ homepage_uri: https://github.com/servactory/treaty
205
+ source_code_uri: https://github.com/servactory/treaty
206
+ bug_tracker_uri: https://github.com/servactory/treaty/issues
207
+ changelog_uri: https://github.com/servactory/treaty/blob/master/CHANGELOG.md
208
+ rubygems_mfa_required: 'true'
52
209
  rdoc_options: []
53
210
  require_paths:
54
211
  - lib
@@ -56,15 +213,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
56
213
  requirements:
57
214
  - - ">="
58
215
  - !ruby/object:Gem::Version
59
- version: 2.6.0
216
+ version: '3.2'
60
217
  required_rubygems_version: !ruby/object:Gem::Requirement
61
218
  requirements:
62
219
  - - ">="
63
220
  - !ruby/object:Gem::Version
64
221
  version: '0'
65
222
  requirements: []
66
- rubygems_version: 3.5.3
67
- signing_key:
223
+ rubygems_version: 3.6.9
68
224
  specification_version: 4
69
- summary: An prototype to see if pact verifier and ffi can work together.
225
+ summary: Flexible DTO library combining data transfer objects, adapter pattern, and
226
+ embedded execution logic for clean architecture
70
227
  test_files: []
data/.standard.yml DELETED
@@ -1,3 +0,0 @@
1
- # For available configuration options, see:
2
- # https://github.com/standardrb/standard
3
- ruby_version: 2.6
data/CHANGELOG.md DELETED
@@ -1,5 +0,0 @@
1
- ## [Unreleased]
2
-
3
- ## [0.1.0] - 2024-03-02
4
-
5
- - Initial release
data/CODE_OF_CONDUCT.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at schnuffifk@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 Florian Kraft
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/sig/treaty.rbs DELETED
@@ -1,4 +0,0 @@
1
- module Treaty
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end
data/treaty.gemspec DELETED
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/treaty/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "treaty"
7
- spec.version = Treaty::VERSION
8
- spec.authors = ["Florian Kraft"]
9
- spec.email = ["schnuffifk@gmail.com"]
10
-
11
- spec.summary = "An prototype to see if pact verifier and ffi can work together."
12
- spec.description = "A mashup to replace pact-ruby with pact-verifier and FFI"
13
- spec.homepage = "https://github.com/floriank/treaty"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.6.0"
16
-
17
- spec.metadata["homepage_uri"] = spec.homepage
18
- spec.metadata["source_code_uri"] = "https://github.com/floriank/treaty"
19
- spec.metadata["changelog_uri"] = "https://github.com/floriank/treaty/blob/main/CHANGLEOG.md"
20
-
21
- # Specify which files should be added to the gem when it is released.
22
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
- spec.files = Dir.chdir(__dir__) do
24
- `git ls-files -z`.split("\x0").reject do |f|
25
- (File.expand_path(f) == __FILE__) ||
26
- f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
27
- end
28
- end
29
- spec.bindir = "exe"
30
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
31
- spec.require_paths = ["lib"]
32
-
33
- # Uncomment to register a new dependency of your gem
34
- spec.add_dependency "ffi", "~> 1.1"
35
- end