graphql-docs 1.3.4 → 1.3.5
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.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/lib/graphql-docs/generator.rb +23 -17
- data/lib/graphql-docs/helpers.rb +1 -1
- data/lib/graphql-docs/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: bd333b3b4214ce691d4f8f64645c706280a068ff
|
4
|
+
data.tar.gz: 1dc7d2814ce8ecd1d5751a8acda770ecfc8cddf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6704934871fee571da7c31c4f00e18f8ff06d27ba3ef8e079825e3939eff1176df70c63f0d1287de89ebfd2b28401305b3efe8c6e4eb45ffaacc74b00571b030
|
7
|
+
data.tar.gz: b710e45e461dc202921b7ee78ccbdaf2022f282bb92d26fc144edf666a6c41c11d15518051671addaadf2de98cb40c3f89d2018c23617ae71bba25a972afebe2
|
data/.travis.yml
CHANGED
@@ -13,14 +13,14 @@ module GraphQLDocs
|
|
13
13
|
|
14
14
|
@renderer = @options[:renderer].new(@parsed_schema, @options)
|
15
15
|
|
16
|
-
@graphql_operation_template = ERB.new(File.read(@options[:templates][:operations])
|
17
|
-
@graphql_object_template = ERB.new(File.read(@options[:templates][:objects])
|
18
|
-
@graphql_mutations_template = ERB.new(File.read(@options[:templates][:mutations])
|
19
|
-
@graphql_interfaces_template = ERB.new(File.read(@options[:templates][:interfaces])
|
20
|
-
@graphql_enums_template = ERB.new(File.read(@options[:templates][:enums])
|
21
|
-
@graphql_unions_template = ERB.new(File.read(@options[:templates][:unions])
|
22
|
-
@graphql_input_objects_template = ERB.new(File.read(@options[:templates][:input_objects])
|
23
|
-
@graphql_scalars_template = ERB.new(File.read(@options[:templates][:scalars])
|
16
|
+
@graphql_operation_template = ERB.new(File.read(@options[:templates][:operations]))
|
17
|
+
@graphql_object_template = ERB.new(File.read(@options[:templates][:objects]))
|
18
|
+
@graphql_mutations_template = ERB.new(File.read(@options[:templates][:mutations]))
|
19
|
+
@graphql_interfaces_template = ERB.new(File.read(@options[:templates][:interfaces]))
|
20
|
+
@graphql_enums_template = ERB.new(File.read(@options[:templates][:enums]))
|
21
|
+
@graphql_unions_template = ERB.new(File.read(@options[:templates][:unions]))
|
22
|
+
@graphql_input_objects_template = ERB.new(File.read(@options[:templates][:input_objects]))
|
23
|
+
@graphql_scalars_template = ERB.new(File.read(@options[:templates][:scalars]))
|
24
24
|
end
|
25
25
|
|
26
26
|
def generate
|
@@ -36,35 +36,35 @@ module GraphQLDocs
|
|
36
36
|
create_graphql_scalar_pages
|
37
37
|
|
38
38
|
unless @options[:landing_pages][:index].nil?
|
39
|
-
write_file('static', 'index', File.read(@options[:landing_pages][:index]))
|
39
|
+
write_file('static', 'index', File.read(@options[:landing_pages][:index]), trim: false)
|
40
40
|
end
|
41
41
|
|
42
42
|
unless @options[:landing_pages][:object].nil?
|
43
|
-
write_file('static', 'object', File.read(@options[:landing_pages][:object]))
|
43
|
+
write_file('static', 'object', File.read(@options[:landing_pages][:object]), trim: false)
|
44
44
|
end
|
45
45
|
|
46
46
|
unless @options[:landing_pages][:mutation].nil?
|
47
|
-
write_file('operation', 'mutation', File.read(@options[:landing_pages][:mutation]))
|
47
|
+
write_file('operation', 'mutation', File.read(@options[:landing_pages][:mutation]), trim: false)
|
48
48
|
end
|
49
49
|
|
50
50
|
unless @options[:landing_pages][:interface].nil?
|
51
|
-
write_file('static', 'interface', File.read(@options[:landing_pages][:interface]))
|
51
|
+
write_file('static', 'interface', File.read(@options[:landing_pages][:interface]), trim: false)
|
52
52
|
end
|
53
53
|
|
54
54
|
unless @options[:landing_pages][:enum].nil?
|
55
|
-
write_file('static', 'enum', File.read(@options[:landing_pages][:enum]))
|
55
|
+
write_file('static', 'enum', File.read(@options[:landing_pages][:enum]), trim: false)
|
56
56
|
end
|
57
57
|
|
58
58
|
unless @options[:landing_pages][:union].nil?
|
59
|
-
write_file('static', 'union', File.read(@options[:landing_pages][:union]))
|
59
|
+
write_file('static', 'union', File.read(@options[:landing_pages][:union]), trim: false)
|
60
60
|
end
|
61
61
|
|
62
62
|
unless @options[:landing_pages][:input_object].nil?
|
63
|
-
write_file('static', 'input_object', File.read(@options[:landing_pages][:input_object]))
|
63
|
+
write_file('static', 'input_object', File.read(@options[:landing_pages][:input_object]), trim: false)
|
64
64
|
end
|
65
65
|
|
66
66
|
unless @options[:landing_pages][:scalar].nil?
|
67
|
-
write_file('static', 'scalar', File.read(@options[:landing_pages][:scalar]))
|
67
|
+
write_file('static', 'scalar', File.read(@options[:landing_pages][:scalar]), trim: false)
|
68
68
|
end
|
69
69
|
|
70
70
|
if @options[:use_default_styles]
|
@@ -172,7 +172,7 @@ module GraphQLDocs
|
|
172
172
|
@options.merge(opts).merge(helper_methods)
|
173
173
|
end
|
174
174
|
|
175
|
-
def write_file(type, name, contents)
|
175
|
+
def write_file(type, name, contents, trim: true)
|
176
176
|
if type == 'static'
|
177
177
|
if name == 'index'
|
178
178
|
path = @options[:output_dir]
|
@@ -191,6 +191,12 @@ module GraphQLDocs
|
|
191
191
|
@options = @options.merge(meta)
|
192
192
|
end
|
193
193
|
|
194
|
+
if trim
|
195
|
+
# normalize spacing so that CommonMarker doesn't treat it as `pre`
|
196
|
+
contents.gsub!(/^\s+$/, '')
|
197
|
+
contents.gsub!(/^\s{4}/m, ' ')
|
198
|
+
end
|
199
|
+
|
194
200
|
contents = @renderer.render(contents, type: type, name: name)
|
195
201
|
File.write(File.join(path, 'index.html'), contents) unless contents.nil?
|
196
202
|
end
|
data/lib/graphql-docs/helpers.rb
CHANGED
data/lib/graphql-docs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-docs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|