Sha256: 99829a67c400f33cfc5735dff1223050a568acb579f1281315ac0c5317d62849

Contents?: true

Size: 1.24 KB

Versions: 9

Compression:

Stored size: 1.24 KB

Contents

module PowerStencil
  module Plugins

    module CommandLine

      attr_reader :plugin_command_line_modifier


      def register_processors
        plugin_definition[:processors].each do |processors_name, processor|
          clm = PowerStencil.command_line_manager
          processor_class = Object.const_get processor
          clm.register_processor clm.command_by_alias(processors_name), processor_class.new
        end
      end

      private

      def load_yaml_command_definition
        yaml_file = plugin_command_line_definition_file
        if File.exists? yaml_file and File.file? yaml_file and File.readable? yaml_file
          logger.info "Adding extra command line definition for '#{name}' plugin..."
          @plugin_command_line_modifier = project.yaml_file_to_hash yaml_file
          command_line_manager.contribute_to_definition @plugin_command_line_modifier, layer_name: "Plugin: #{name}"
          capabilities[:command_line] = true
        else
          logger.debug "There is no extra command line definition provided by plugin '#{name}'."
        end
      rescue => e
        logger.debug PowerStencil::Error.report_error(e)
        logger.warn "Could not load yaml file '#{yaml_file}' because '#{e.message}'"
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
power_stencil-0.7.4 lib/power_stencil/plugins/command_line.rb
power_stencil-0.7.3 lib/power_stencil/plugins/command_line.rb
power_stencil-0.7.2 lib/power_stencil/plugins/command_line.rb
power_stencil-0.7.1 lib/power_stencil/plugins/command_line.rb
power_stencil-0.7.0 lib/power_stencil/plugins/command_line.rb
power_stencil-0.6.3 lib/power_stencil/plugins/command_line.rb
power_stencil-0.6.2 lib/power_stencil/plugins/command_line.rb
power_stencil-0.6.1 lib/power_stencil/plugins/command_line.rb
power_stencil-0.6.0 lib/power_stencil/plugins/command_line.rb