lacerda 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +4 -0
- data/README.md +6 -6
- data/lib/lacerda.rb +2 -2
- data/lib/lacerda/{consume_contract.rb → consume_specification.rb} +2 -2
- data/lib/lacerda/conversion/data_structure.rb +20 -0
- data/lib/lacerda/{publish_contract.rb → publish_specification.rb} +6 -2
- data/lib/lacerda/service.rb +2 -2
- data/lib/lacerda/{contract.rb → specification.rb} +1 -1
- data/lib/lacerda/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff23a2681e40e382e4e01fb4ce0b67aaab1c24ce
|
4
|
+
data.tar.gz: 605bd530f4bc51914bbc2f6e513156e4e7eedc20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 131589ccbb3c6ff9ada1e8498ce3836ad151eaa0cb778675086c67f23f5b3e36494c8914f7bcbf041156f4c0b49d23738ef8f6a424e186b1504fa5310fe4b9e4
|
7
|
+
data.tar.gz: d7d6ae3c7d5506772fe8eb787dc73365b8fa1337afc36977cf5685936007291f7aa9232da56512904bdf679e6f883cf07ee65f923959376c0a948aee35621c06
|
data/CHANGELOG.markdown
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# 0.11.0 (04-Nov-15)
|
2
|
+
- rename ConsumeContract and PublishContract to ConsumeSpecification and PublishSpecification
|
3
|
+
- omit redundant service name in model names of publish contracts
|
4
|
+
|
1
5
|
# 0.10.2 (04-Nov-15)
|
2
6
|
- report all missing definitions instead of just the first (fixes #8)
|
3
7
|
|
data/README.md
CHANGED
@@ -37,10 +37,10 @@ and smoke it:
|
|
37
37
|
```shell
|
38
38
|
/home/dev/lacerda$ DATA_DIR=contracts/ rake lacerda:mson_to_json_schema
|
39
39
|
Converting 4 files:
|
40
|
-
OK /home/dev/lacerda/
|
41
|
-
OK /home/dev/lacerda/
|
42
|
-
OK /home/dev/lacerda/
|
43
|
-
OK /home/dev/lacerda/
|
40
|
+
OK /home/dev/lacerda/specifications/consumer/consume.mson
|
41
|
+
OK /home/dev/lacerda/specifications/invalid_property/consume.mson
|
42
|
+
OK /home/dev/lacerda/specifications/missing_required/consume.mson
|
43
|
+
OK /home/dev/lacerda/specifications/publisher/publish.mson
|
44
44
|
/home/dev/lacerda$
|
45
45
|
```
|
46
46
|
|
@@ -59,9 +59,9 @@ By converting all files in a directory this gem will build up the following rela
|
|
59
59
|
- Infrastructure
|
60
60
|
- Service
|
61
61
|
- Contracts
|
62
|
-
- Publish
|
62
|
+
- Publish specification
|
63
63
|
- PublishedObjects
|
64
|
-
- Consume
|
64
|
+
- Consume specification
|
65
65
|
- ConsumedObjects
|
66
66
|
|
67
67
|
# References
|
data/lib/lacerda.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'lacerda/conversion'
|
2
|
-
require 'lacerda/
|
3
|
-
require 'lacerda/
|
2
|
+
require 'lacerda/publish_specification'
|
3
|
+
require 'lacerda/consume_specification'
|
4
4
|
require 'lacerda/service'
|
5
5
|
require 'lacerda/infrastructure'
|
6
6
|
require 'lacerda/compare/json_schema'
|
@@ -6,6 +6,26 @@ module Lacerda
|
|
6
6
|
PRIMITIVES = %w{boolean string number array enum object}
|
7
7
|
|
8
8
|
def self.scope(scope, string)
|
9
|
+
# This allows users to enter either
|
10
|
+
#
|
11
|
+
# # Message
|
12
|
+
# - id (number, required)
|
13
|
+
# - ...
|
14
|
+
#
|
15
|
+
# or
|
16
|
+
#
|
17
|
+
# # MessageService::Message
|
18
|
+
# - id (number, required)
|
19
|
+
# - ...
|
20
|
+
#
|
21
|
+
# in their publish.mson specification files. Including the service name in
|
22
|
+
# a publish specification is redundant and not necessary, but let's let our
|
23
|
+
# friendly users do this if they wish.
|
24
|
+
#
|
25
|
+
scope = nil if Lacerda.underscore(string.to_s).start_with?(Lacerda.underscore(scope.to_s))
|
26
|
+
|
27
|
+
# Now that this is out of the way, let's put a
|
28
|
+
# scope in front and return the string.
|
9
29
|
Lacerda.underscore(
|
10
30
|
[scope, string.to_s].compact.join(Lacerda::SCOPE_SEPARATOR)
|
11
31
|
)
|
@@ -1,7 +1,11 @@
|
|
1
|
-
require 'lacerda/
|
1
|
+
require 'lacerda/specification'
|
2
2
|
|
3
3
|
module Lacerda
|
4
|
-
class
|
4
|
+
class PublishSpecification < Lacerda::Specification
|
5
|
+
|
6
|
+
def initialize(service, schema_or_file)
|
7
|
+
super
|
8
|
+
end
|
5
9
|
|
6
10
|
def errors
|
7
11
|
return [] unless @comparator
|
data/lib/lacerda/service.rb
CHANGED
@@ -85,8 +85,8 @@ module Lacerda
|
|
85
85
|
private
|
86
86
|
|
87
87
|
def load_contracts
|
88
|
-
@publish = Lacerda::
|
89
|
-
@consume = Lacerda::
|
88
|
+
@publish = Lacerda::PublishSpecification.new(self, File.join(@data_dir, "publish.schema.json"))
|
89
|
+
@consume = Lacerda::ConsumeSpecification.new(self, File.join(@data_dir, "consume.schema.json"))
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
data/lib/lacerda/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lacerda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jannis Hermanns
|
@@ -213,16 +213,15 @@ files:
|
|
213
213
|
- lacerda.gemspec
|
214
214
|
- lib/lacerda.rb
|
215
215
|
- lib/lacerda/compare/json_schema.rb
|
216
|
-
- lib/lacerda/
|
216
|
+
- lib/lacerda/consume_specification.rb
|
217
217
|
- lib/lacerda/consumed_object.rb
|
218
|
-
- lib/lacerda/contract.rb
|
219
218
|
- lib/lacerda/conversion.rb
|
220
219
|
- lib/lacerda/conversion/apiary_to_json_schema.rb
|
221
220
|
- lib/lacerda/conversion/data_structure.rb
|
222
221
|
- lib/lacerda/conversion/error.rb
|
223
222
|
- lib/lacerda/infrastructure.rb
|
224
223
|
- lib/lacerda/object_description.rb
|
225
|
-
- lib/lacerda/
|
224
|
+
- lib/lacerda/publish_specification.rb
|
226
225
|
- lib/lacerda/published_object.rb
|
227
226
|
- lib/lacerda/reporter.rb
|
228
227
|
- lib/lacerda/reporters/multi.rb
|
@@ -231,6 +230,7 @@ files:
|
|
231
230
|
- lib/lacerda/rspec_integration.rb
|
232
231
|
- lib/lacerda/service.rb
|
233
232
|
- lib/lacerda/service/error.rb
|
233
|
+
- lib/lacerda/specification.rb
|
234
234
|
- lib/lacerda/tasks.rb
|
235
235
|
- lib/lacerda/version.rb
|
236
236
|
homepage: https://github.com/moviepilot/lacerda
|