minimum-term 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +3 -0
- data/lib/minimum-term/consume_contract.rb +3 -2
- data/lib/minimum-term/infrastructure.rb +9 -10
- data/lib/minimum-term/service.rb +1 -1
- data/lib/minimum-term/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcd9ab33f7e5c94673cfde9bf3c827711ad6e427
|
4
|
+
data.tar.gz: 9fa485769144e8e32e33a3cdcd4d6bc52d22b05b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 167416726cd4d4c3ff0b024af0ed019dd960ac92a1ae0157ff774f4c1df1d58f1ba9c5d380edbd1e2c432fac821e80f83db5366c57bd13cd02893301ed14eedf
|
7
|
+
data.tar.gz: 6570613fc59e6299275bd19f86f239fa23782c9713114709d185aff66b6e68e71f146614a89378b2fb506da1772e93ee75735e45519246ce4c867c0162b5ff3a
|
data/CHANGELOG.markdown
CHANGED
@@ -7,8 +7,9 @@ module MinimumTerm
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def scoped_schema(service)
|
10
|
-
|
11
|
-
schema
|
10
|
+
# Poor man's deep clone: json 🆗 🆒
|
11
|
+
filtered_schema = JSON.parse(schema.to_json)
|
12
|
+
filtered_schema['definitions'].select! do |k|
|
12
13
|
k.underscore.start_with?(service.name.underscore+MinimumTerm::SCOPE_SEPARATOR)
|
13
14
|
end
|
14
15
|
filtered_schema
|
@@ -2,22 +2,21 @@ require 'active_support/core_ext/hash/indifferent_access'
|
|
2
2
|
|
3
3
|
module MinimumTerm
|
4
4
|
class Infrastructure
|
5
|
-
attr_reader :
|
5
|
+
attr_reader :errors, :data_dir
|
6
6
|
|
7
7
|
def initialize(data_dir:, verbose: false)
|
8
8
|
@verbose = !!verbose
|
9
9
|
@data_dir = data_dir
|
10
|
-
@
|
11
|
-
|
10
|
+
@mutex1 = Mutex.new
|
11
|
+
@mutex2 = Mutex.new
|
12
12
|
end
|
13
13
|
|
14
14
|
def reload
|
15
|
-
|
15
|
+
@services = nil
|
16
16
|
end
|
17
17
|
|
18
18
|
def contracts_fulfilled?
|
19
|
-
|
20
|
-
@mutex.synchronize do
|
19
|
+
@mutex1.synchronize do
|
21
20
|
@errors = {}
|
22
21
|
publishers.each do |publisher|
|
23
22
|
publisher.satisfies_consumers?(verbose: @verbose)
|
@@ -59,16 +58,16 @@ module MinimumTerm
|
|
59
58
|
Dir.glob(File.join(@data_dir, "/**/*.schema.json"))
|
60
59
|
end
|
61
60
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
@mutex.synchronize do
|
61
|
+
def services
|
62
|
+
@mutex2.synchronize do
|
63
|
+
return @services if @services
|
66
64
|
@services = {}.with_indifferent_access
|
67
65
|
dirs = Dir.glob(File.join(@data_dir, "*/"))
|
68
66
|
dirs.each do |dir|
|
69
67
|
service = MinimumTerm::Service.new(self, dir)
|
70
68
|
@services[service.name] = service
|
71
69
|
end
|
70
|
+
@services
|
72
71
|
end
|
73
72
|
end
|
74
73
|
end
|
data/lib/minimum-term/service.rb
CHANGED
data/lib/minimum-term/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minimum-term
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jannis Hermanns
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|