Accept a Symbol in BSD::Control.feature!

This commit is contained in:
0x1eef 2024-02-29 22:40:38 -03:00
parent 9a25d72d34
commit a768d11ed9
2 changed files with 2 additions and 2 deletions

View file

@ -33,7 +33,7 @@ The example enables the mprotect feature for the emacs binary:
# As a root account # As a root account
require 'hbsdctl' require 'hbsdctl'
BSD::Control BSD::Control
.feature!("mprotect") .feature!(:mprotect)
.enable!("/usr/local/bin/emacs") .enable!("/usr/local/bin/emacs")
``` ```

View file

@ -23,7 +23,7 @@ module BSD::Control
# @return [BSD::Control::Feature] # @return [BSD::Control::Feature]
# Returns an instance of BSD::Control::Feature. # Returns an instance of BSD::Control::Feature.
def self.feature!(name) 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") feature ? feature : raise(Error, "feature '#{name}' wasn't found")
end end