graphql-libgraphqlparser 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +13 -0
- data/ext/graphql_libgraphqlparser_ext/extconf.rb +24 -5
- data/lib/graphql/libgraphqlparser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b559b71adbace5a35672516dcd373c4f5cac550a
|
4
|
+
data.tar.gz: d2dee73127250c5750fba19938990313cdacae53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bade27a2ee1e8fa0eaa0017191e788f09c869d2e9cf2509a33311baf109dae94185221f58d54a6ef8edc7c74ce90f99969473ae0ceffe34aba28d01882ca035
|
7
|
+
data.tar.gz: 3216cad0b99d1e070e214887c0bb756137d050a797b2074ae6e49fd352698cb900e2fb4375fb7fc5716e2dfb1812d1ece352db3246f6667111ebaa315e1dae53
|
data/CHANGELOG.md
CHANGED
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{ |
|
5
|
-
dir_config
|
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
|
-
|
10
|
+
# Failing that, fallback to defaults (/include and /lib)
|
11
|
+
dir_config('graphqlparser')
|
8
12
|
end
|
9
|
-
|
10
|
-
|
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"
|
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.
|
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-
|
11
|
+
date: 2018-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|