Sha256: 4de5fad60ec3a5ba4721bf6de788d2071aced0a5bb19b31ba908d162603410c6

Contents?: true

Size: 762 Bytes

Versions: 35

Compression:

Stored size: 762 Bytes

Contents

module PowerStencil
  module Plugins

    module Dsl

      def dsl_modules_names
        return [] if plugin_definition[:dsl].nil?
        case plugin_definition[:dsl]
        when String
          [plugin_definition[:dsl]]
        when Array
          plugin_definition[:dsl]
        else
          raise PowerStencil::Error, "Invalid DSL definition for plugin '#{self.name}' !"
        end
      end

      def dsl_modules
        dsl_modules_names.map { |dsl_module_name| Object.const_get dsl_module_name }
      end

      def apply_extra_dsl(dsl_base)
        dsl_modules.each do |dsl_module|
          logger.debug "Applying extra DSL '#{dsl_module.name}' to base DSL..."
          dsl_base.extend dsl_module
        end

      end



    end

  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
power_stencil-0.10.0 lib/power_stencil/plugins/dsl.rb
power_stencil-0.9.8 lib/power_stencil/plugins/dsl.rb
power_stencil-0.9.7 lib/power_stencil/plugins/dsl.rb
power_stencil-0.9.6 lib/power_stencil/plugins/dsl.rb
power_stencil-0.9.5 lib/power_stencil/plugins/dsl.rb
power_stencil-0.9.4 lib/power_stencil/plugins/dsl.rb
power_stencil-0.9.3 lib/power_stencil/plugins/dsl.rb
power_stencil-0.9.2 lib/power_stencil/plugins/dsl.rb
power_stencil-0.9.1 lib/power_stencil/plugins/dsl.rb
power_stencil-0.9.0 lib/power_stencil/plugins/dsl.rb
power_stencil-0.8.14 lib/power_stencil/plugins/dsl.rb
power_stencil-0.8.13 lib/power_stencil/plugins/dsl.rb
power_stencil-0.8.12 lib/power_stencil/plugins/dsl.rb
power_stencil-0.8.11 lib/power_stencil/plugins/dsl.rb
power_stencil-0.8.10 lib/power_stencil/plugins/dsl.rb
power_stencil-0.8.9 lib/power_stencil/plugins/dsl.rb
power_stencil-0.8.8 lib/power_stencil/plugins/dsl.rb
power_stencil-0.8.7 lib/power_stencil/plugins/dsl.rb
power_stencil-0.8.6 lib/power_stencil/plugins/dsl.rb
power_stencil-0.8.5 lib/power_stencil/plugins/dsl.rb