Skip to content

Commit 7cf4aa8

Browse files
committed
Support ruby 2.2
1 parent 08e41a3 commit 7cf4aa8

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require:
33

44
AllCops:
55
DisabledByDefault: true
6-
TargetRubyVersion: 2.3
6+
TargetRubyVersion: 2.2
77
Exclude:
88
- 'lib/graphql/language/lexer.rb'
99
- 'lib/graphql/language/parser.rb'

guides/_plugins/api_doc.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def api_doc(input)
2222

2323
def link_to_img(img_path, img_title)
2424
full_img_path = "#{@context.registers[:site].baseurl}#{img_path}"
25-
<<~HTML
25+
<<-HTML
2626
<a href="#{full_img_path}" target="_blank" class="img-link">
2727
<img src="#{full_img_path}" title="#{img_title}" alt="#{img_title}" />
2828
</a>
@@ -74,7 +74,7 @@ def initialize(tag_name, guide_info, tokens)
7474
end
7575

7676
def render(context)
77-
<<~HTML.chomp
77+
<<-HTML.chomp
7878
<a href="#{context["site"]["baseurl"]}/#{@path}">#{@text}</a>
7979
HTML
8080
end

lib/graphql/static_validation/base_visitor.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,14 @@ def on_fragment_spread(node, parent)
146146
end
147147

148148
def on_input_object(node, parent)
149-
is_list = @argument_definitions.last&.type&.list? == true
150-
151-
@path.push(parent.children.index(node)) if is_list
152-
super
153-
@path.pop if is_list
149+
arg_defn = @argument_definitions.last
150+
if arg_defn && arg_defn.type.list?
151+
@path.push(parent.children.index(node))
152+
super
153+
@path.pop
154+
else
155+
super
156+
end
154157
end
155158

156159
# @return [GraphQL::BaseType] The current object type

spec/graphql/execution/lookahead_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def query(doc = document)
356356
end
357357

358358
it "avoids merging selections for same field name on distinct types" do
359-
query = GraphQL::Query.new(LookaheadTest::Schema, <<~GRAPHQL)
359+
query = GraphQL::Query.new(LookaheadTest::Schema, <<-GRAPHQL)
360360
query {
361361
node(id: "Cardinal") {
362362
... on BirdSpecies {

0 commit comments

Comments
 (0)