Module: Dradis::Plugins
- Defined in:
- lib/dradis/plugins.rb,
lib/dradis/plugins/base.rb,
lib/dradis/plugins/thor.rb,
lib/dradis/plugins/engine.rb,
lib/dradis/plugins/upload.rb,
lib/dradis/plugins/version.rb,
lib/dradis/plugins/mappings.rb,
lib/dradis/plugins/settings.rb,
lib/dradis/plugins/export/base.rb,
lib/dradis/plugins/gem_version.rb,
lib/dradis/plugins/thor_helper.rb,
lib/dradis/plugins/configurable.rb,
lib/dradis/plugins/import/filters.rb,
lib/dradis/plugins/mapping_service.rb,
lib/dradis/plugins/upload/importer.rb,
lib/dradis/plugins/templates/samples.rb,
lib/dradis/plugins/import/filters/base.rb,
lib/dradis/plugins/upload/field_processor.rb,
lib/dradis/plugins/templates/migrate_templates.rb,
app/controllers/dradis/plugins/export/base_controller.rb,
app/controllers/concerns/dradis/plugins/persistent_permissions.rb
Defined Under Namespace
Modules: Base, Configurable, ContentService, Export, Import, Mappings, PersistentPermissions, Templates, Thor, ThorHelper, Upload, VERSION Classes: Engine, MappingService, Settings
Constant Summary collapse
- @@extensions =
[]
Class Method Summary collapse
- .clear_enabled_list ⇒ Object
-
.enabled_list ⇒ Object
Returns an array of modules representing currently enabled engines.
-
.gem_version ⇒ Object
Returns the version of the currently loaded Frontend as a
Gem::Version
. -
.list ⇒ Object
Returns an array of modules representing currently registered Dradis Plugins / engines.
-
.register(const) ⇒ Object
Register a plugin with the framework.
-
.registered?(const) ⇒ Boolean
Returns true if a plugin is currently registered with the framework.
-
.unregister(const) ⇒ Object
Unregister a plugin from the framework.
- .upload_integration_names_and_modules ⇒ Object
-
.version ⇒ Object
Returns the version of the currently loaded Action Mailer as a
Gem::Version
. -
.with_feature(feature) ⇒ Object
Filters the list of plugins and only returns those that provide the requested feature and enabled.
Class Method Details
.clear_enabled_list ⇒ Object
19 20 21 |
# File 'lib/dradis/plugins.rb', line 19 def clear_enabled_list @@enabled_list = nil end |
.enabled_list ⇒ Object
Returns an array of modules representing currently enabled engines
15 16 17 |
# File 'lib/dradis/plugins.rb', line 15 def enabled_list @@enabled_list ||= @@extensions.select(&:enabled?) end |
.gem_version ⇒ Object
Returns the version of the currently loaded Frontend as a Gem::Version
4 5 6 |
# File 'lib/dradis/plugins/gem_version.rb', line 4 def self.gem_version Gem::Version.new VERSION::STRING end |
.list ⇒ Object
10 11 12 |
# File 'lib/dradis/plugins.rb', line 10 def list @@extensions end |
.register(const) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/dradis/plugins.rb', line 36 def register(const) return if registered?(const) validate_plugin!(const) @@extensions << const end |
.registered?(const) ⇒ Boolean
56 57 58 |
# File 'lib/dradis/plugins.rb', line 56 def registered?(const) @@extensions.include?(const) end |
.unregister(const) ⇒ Object
48 49 50 |
# File 'lib/dradis/plugins.rb', line 48 def unregister(const) @@extensions.delete(const) end |
.upload_integration_names_and_modules ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/dradis/plugins.rb', line 60 def upload_integration_names_and_modules with_feature(:upload).each_with_object({}) do |integration, integrations_hash| integration_name = integration.plugin_name.to_s integration_module = integration.module_parent integrations_hash[integration_name] = integration_module end end |
.version ⇒ Object
Returns the version of the currently loaded Action Mailer as a Gem::Version
.
7 8 9 |
# File 'lib/dradis/plugins/version.rb', line 7 def self.version gem_version end |
.with_feature(feature) ⇒ Object
Filters the list of plugins and only returns those that provide the requested feature and enabled
25 26 27 28 29 30 |
# File 'lib/dradis/plugins.rb', line 25 def with_feature(feature) enabled_list.select do |plugin| # engine = "#{plugin}::Engine".constantize plugin.provides?(feature) end end |