Sha256: 930a5331599b419d41e2510a65d0af7c592b352e9b3f745d0d4de9daa8426e80

Contents?: true

Size: 1.45 KB

Versions: 31

Compression:

Stored size: 1.45 KB

Contents

module HybridPlatformsConductor

  # Base class for all plugins
  class Plugin

    include LoggerHelpers

    class << self

      include LoggerHelpers

      # Class loggers
      attr_accessor :logger, :logger_stderr

      # Are dependencies met before using this plugin?
      # This method can be overriden by any plugin
      #
      # Result::
      # * Boolean: Are dependencies met before using this plugin?
      def valid?
        true
      end

      # Extend the config DSL used when parsing the hpc_config.rb file with a given Mixin.
      # This can be used by any plugin to add plugin-specific configuration in the hpc_config.rb file.
      #
      # Parameters::
      # * *mixin* (Module): Mixin to add to the Platforms DSL
      # * *init_method* (Symbol or nil): The initializer method of this Mixin, or nil if none [default = nil]
      def extend_config_dsl_with(mixin, init_method = nil)
        Config.extend_config_dsl_with(mixin, init_method)
      end

    end

    # Constructor
    #
    # Parameters::
    # * *logger* (Logger): Logger to be used [default: Logger.new(STDOUT)]
    # * *logger_stderr* (Logger): Logger to be used for stderr [default: Logger.new(STDERR)]
    # * *config* (Config): Config to be used. [default: Config.new]
    def initialize(
      logger: Logger.new($stdout),
      logger_stderr: Logger.new($stderr),
      config: Config.new
    )
      init_loggers(logger, logger_stderr)
      @config = config
    end

  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.9.5 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.9.4 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.9.2 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.9.1 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.9.0 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.8.4 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.8.3 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.8.2 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.8.1 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.8.0 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.7.4 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.7.3 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.7.2 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.7.1 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.7.0 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.6.0 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.5.1 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.5.0 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.4.0 lib/hybrid_platforms_conductor/plugin.rb
hybrid_platforms_conductor-33.3.0 lib/hybrid_platforms_conductor/plugin.rb