Sha256: 12e04b9751ff85f422356704fac6a3bb459416373b6ce5bf1442c50da38f1e4b

Contents?: true

Size: 966 Bytes

Versions: 33

Compression:

Stored size: 966 Bytes

Contents

module PowerStencil
  module Plugins

    module Config

      attr_reader :plugin_specific_config

      def has_plugin_specific_config?
        yaml_file = project.plugin_config_specific_file(name)
        if File.exists? yaml_file and File.file? yaml_file and File.readable? yaml_file
          logger.info "Found plugin specific config to global config from '#{name}' plugin..."
          return true
        end
        logger.debug "There is no extra command line definition provided by plugin '#{name}'."
        false
      end

      def load_plugin_specific_config
        yaml_file = project.plugin_config_specific_file(name)
        if has_plugin_specific_config?
          project.add_plugin_config(name)
          capabilities[:local_config] = true
        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

33 entries across 33 versions & 1 rubygems

Version Path
power_stencil-0.4.22 lib/power_stencil/plugins/config.rb
power_stencil-0.4.21 lib/power_stencil/plugins/config.rb
power_stencil-0.4.20 lib/power_stencil/plugins/config.rb
power_stencil-0.4.19 lib/power_stencil/plugins/config.rb
power_stencil-0.4.18 lib/power_stencil/plugins/config.rb
power_stencil-0.4.17 lib/power_stencil/plugins/config.rb
power_stencil-0.4.16 lib/power_stencil/plugins/config.rb
power_stencil-0.4.15 lib/power_stencil/plugins/config.rb
power_stencil-0.4.14 lib/power_stencil/plugins/config.rb
power_stencil-0.4.13 lib/power_stencil/plugins/config.rb
power_stencil-0.4.12 lib/power_stencil/plugins/config.rb
power_stencil-0.4.11 lib/power_stencil/plugins/config.rb
power_stencil-0.4.10 lib/power_stencil/plugins/config.rb
power_stencil-0.4.9 lib/power_stencil/plugins/config.rb
power_stencil-0.4.8 lib/power_stencil/plugins/config.rb
power_stencil-0.4.7 lib/power_stencil/plugins/config.rb
power_stencil-0.4.6 lib/power_stencil/plugins/config.rb
power_stencil-0.4.5 lib/power_stencil/plugins/config.rb
power_stencil-0.4.4 lib/power_stencil/plugins/config.rb
power_stencil-0.4.3 lib/power_stencil/plugins/config.rb