Sha256: 7d407b460af403ecd13d2adc8abda7705a7c411226b734ec131ecfe8f34fb3c1
Contents?: true
Size: 1.35 KB
Versions: 18
Compression:
Stored size: 1.35 KB
Contents
require 'active_support/core_ext/module/delegation' # Allows modules to be configured (using {Metasploit::Model::Configuration}) similar to Rails engines. # # @example Making gem module configurable # module MyGem # extend Metasploit::Model::Configured # # # assumes __FILE__ is lib/my_gem.rb # lib_my_gem_pathname = Pathname.new(___FILE__) # lib_pathname = lib_my_gem_pathname.parent # configuration.root = lib_pathname.parent # # configuration.autoload.paths << 'app/models' # end # # # registers 'app/models' as an autoload_path with ActiveSupport::Dependencies # MyGem.setup module Metasploit::Model::Configured # The {Metasploit::Model::Configuration} for this configured `Module`. # # @return [Metasploit::Model::Configuration] def configuration unless instance_variable_defined? :@configuration require 'metasploit/model/configuration' @configuration = Metasploit::Model::Configuration.new end @configuration end # @!method root # The configured root. # # @return (see Metasploit::Model::Configuration#root) # # @!method setup # Sets up the autoload and i18n paths for the configured gem. # # @return (see Metasploit::Model::Configuration.setup) # @raise (see Metasploit::Model::Configuration.setup) delegate :root, :setup, to: :configuration end
Version data entries
18 entries across 18 versions & 1 rubygems