From a768d11ed94f836c9084dd3c805e1b658d3fefb3 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Thu, 29 Feb 2024 22:40:38 -0300 Subject: [PATCH] Accept a Symbol in `BSD::Control.feature!` --- README.md | 2 +- lib/bsd/control.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4821599..6c9bbb0 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The example enables the mprotect feature for the emacs binary: # As a root account require 'hbsdctl' BSD::Control - .feature!("mprotect") + .feature!(:mprotect) .enable!("/usr/local/bin/emacs") ``` diff --git a/lib/bsd/control.rb b/lib/bsd/control.rb index 1566d83..81ea9f0 100644 --- a/lib/bsd/control.rb +++ b/lib/bsd/control.rb @@ -23,7 +23,7 @@ module BSD::Control # @return [BSD::Control::Feature] # Returns an instance of BSD::Control::Feature. def self.feature!(name) - feature = Feature.available.find { _1.name == name } + feature = Feature.available.find { _1.name == name.to_s } feature ? feature : raise(Error, "feature '#{name}' wasn't found") end