gitlab_query_language 0.33.0 → 0.34.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/Cargo.lock +2 -1
- data/ext/gitlab_query_language/Cargo.toml +1 -1
- data/ext/gitlab_query_language/src/lib.rs +5 -0
- data/lib/gitlab_query_language/version.rb +1 -1
- data/lib/gitlab_query_language.rb +27 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d7cdd6bd11d7e366156839119ef7f7107b68be8165487b55576168593bd58b11
|
|
4
|
+
data.tar.gz: 6527786bb272eaf91e9b1a856a687d5b0e57cde94ec6fdffcbd4aa479aea3a92
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 955c3f8eb6b3c0576e3f9561d8bf8fa806cf099086a793f88809aa3885123800a0011ec4d1a35fca0f7c9c32ae52e41ca2040a3b0b94691cd5d697fff3b16c84
|
|
7
|
+
data.tar.gz: 305ab838f4b12001fefaa2e007432b108c73c1ce2f5cc5bc52cdc6aa2d71f2342c864a318a032be023fbe52ca096e27fa6a199cb9ce3a067f86556fe385391a6
|
data/Cargo.lock
CHANGED
|
@@ -233,7 +233,7 @@ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
|
|
|
233
233
|
|
|
234
234
|
[[package]]
|
|
235
235
|
name = "glql"
|
|
236
|
-
version = "0.
|
|
236
|
+
version = "0.34.0"
|
|
237
237
|
dependencies = [
|
|
238
238
|
"chrono",
|
|
239
239
|
"graphql-parser",
|
|
@@ -579,6 +579,7 @@ version = "1.0.145"
|
|
|
579
579
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
580
580
|
checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
|
|
581
581
|
dependencies = [
|
|
582
|
+
"indexmap",
|
|
582
583
|
"itoa",
|
|
583
584
|
"memchr",
|
|
584
585
|
"ryu",
|
|
@@ -8,12 +8,17 @@ fn transform_rs(data: String, string_context: String) -> Result<String, Error> {
|
|
|
8
8
|
Ok(glql::transform(data.as_str(), string_context.as_str()))
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
fn schema_rs() -> Result<String, Error> {
|
|
12
|
+
Ok(glql::glql_schema())
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
#[magnus::init]
|
|
12
16
|
fn init(ruby: &Ruby) -> Result<(), Error> {
|
|
13
17
|
let module = ruby.define_module("Glql")?;
|
|
14
18
|
|
|
15
19
|
module.define_singleton_method("compile_rs", function!(compile_rs, 2))?;
|
|
16
20
|
module.define_singleton_method("transform_rs", function!(transform_rs, 2))?;
|
|
21
|
+
module.define_singleton_method("schema_rs", function!(schema_rs, 0))?;
|
|
17
22
|
|
|
18
23
|
Ok(())
|
|
19
24
|
}
|
|
@@ -24,5 +24,32 @@ module Glql
|
|
|
24
24
|
result_json = transform_rs(data.to_json, context.to_json)
|
|
25
25
|
JSON.parse(result_json)
|
|
26
26
|
end
|
|
27
|
+
|
|
28
|
+
# The GLQL schema: every data source with its filter, display and sort
|
|
29
|
+
# fields, plus the operator, value kind, reference type and function
|
|
30
|
+
# vocabularies.
|
|
31
|
+
#
|
|
32
|
+
# `version` is this gem's version rather than a field of the document, so it
|
|
33
|
+
# cannot disagree with the artifact it shipped in. Merged last so a `version`
|
|
34
|
+
# in the document could not override it.
|
|
35
|
+
def schema
|
|
36
|
+
@schema ||= freeze_recursively(JSON.parse(schema_rs).merge("version" => VERSION))
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
# Freezes in place, at every level.
|
|
42
|
+
#
|
|
43
|
+
# `Hash#freeze` is shallow, and the memo above is shared for the life of the
|
|
44
|
+
# process: without this a caller mutating `schema["sources"]` would corrupt
|
|
45
|
+
# the document for every later reader.
|
|
46
|
+
def freeze_recursively(value)
|
|
47
|
+
case value
|
|
48
|
+
when Hash then value.each_value { |item| freeze_recursively(item) }
|
|
49
|
+
when Array then value.each { |item| freeze_recursively(item) }
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
value.freeze
|
|
53
|
+
end
|
|
27
54
|
end
|
|
28
55
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitlab_query_language
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.34.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Himanshu Kapoor
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-07
|
|
12
|
+
date: 2026-08-07 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rb_sys
|