Sha256: 8c93c9cee8fade7f202bc9cf1aeaea7aaab8352a2e34bd9468e0fff18eebe3df

Contents?: true

Size: 847 Bytes

Versions: 23

Compression:

Stored size: 847 Bytes

Contents

module Praxis

  # one instance is created per use.
  class Plugin

    attr_accessor :application
    attr_accessor :block
    attr_accessor :config
    attr_accessor :config_attribute

    def options
      @options ||= {}
    end

    def config_key
    end

    def prepare_config!(node)
    end

    def load_config!
      return unless options.has_key?(:config_file)
      return {} unless (application.root + options[:config_file]).exist?

      YAML.load_file(application.root + options[:config_file])
    end

    def setup!
    end

    def register_doc_browser_plugin(path)
      application.doc_browser_plugin_paths << File.expand_path(path)
    end

    def after(stage,&block)
      application.bootloader.after(stage,&block)
    end

    def before(stage,&block)
      application.bootloader.before(stage,&block)
    end

  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
praxis-2.0.pre.18 lib/praxis/plugin.rb
praxis-2.0.pre.17 lib/praxis/plugin.rb
praxis-2.0.pre.16 lib/praxis/plugin.rb
praxis-2.0.pre.15 lib/praxis/plugin.rb
praxis-2.0.pre.14 lib/praxis/plugin.rb
praxis-2.0.pre.13 lib/praxis/plugin.rb
praxis-2.0.pre.12 lib/praxis/plugin.rb
praxis-2.0.pre.11 lib/praxis/plugin.rb
praxis-2.0.pre.10 lib/praxis/plugin.rb
praxis-2.0.pre.9 lib/praxis/plugin.rb
praxis-2.0.pre.8 lib/praxis/plugin.rb
praxis-2.0.pre.7 lib/praxis/plugin.rb
praxis-2.0.pre.6 lib/praxis/plugin.rb
praxis-2.0.pre.5 lib/praxis/plugin.rb
praxis-2.0.pre.4 lib/praxis/plugin.rb
praxis-2.0.pre.3 lib/praxis/plugin.rb
praxis-2.0.pre.2 lib/praxis/plugin.rb
praxis-2.0.pre.1 lib/praxis/plugin.rb
praxis-0.22.pre.2 lib/praxis/plugin.rb
praxis-0.22.pre.1 lib/praxis/plugin.rb