graphql-libgraphqlparser 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70cb618e8f60a0f386733ff8df7f21b7c53bcc46
4
- data.tar.gz: 49779e4778bccbb9b251f4f8a8ddb72921881627
3
+ metadata.gz: fac8a6ed259e6b0267805c9e9a0126d442b67ac8
4
+ data.tar.gz: 638b73f16772147c6cd09b84d3cce80a14e75606
5
5
  SHA512:
6
- metadata.gz: 6b3d6bdbdb1d4ccffbe9d84df0a09e59c64b07ca97686246a0ecd890c78dce1baead1177844d889fa958be642e38f421238bceab8ab1aa0a03f0dd71ad56ffa9
7
- data.tar.gz: de253ca616d9026135ecb0988176648f89391a2eb7cb479b3a9a7674b60283a21786ccd83c3e7225eaede2237e3d4356f44c4c3d3d69026da2bfd0d8a3ee629e
6
+ metadata.gz: f6992624a49c006f63cc7192377aebb6e8081a30550414f03f6fc9e6596787068abfb29612fffe83a20ade47eb711259c01c7e3697322c7fe69c8eb73f6d6ab9
7
+ data.tar.gz: 58206f1dfe44bfa3ac6fb6e33e84fd462d1de7b6ed202ba642d3cc2c7d41f57ddf158616cd6188c0b9054e520b0b01c75228ababa52fba9e6e76570b53c51ba5
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ # 0.5.1
4
+
5
+ - Fix strings with a null byte but no newline character #16
6
+
3
7
  # 0.5.0
4
8
 
5
9
  - Support `libgraphqlparser` 0.5.0 (but not 0.4.0)
@@ -14,7 +14,7 @@ module GraphQL
14
14
  if index = string.index("\x00")
15
15
  string_before_null = string.slice(0, index)
16
16
  line = string_before_null.count("\n") + 1
17
- col = index - string_before_null.rindex("\n") || 0
17
+ col = index - (string_before_null.rindex("\n") || 0)
18
18
  raise GraphQL::ParseError.new("Invalid null byte in query", line, col, string)
19
19
  end
20
20
  raise
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Libgraphqlparser
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  end
@@ -244,9 +244,18 @@ describe GraphQL::Libgraphqlparser do
244
244
  err = assert_raises(GraphQL::ParseError) do
245
245
  GraphQL::Libgraphqlparser.parse("mutation{\nsend(message: \"null\x00byte\")\n}")
246
246
  end
247
- assert_equal err.message, "Invalid null byte in query"
248
- assert_equal err.line, 2
249
- assert_equal err.col, 20
247
+ assert_equal "Invalid null byte in query", err.message
248
+ assert_equal 2, err.line
249
+ assert_equal 20, err.col
250
+ end
251
+
252
+ it "raises a parse error in query with null byte and no new line" do
253
+ err = assert_raises(GraphQL::ParseError) do
254
+ GraphQL::Libgraphqlparser.parse("mutation{send(message: \"null\x00byte\")}")
255
+ end
256
+ assert_equal "Invalid null byte in query", err.message
257
+ assert_equal 1, err.line
258
+ assert_equal 28, err.col
250
259
  end
251
260
  end
252
261
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-libgraphqlparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-06 00:00:00.000000000 Z
11
+ date: 2016-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql