Class: Inspec::Plugin::V2::PluginFilter
- Inherits:
-
Object
- Object
- Inspec::Plugin::V2::PluginFilter
- Includes:
- Singleton
- Defined in:
- lib/inspec/plugin/v2/filter.rb
Class Method Summary collapse
Instance Method Summary collapse
- #exclude?(plugin_name) ⇒ Boolean
-
#initialize ⇒ PluginFilter
constructor
A new instance of PluginFilter.
Constructor Details
#initialize ⇒ PluginFilter
Returns a new instance of PluginFilter.
10 11 12 |
# File 'lib/inspec/plugin/v2/filter.rb', line 10 def initialize read_filter_data end |
Class Method Details
.exclude?(plugin_name) ⇒ Boolean
14 15 16 |
# File 'lib/inspec/plugin/v2/filter.rb', line 14 def self.exclude?(plugin_name) instance.exclude?(plugin_name) end |
Instance Method Details
#exclude?(plugin_name) ⇒ Boolean
18 19 20 21 22 23 24 25 |
# File 'lib/inspec/plugin/v2/filter.rb', line 18 def exclude?(plugin_name) # Currently, logic is very simple: is there an exact match? # In the future, we might add regexes on names, or exclude version ranges return false unless @filter_data[:exclude].detect { |e| e.plugin_name == plugin_name } # OK, return entire data structure. @filter_data[:exclude].detect { |e| e.plugin_name == plugin_name } end |