graphql-docs 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphql-docs/renderer.rb +19 -14
- data/lib/graphql-docs/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5808f244334e388f5ad5af6c83939e8e0617305a
|
4
|
+
data.tar.gz: f8d09947936ef457e044ace119172a060ab65132
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d616288144247d6aa429030b3d705208b2e849eefba38a68eb7ee0aa0f31daa56ecc25b388734498e84f6a1515e1bb98a0524e2fb71cab3eaa96e0e574fa6e7d
|
7
|
+
data.tar.gz: 9ee27fe57dab6b9bab6f74d50095a0fefb0d4f3d084396f5998d2758c8f6cf70c0176a403507f29346bebf30df9da70d979f1e27e7d0101632d1e318d3302cb6
|
@@ -39,20 +39,8 @@ module GraphQLDocs
|
|
39
39
|
|
40
40
|
if has_yaml?(contents)
|
41
41
|
# Split data
|
42
|
-
|
43
|
-
|
44
|
-
raise RuntimeError.new(
|
45
|
-
"The file '#{content_filename}' appears to start with a metadata section (three or five dashes at the top) but it does not seem to be in the correct format.",
|
46
|
-
)
|
47
|
-
end
|
48
|
-
# Parse
|
49
|
-
begin
|
50
|
-
meta = YAML.load(pieces[2]) || {}
|
51
|
-
opts = opts.merge(meta)
|
52
|
-
rescue Exception => e # rubocop:disable Lint/RescueException
|
53
|
-
raise "Could not parse YAML for #{name}: #{e.message}"
|
54
|
-
end
|
55
|
-
contents = pieces[4]
|
42
|
+
meta, contents = split_into_metadata_and_contents(contents)
|
43
|
+
opts = opts.merge(meta)
|
56
44
|
end
|
57
45
|
|
58
46
|
contents = @pipeline.to_html(contents)
|
@@ -69,6 +57,23 @@ module GraphQLDocs
|
|
69
57
|
contents.split(/^(-{5}|-{3})[ \t]*\r?\n?/, 3)
|
70
58
|
end
|
71
59
|
|
60
|
+
def split_into_metadata_and_contents(contents)
|
61
|
+
opts = {}
|
62
|
+
pieces = yaml_split(contents)
|
63
|
+
if pieces.size < 4
|
64
|
+
raise RuntimeError.new(
|
65
|
+
"The file '#{content_filename}' appears to start with a metadata section (three or five dashes at the top) but it does not seem to be in the correct format.",
|
66
|
+
)
|
67
|
+
end
|
68
|
+
# Parse
|
69
|
+
begin
|
70
|
+
meta = YAML.load(pieces[2]) || {}
|
71
|
+
rescue Exception => e # rubocop:disable Lint/RescueException
|
72
|
+
raise "Could not parse YAML for #{name}: #{e.message}"
|
73
|
+
end
|
74
|
+
[meta, pieces[4]]
|
75
|
+
end
|
76
|
+
|
72
77
|
private
|
73
78
|
|
74
79
|
def filter_key(s)
|
data/lib/graphql-docs/version.rb
CHANGED