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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c5bba8f17ee332d4cc2a411586af11a5ec1645f256730a989e45dbae1a56277
4
- data.tar.gz: '046398ac29bf2689bcfdd48bfc2bacdb674126ab05a2a7c59a5b032ebabce050'
3
+ metadata.gz: 5005df8b9d648cad1c7b32fbb4d726fc5888ccb5ea057d1cd68f2373729583fb
4
+ data.tar.gz: '067581c58690dae86e84d8e315613e7af63fe94253212fef2988496b41710e28'
5
5
  SHA512:
6
- metadata.gz: 366c3e615c701a2ce5190857afc4aebcf49f934205b540d3f05434658ea939b30745643e7472048a5c5716963c12116db3f7ad45e07c1ec31468dc68bf41af62
7
- data.tar.gz: d1c71b3c16a86e3d822ba477aa85fb22a6c87d59bb5c6c69114b6188e8ac399f93cdde50a19b75e6414553269821845f47f32d35b72e4c9c6094f832cfd92e2a
6
+ metadata.gz: 371033f6ed0e55de03be6af6d56477cb1dc1a0e0e706a312ceb1d0774848f6719256709b7c197b7027de56f10eaec643965c69dc81963e688253194661b7808f
7
+ data.tar.gz: 9d391104894f4760ea96e6362f3ab04abf981e6ea7f45bc66229bed29cbf1d3e910fb38b3639a974537e95e0de1d7e4ab3e6fdf13469502bba9a81d4589cd53a
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "optify_ruby"
3
- version = "0.26.1"
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.8.2"
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.5.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
@@ -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
 
@@ -31,6 +31,7 @@ impl MutGetOptionsPreferences {
31
31
  }
32
32
 
33
33
  // Constraints Section
34
+ #[allow(clippy::needless_pass_by_value)]
34
35
  pub fn set_constraints_json(&self, constraints_json: Option<String>) {
35
36
  self.0
36
37
  .borrow_mut()
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 directly declared for the feature, or `nil` if the feature has no policies.
416
- # This may not consider all policies defined per requester outside of the feature configuration.
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 has no policies.
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 directly declared for the feature, or `nil` if the feature has no policies.
239
- # This may not consider all policies defined per requester outside of the feature configuration.
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 has no policies.
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optify-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.25.1
4
+ version: 1.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin D. Harris