From 3ca1f8be165c3911669064bc3addd2a3a905b46d Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Fri, 4 Jan 2019 15:11:46 -0500 Subject: [PATCH 1/3] Travis supports 2.6.0 --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f6ddc44..18f1c9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ rvm: - 2.3.6 - 2.4.3 - 2.5.0 + - 2.6.0 git: depth: 10 @@ -24,6 +25,6 @@ addons: matrix: include: - script: bundle exec rake rubocop - rvm: 2.5.0 + rvm: 2.6.0 - script: bundle exec rake html_proofer - rvm: 2.5.0 + rvm: 2.6.0 From 870516fa7988fcab21bb15a7a7eb9b926bb5f771 Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Fri, 4 Jan 2019 15:12:22 -0500 Subject: [PATCH 2/3] Support quote style comments --- graphql-docs.gemspec | 2 +- test/graphql-docs/parser_test.rb | 54 +++++++++++++++++++++++++------- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/graphql-docs.gemspec b/graphql-docs.gemspec index 793e82a..528ec38 100644 --- a/graphql-docs.gemspec +++ b/graphql-docs.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_dependency 'graphql', '~> 1.6' + spec.add_dependency 'graphql', '~> 1.8' # rendering spec.add_dependency 'commonmarker', '~> 0.16' diff --git a/test/graphql-docs/parser_test.rb b/test/graphql-docs/parser_test.rb index a54faa1..9064cd0 100644 --- a/test/graphql-docs/parser_test.rb +++ b/test/graphql-docs/parser_test.rb @@ -5,8 +5,8 @@ class ParserTest < Minitest::Test def setup @ghapi = File.read(File.join(fixtures_dir, 'gh-schema.graphql')) @swapi = File.read(File.join(fixtures_dir, 'sw-schema.graphql')) - @parser = GraphQLDocs::Parser.new(@ghapi, {}) - @results = @parser.parse + @gh_parser = GraphQLDocs::Parser.new(@ghapi, {}) + @gh_results = @gh_parser.parse end def test_it_accepts_schema_class @@ -34,28 +34,28 @@ def test_it_accepts_schema_class end def test_types_are_sorted - names = @results[:object_types].map { |t| t[:name] } + names = @gh_results[:object_types].map { |t| t[:name] } assert_equal names.sort, names end def test_connections_are_plucked - issue = @results[:object_types].find { |t| t[:name] == 'Issue' } + issue = @gh_results[:object_types].find { |t| t[:name] == 'Issue' } refute issue[:connections].empty? end def test_knows_implementers_for_interfaces - comment = @results[:interface_types].find { |t| t[:name] == 'Comment' } + comment = @gh_results[:interface_types].find { |t| t[:name] == 'Comment' } refute comment[:implemented_by].empty? end def test_groups_items_by_type - assert @results[:input_object_types] - assert @results[:object_types] - assert @results[:scalar_types] - assert @results[:interface_types] - assert @results[:enum_types] - assert @results[:union_types] - assert @results[:mutation_types] + assert @gh_results[:input_object_types] + assert @gh_results[:object_types] + assert @gh_results[:scalar_types] + assert @gh_results[:interface_types] + assert @gh_results[:enum_types] + assert @gh_results[:union_types] + assert @gh_results[:mutation_types] end def test_mutationless_schemas_do_not_explode @@ -84,4 +84,34 @@ def test_scalar_inputs_for_mutations_are_supported assert results[:mutation_types] end + + def test_schemas_with_quote_style_comments_works + schema = <<-SCHEMA + type Query { + profile: User + } + + """ + A user + """ + type User { + """ + The id of the user + """ + id: String! + + """ + The email of user + """ + email: String + } + SCHEMA + + parser = GraphQLDocs::Parser.new(schema, {}) + + results = parser.parse + assert results[:object_types] + user = results[:object_types].first + assert_equal 'The id of the user', user[:fields].first[:description] + end end From 2376655457478862bf0621bd88a9867aba0936ac Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Fri, 4 Jan 2019 15:30:32 -0500 Subject: [PATCH 3/3] Fix Travis? --- .travis.yml | 19 ++++++------------- graphql-docs.gemspec | 1 - 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 18f1c9a..909ed38 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ +sudo: false language: ruby +cache: bundler + rvm: - 2.3.6 - 2.4.3 @@ -8,19 +11,9 @@ rvm: git: depth: 10 -env: - global: - - NOKOGIRI_USE_SYSTEM_LIBRARIES=true - -sudo: false -cache: bundler - -addons: - apt: - sources: - - kalakris-cmake - packages: - - cmake +before_install: + - gem update --system + - gem install bundler matrix: include: diff --git a/graphql-docs.gemspec b/graphql-docs.gemspec index 528ec38..6b754a6 100644 --- a/graphql-docs.gemspec +++ b/graphql-docs.gemspec @@ -32,7 +32,6 @@ Gem::Specification.new do |spec| spec.add_dependency 'sass', '~> 3.4' spec.add_development_dependency 'awesome_print' - spec.add_development_dependency 'bundler', '~> 1.14' spec.add_development_dependency 'html-proofer', '~> 3.4' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'minitest-focus', '~> 1.1'