lacerda 1.0.1 → 1.1.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 +3 -0
- data/lacerda.gemspec +1 -1
- data/lib/lacerda/conversion.rb +7 -5
- data/lib/lacerda/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c72c775cac5fa6c427773de8b002da68b01cead
|
4
|
+
data.tar.gz: 1b6adc7418567927bddd5ac87a7af26e859bd335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0d3f4a41eb11d90c348d73f5295830461ee32c31f30cf14e84831acc453f99b0112081707abb4305c7aeda9a766947065e67eab60eeb2404185d116df3a39e6
|
7
|
+
data.tar.gz: aeace94ffb4d71e354124fd1d0a58b9563e8c55b8ad2baccf6a11559fa924980b9597c24930a335de42f6920c106c8adf189c5fc7f80d4c101b44ae7ecabc5a1
|
data/CHANGELOG.markdown
CHANGED
data/lacerda.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_runtime_dependency "json-schema", ["~> 2.6"]
|
26
26
|
|
27
27
|
spec.add_runtime_dependency "colorize"
|
28
|
-
spec.add_runtime_dependency "blumquist", ["~> 0.
|
28
|
+
spec.add_runtime_dependency "blumquist", ["~> 0.8"]
|
29
29
|
spec.add_runtime_dependency "lounge_lizard", [">= 0.1.3", "~> 0.1"]
|
30
30
|
|
31
31
|
spec.add_runtime_dependency "tins"
|
data/lib/lacerda/conversion.rb
CHANGED
@@ -35,20 +35,22 @@ module Lacerda
|
|
35
35
|
# Pluck out Data structures from it
|
36
36
|
data_structures = data_structures_from_blueprint_ast(ast_file)
|
37
37
|
|
38
|
+
basename = File.basename(filename)
|
39
|
+
file_type = basename[/(consume|publish)\.mson$/]
|
40
|
+
if file_type.blank?
|
41
|
+
raise Error, "Invalid filename #{basename}, can't tell if it's a publish or consume schema"
|
42
|
+
end
|
43
|
+
|
38
44
|
# Generate json schema from each contained data structure
|
39
45
|
schema = {
|
40
46
|
"$schema" => "http://json-schema.org/draft-04/schema#",
|
47
|
+
"id" => file_type.gsub('.mson', '.schema.json'),
|
41
48
|
"title" => service_scope,
|
42
49
|
"definitions" => {},
|
43
50
|
"type" => "object",
|
44
51
|
"properties" => {},
|
45
52
|
}
|
46
53
|
|
47
|
-
basename = File.basename(filename)
|
48
|
-
if !basename.end_with?("publish.mson") and !basename.end_with?("consume.mson")
|
49
|
-
raise Error, "Invalid filename #{basename}, can't tell if it's a publish or consume schema"
|
50
|
-
end
|
51
|
-
|
52
54
|
# The json schema we're constructing contains every known
|
53
55
|
# object type in the 'definitions'. So if we have definitions for
|
54
56
|
# the objects User, Post and Tag, the schema will look like this:
|
data/lib/lacerda/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lacerda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jannis Hermanns
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0.
|
75
|
+
version: '0.8'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0.
|
82
|
+
version: '0.8'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: lounge_lizard
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -287,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
287
|
version: '0'
|
288
288
|
requirements: []
|
289
289
|
rubyforge_project:
|
290
|
-
rubygems_version: 2.6.
|
290
|
+
rubygems_version: 2.6.12
|
291
291
|
signing_key:
|
292
292
|
specification_version: 4
|
293
293
|
summary: Markdown publish/consume contract parser and validator
|