graphql-libgraphqlparser 1.2.0 → 1.3.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: 7c6c3d2f3e3f782d3c576ed544599fb743e8cf12
4
- data.tar.gz: dc13fc9f17377d35a9b9fdec26ab00064d4e47da
3
+ metadata.gz: b559b71adbace5a35672516dcd373c4f5cac550a
4
+ data.tar.gz: d2dee73127250c5750fba19938990313cdacae53
5
5
  SHA512:
6
- metadata.gz: c4bff9e47683edfad5bf7ea6005ccf4ce694c6bf53b36ef3ac821b398cf5714851967eb56b400d463329f70f6eda4bd81c8e94ba2572ccb8bf559377101700a3
7
- data.tar.gz: bda7eb33bb87c80152fc9f195359de73ec106866948264bbe960d183e1771200c0e6be6fea157be5dde5b85d21a0627ab8cf397b665d38f20f027dd74b0d2ee3
6
+ metadata.gz: 3bade27a2ee1e8fa0eaa0017191e788f09c869d2e9cf2509a33311baf109dae94185221f58d54a6ef8edc7c74ce90f99969473ae0ceffe34aba28d01882ca035
7
+ data.tar.gz: 3216cad0b99d1e070e214887c0bb756137d050a797b2074ae6e49fd352698cb900e2fb4375fb7fc5716e2dfb1812d1ece352db3246f6667111ebaa315e1dae53
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ # 1.3.0
4
+
5
+ - Support overriding libgraphqlparser install location (use `--with-graphqlparser-xxx` options to override) #29
6
+
3
7
  # 1.2.0
4
8
 
5
9
  - Support `tracer:` keyword to `.parse` (supports GraphQL::Tracing) #27
data/README.md CHANGED
@@ -48,6 +48,19 @@ When you `require` this gem, it overrides `GraphQL.parse`:
48
48
  require "graphql/libgraphqlparser"
49
49
  ```
50
50
 
51
+ ## Overriding the location of libgraphqlparser
52
+
53
+ This gem will search for [libgraphqlparser](https://github.com/graphql/libgraphqlparser) at `/usr` and `/usr/local`. If you follow the official install instructions, you don't need to do anything else. If however you have installed libgraphqlparser at a different location, you will need to specify it during gem install. Note that the headers needed to compile the extension are not located at the standard `include` subdirectory but rather `include/graphqlparser`.
54
+
55
+ Example override:
56
+
57
+ ```bash
58
+ export LIBGRAPHQLPARSER_PATH=/my-custom-path
59
+ gem install graphql-libgraphqlparser -- \
60
+ --with-graphqlparser-lib=$LIBGRAPHQLPARSER_PATH/lib \
61
+ --with-graphqlparser-include=$LIBGRAPHQLPARSER_PATH/include/graphqlparser
62
+ ```
63
+
51
64
  ## Libgraphqlparser versions
52
65
 
53
66
  The Ruby gem expects certain versions of `libgraphqlparser` to be installed. I couldn't figure out how to check this in [`extconf.rb`](#), so I documented it here:
@@ -1,12 +1,31 @@
1
1
  require 'mkmf'
2
2
 
3
3
  prefixes = %w(/usr /usr/local)
4
- if prefix = prefixes.find{ |prefix| Dir["#{prefix}/lib/libgraphqlparser*"].first }
5
- dir_config('graphql', "#{prefix}/include/graphqlparser", "#{prefix}/lib")
4
+ if prefix = prefixes.find{ |candidate| Dir["#{candidate}/lib/libgraphqlparser*"].first }
5
+ # This is unorthodox usage of dir_config. The problem is that libgraphqlparser installs its header
6
+ # files to a subdirectory of include/, so to find them we have to specify a custom "default" location
7
+ # which is relative to the guessed location of the install. In other words, not a "default" at all.
8
+ dir_config('graphqlparser', "#{prefix}/include/graphqlparser", "#{prefix}/lib")
6
9
  else
7
- dir_config('graphql')
10
+ # Failing that, fallback to defaults (/include and /lib)
11
+ dir_config('graphqlparser')
8
12
  end
9
- abort 'missing libgraphqlparser' unless have_library('graphqlparser')
10
- abort 'missing libgraphqlparser headers' unless have_header('c/GraphQLParser.h')
13
+
14
+ LIBRARY_MISSING_ERROR_MESSAGE = <<-EOT
15
+
16
+ 🚨 Could not find libgraphqlparser library. Have you installed it? 🚨
17
+ See: https://github.com/rmosolgo/graphql-libgraphqlparser-ruby#installation
18
+
19
+ EOT
20
+
21
+ HEADER_MISSING_ERROR_MESSAGE = <<-EOT
22
+
23
+ 🚨 Could not find libgraphqlparser headers. Is your library installed in a custom location? 🚨
24
+ See: https://github.com/rmosolgo/graphql-libgraphqlparser-ruby#overriding-the-location-of-libgraphqlparser
25
+
26
+ EOT
27
+
28
+ abort LIBRARY_MISSING_ERROR_MESSAGE unless have_library('graphqlparser')
29
+ abort HEADER_MISSING_ERROR_MESSAGE unless have_header('c/GraphQLParser.h')
11
30
 
12
31
  create_makefile "graphql_libgraphqlparser_ext"
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Libgraphqlparser
3
- VERSION = "1.2.0"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  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: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-15 00:00:00.000000000 Z
11
+ date: 2018-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql