graphql-docs 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75636574c56be07c5a32dc282ccc84f3279699c1
4
- data.tar.gz: b854dfae6ffb2e0a89bcb5fd05feb5d418a688fa
3
+ metadata.gz: d0fd963b6afd32780ffcd9f1a3dae77cd4d6697f
4
+ data.tar.gz: e41b12fda08e07d88e1eb24cdff91c0f70bca83c
5
5
  SHA512:
6
- metadata.gz: 57b81685fdc78ab8f79c15e4f4cfc56c19e15e981aafc1d3e0cc39e9570db3a0c508aa8699beee2c9aa4ef6fb54b17586c698b96e39f0282d5af582c7be42c7f
7
- data.tar.gz: f09869bad79289c9df840bc98b770570b3ca46185682a08fbcc04c2e6bcdd5c495cb18bbc098eb8f49e8632210541e590924d178da30fbdc460a44e65bd0c3dd
6
+ metadata.gz: 7e271aabf4871fc6f6d64f373c82fca51e24aba426f411aa702e91a434cf897ee3b82b049162365ac90fdd41681fc4892f7b3f4e98ee6a124798f96a700fe0c2
7
+ data.tar.gz: f85df4c97ce95419aff00d8d1653f83a334dcaac0fcc250254e7bf58d67a3f70de6a5d1df4dff767ec9e028f9f754bbb79ce6915a30c1f1b470b1957add3aea8
data/README.md CHANGED
@@ -124,6 +124,7 @@ The following options are available:
124
124
  | Option | Description | Default |
125
125
  | :----- | :---------- | :------ |
126
126
  | `access_token` | Uses this token while making requests through `GraphQLDocs::Client`. | `nil` |
127
+ | `headers` | Uses these headers while making requests through `GraphQLDocs::Client`. | `{}` |
127
128
  | `login` | Uses this login while making requests through `GraphQLDocs::Client`. | `nil` |
128
129
  | `password` | Uses this password while making requests through `GraphQLDocs::Client`. | `nil` |
129
130
  | `path` | `GraphQLDocs::Client` loads a JSON file found at this location, representing the response from an introspection query. | `nil` |
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  # rendering
27
27
  spec.add_dependency 'html-pipeline', '~> 2.2'
28
- spec.add_dependency 'github-markdown', '0.6.9'
28
+ spec.add_dependency 'commonmarker', '~> 0.16'
29
29
  spec.add_dependency 'extended-markdown-filter', '~> 0.4'
30
30
  spec.add_dependency 'gemoji', '2.1.0'
31
31
  spec.add_dependency 'sass', '~> 3.4'
@@ -20,7 +20,8 @@ module GraphQLDocs
20
20
  @access_token = options[:access_token]
21
21
 
22
22
  @url = options[:url]
23
- @faraday = Faraday.new(url: @url)
23
+ @headers = options[:headers]
24
+ @faraday = Faraday.new(url: @url, headers: @headers)
24
25
 
25
26
  if @login && @password
26
27
  @faraday.basic_auth(@login, @password)
@@ -3,6 +3,7 @@ module GraphQLDocs
3
3
  GRAPHQLDOCS_DEFAULTS = {
4
4
  # Client
5
5
  access_token: nil,
6
+ headers: {},
6
7
  login: nil,
7
8
  password: nil,
8
9
  path: nil,
@@ -17,7 +17,8 @@ module GraphQLDocs
17
17
  end
18
18
 
19
19
  def markdown(string)
20
- GitHub::Markdown.render(string || 'n/a')
20
+ return '' if string.nil?
21
+ CommonMarker.render_html(string, :DEFAULT)
21
22
  end
22
23
 
23
24
  # Do you think I am proud of this? I am not.
@@ -28,24 +28,16 @@
28
28
  <% graphql_object_types.().each do |type| %>
29
29
  <% @name = type["name"] %>
30
30
  <!-- skip connection stuff -->
31
- <% if @name.end_with?("Connection") || @name.end_with?("Edge") %>
32
- <% next %>
33
- <% end %>
31
+ <% next if @name.end_with?("Connection") || @name.end_with?("Edge") %>
34
32
 
35
33
  <!-- skip mutation stuff -->
36
- <% if @name == "Mutation" || @name.end_with?("Payload") %>
37
- <% next %>
38
- <% end %>
34
+ <% next if @name == "Mutation" || @name.end_with?("Payload") %>
39
35
 
40
36
  <!-- skip metadata stuff -->
41
- <% if @name.start_with?("__") %>
42
- <% next %>
43
- <% end %>
37
+ <% next if @name.start_with?("__") %>
44
38
 
45
39
  <!-- skip root query stuff -->
46
- <% if @name == "Query" %>
47
- <% next %>
48
- <% end %>
40
+ <% next if @name == "Query" %>
49
41
 
50
42
  <li>
51
43
  <a href="<%= base_url %>/object/<%= @name.downcase %>/" class="sidebar-link<% if title == @name %> current<% end %>">
@@ -62,9 +54,7 @@
62
54
  <% graphql_mutation_types.().each do |type| %>
63
55
  <% @name = type["name"] %>
64
56
  <!-- skip metadata stuff -->
65
- <% if @name.start_with?("__") %>
66
- <% next %>
67
- <% end %>
57
+ <% next if @name.start_with?("__") %>
68
58
  <li>
69
59
  <a href="<%= base_url %>/mutation/<%= @name.downcase %>/" class="sidebar-link<% if title == @name %> current<% end %>">
70
60
  <%= @name %>
@@ -94,9 +84,7 @@
94
84
  <% graphql_enum_types.().each do |type| %>
95
85
  <% @name = type["name"] %>
96
86
  <!-- skip metadata stuff -->
97
- <% if @name.start_with?("__") %>
98
- <% next %>
99
- <% end %>
87
+ <% next if @name.start_with?("__") %>
100
88
  <li>
101
89
  <a href="<%= base_url %>/enum/<%= @name.downcase %>/" class="sidebar-link<% if title == @name %> current<% end %>">
102
90
  <%= @name %>
@@ -1,3 +1,3 @@
1
1
  module GraphQLDocs
2
- VERSION = '0.5.3'
2
+ VERSION = '0.6.0'
3
3
  end
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: 0.5.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-22 00:00:00.000000000 Z
11
+ date: 2017-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.2'
55
55
  - !ruby/object:Gem::Dependency
56
- name: github-markdown
56
+ name: commonmarker
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.6.9
61
+ version: '0.16'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.6.9
68
+ version: '0.16'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: extended-markdown-filter
71
71
  requirement: !ruby/object:Gem::Requirement