Sha256: d135081288040e2e975b42c34504aa5445671105bf403806a79cf41cb65663c3

Contents?: true

Size: 1.07 KB

Versions: 24

Compression:

Stored size: 1.07 KB

Contents

module Dradis
  module Plugins
    module Base
      extend ActiveSupport::Concern

      included do
        # mattr_accessor :plugin_name

        @features = []
        @name = 'Use plugin_info(args) with :name to provide a name for this plugin.'
        Plugins::register(self)

        # Extend the engine with other functionality
        include Dradis::Plugins::Configurable
        include Dradis::Plugins::Templates
        include Dradis::Plugins::Thor
      end

      module ClassMethods
        def description(new_description)
          @description = new_description
        end

        def plugin_description
          @description ||= "This plugin doesn't provide a :description"
        end

        def plugin_name
          @plugin_name ||= self.name.split('::')[-2].underscore.to_sym
        end

        def provides(*list)
          @features = list
          if list.include?(:upload)
            include Dradis::Plugins::Upload::Base
          end
        end

        def provides?(feature)
          @features.include?(feature)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
dradis-plugins-4.5.0 lib/dradis/plugins/base.rb
dradis-plugins-4.4.0 lib/dradis/plugins/base.rb
dradis-plugins-4.3.0 lib/dradis/plugins/base.rb
dradis-plugins-4.2.0 lib/dradis/plugins/base.rb
dradis-plugins-4.1.0 lib/dradis/plugins/base.rb
dradis-plugins-4.0.0 lib/dradis/plugins/base.rb
dradis-plugins-3.22.0 lib/dradis/plugins/base.rb
dradis-plugins-3.21.0 lib/dradis/plugins/base.rb
dradis-plugins-3.20.0 lib/dradis/plugins/base.rb
dradis-plugins-3.19.0 lib/dradis/plugins/base.rb
dradis-plugins-3.18.0 lib/dradis/plugins/base.rb
dradis-plugins-3.17.0 lib/dradis/plugins/base.rb
dradis-plugins-3.16.0 lib/dradis/plugins/base.rb
dradis-plugins-3.15.0 lib/dradis/plugins/base.rb
dradis-plugins-3.14.0 lib/dradis/plugins/base.rb
dradis-plugins-3.13.0 lib/dradis/plugins/base.rb
dradis-plugins-3.12.0 lib/dradis/plugins/base.rb
dradis-plugins-3.11.0 lib/dradis/plugins/base.rb
dradis-plugins-3.10.0 lib/dradis/plugins/base.rb
dradis-plugins-3.9.0 lib/dradis/plugins/base.rb