optify-config 1.25.1 → 1.26.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/ext/optify_ruby/Cargo.toml +6 -3
- data/ext/optify_ruby/src/lib.rs +5 -0
- data/ext/optify_ruby/src/preferences.rs +1 -0
- data/rbi/optify.rbi +6 -3
- data/sig/optify.rbs +6 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz: '
|
|
3
|
+
metadata.gz: 5005df8b9d648cad1c7b32fbb4d726fc5888ccb5ea057d1cd68f2373729583fb
|
|
4
|
+
data.tar.gz: '067581c58690dae86e84d8e315613e7af63fe94253212fef2988496b41710e28'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 371033f6ed0e55de03be6af6d56477cb1dc1a0e0e706a312ceb1d0774848f6719256709b7c197b7027de56f10eaec643965c69dc81963e688253194661b7808f
|
|
7
|
+
data.tar.gz: 9d391104894f4760ea96e6362f3ab04abf981e6ea7f45bc66229bed29cbf1d3e910fb38b3639a974537e95e0de1d7e4ab3e6fdf13469502bba9a81d4589cd53a
|
data/ext/optify_ruby/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "optify_ruby"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.27.0"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
|
|
6
6
|
description = "optify bindings for Ruby"
|
|
@@ -20,8 +20,11 @@ exclude = [
|
|
|
20
20
|
crate-type = ["cdylib"]
|
|
21
21
|
|
|
22
22
|
[dependencies]
|
|
23
|
-
magnus = "0.
|
|
23
|
+
magnus = "0.9.0"
|
|
24
24
|
# Can't put a relative path here because then others can't install the source gem: https://github.com/juharris/optify/pull/176
|
|
25
|
-
optify = "1.
|
|
25
|
+
optify = "1.6.0"
|
|
26
26
|
rb-sys = { version = "0.9.124", default-features = false, features = ["ruby-static"] }
|
|
27
27
|
serde_json = "1.0.149"
|
|
28
|
+
|
|
29
|
+
[lints]
|
|
30
|
+
workspace = true
|
data/ext/optify_ruby/src/lib.rs
CHANGED
|
@@ -86,6 +86,7 @@ fn convert_metadata(metadata: &OptionsMetadata) -> String {
|
|
|
86
86
|
serde_json::to_string(metadata).unwrap()
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
#[allow(clippy::needless_pass_by_value)]
|
|
89
90
|
impl WrappedOptionsProvider {
|
|
90
91
|
fn build(ruby: &Ruby, directory: String) -> Result<WrappedOptionsProvider, magnus::Error> {
|
|
91
92
|
match OptionsProvider::build(&directory) {
|
|
@@ -344,6 +345,7 @@ impl WrappedOptionsProvider {
|
|
|
344
345
|
#[wrap(class = "Optify::OptionsProviderBuilder")]
|
|
345
346
|
struct WrappedOptionsProviderBuilder(RefCell<OptionsProviderBuilder>);
|
|
346
347
|
|
|
348
|
+
#[allow(clippy::needless_pass_by_value)]
|
|
347
349
|
impl WrappedOptionsProviderBuilder {
|
|
348
350
|
fn new() -> Self {
|
|
349
351
|
Self(RefCell::new(OptionsProviderBuilder::new()))
|
|
@@ -371,6 +373,7 @@ impl WrappedOptionsProviderBuilder {
|
|
|
371
373
|
#[wrap(class = "Optify::OptionsWatcher")]
|
|
372
374
|
struct WrappedOptionsWatcher(RefCell<OptionsWatcher>);
|
|
373
375
|
|
|
376
|
+
#[allow(clippy::needless_pass_by_value)]
|
|
374
377
|
impl WrappedOptionsWatcher {
|
|
375
378
|
fn build(ruby: &Ruby, directory: String) -> Result<WrappedOptionsWatcher, magnus::Error> {
|
|
376
379
|
match OptionsWatcher::build(&directory) {
|
|
@@ -629,6 +632,7 @@ impl WrappedOptionsWatcher {
|
|
|
629
632
|
#[wrap(class = "Optify::OptionsWatcherBuilder")]
|
|
630
633
|
struct WrappedOptionsWatcherBuilder(RefCell<OptionsWatcherBuilder>);
|
|
631
634
|
|
|
635
|
+
#[allow(clippy::needless_pass_by_value)]
|
|
632
636
|
impl WrappedOptionsWatcherBuilder {
|
|
633
637
|
fn new() -> Self {
|
|
634
638
|
Self(RefCell::new(OptionsWatcherBuilder::new()))
|
|
@@ -654,6 +658,7 @@ impl WrappedOptionsWatcherBuilder {
|
|
|
654
658
|
}
|
|
655
659
|
|
|
656
660
|
#[magnus::init]
|
|
661
|
+
#[allow(clippy::too_many_lines)]
|
|
657
662
|
fn init(ruby: &Ruby) -> Result<(), magnus::Error> {
|
|
658
663
|
let module = ruby.define_module("Optify")?;
|
|
659
664
|
|
data/rbi/optify.rbi
CHANGED
|
@@ -412,8 +412,11 @@ module Optify
|
|
|
412
412
|
end
|
|
413
413
|
def map_feature_names(feature_names, preferences); end
|
|
414
414
|
|
|
415
|
-
# @return The policies
|
|
416
|
-
#
|
|
415
|
+
# @return The effective policies for the feature, combining the feature's own policies with the requester policies from `.optify/policies.json`.
|
|
416
|
+
# Either `requester.allow` (only those requesters may use the feature)
|
|
417
|
+
# or `requester.block` (all requesters except those may use the feature) is set.
|
|
418
|
+
# Returns `nil` if nothing restricts the feature (every requester is permitted).
|
|
419
|
+
# Assumes a valid canonical feature name; it isn't checked.
|
|
417
420
|
sig { params(canonical_feature_name: String).returns(T.nilable(Optify::Policies)) }
|
|
418
421
|
def get_policies(canonical_feature_name); end
|
|
419
422
|
|
|
@@ -442,7 +445,7 @@ module Optify
|
|
|
442
445
|
sig { params(canonical_feature_name: String).returns(T.nilable(String)) }
|
|
443
446
|
def get_feature_metadata_json(canonical_feature_name); end
|
|
444
447
|
|
|
445
|
-
# @return The policies for the feature as JSON, or `nil` if the feature
|
|
448
|
+
# @return The effective policies for the feature as JSON, or `nil` if nothing restricts the feature.
|
|
446
449
|
sig { params(canonical_feature_name: String).returns(T.nilable(String)) }
|
|
447
450
|
def get_policies_json(canonical_feature_name); end
|
|
448
451
|
end
|
data/sig/optify.rbs
CHANGED
|
@@ -235,8 +235,11 @@ module Optify::ProviderModule
|
|
|
235
235
|
|
|
236
236
|
def map_feature_names: (::Array[String] feature_names, GetOptionsPreferences preferences) -> ::Array[String?]
|
|
237
237
|
|
|
238
|
-
# @return The policies
|
|
239
|
-
#
|
|
238
|
+
# @return The effective policies for the feature, combining the feature's own policies with the requester policies from `.optify/policies.json`.
|
|
239
|
+
# Either `requester.allow` (only those requesters may use the feature)
|
|
240
|
+
# or `requester.block` (all requesters except those may use the feature) is set.
|
|
241
|
+
# Returns `nil` if nothing restricts the feature (every requester is permitted).
|
|
242
|
+
# Assumes a valid canonical feature name; it isn't checked.
|
|
240
243
|
def get_policies: (String canonical_feature_name) -> Optify::Policies?
|
|
241
244
|
|
|
242
245
|
def _check_policies: (String requester, ::Array[String] feature_names) -> String?
|
|
@@ -252,7 +255,7 @@ module Optify::ProviderModule
|
|
|
252
255
|
# @return The metadata for the feature.
|
|
253
256
|
def get_feature_metadata_json: (String canonical_feature_name) -> String?
|
|
254
257
|
|
|
255
|
-
# @return The policies for the feature as JSON, or `nil` if the feature
|
|
258
|
+
# @return The effective policies for the feature as JSON, or `nil` if nothing restricts the feature.
|
|
256
259
|
def get_policies_json: (String canonical_feature_name) -> String?
|
|
257
260
|
end
|
|
258
261
|
|