Sha256: 4f5b8f15bf5d37d7b2a13679cd657a22f636a58dfc6ee39546ada7958d94e0cc

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

Pakyow::Config.register(:presenter) { |config|

  # registered view stores
  config.opt :view_stores, lambda {
    @stores ||= {
      default: File.join(Pakyow::Config.app.root, 'app', 'views')
    }
  }

  # the default view for each view store
  config.opt :default_views, { default: :default }

  # a convenience option to lookup the default_view for a view store by name
  config.opt :default_view, lambda { |store_name|
    views = Pakyow::Config.presenter.default_views
    views.fetch(store_name) { views[:default] }
  }

  # the default template dir for each view store
  config.opt :template_dirs, { default: '_templates' }

  # a convenience option to lookup the template_dir for a view store by name
  config.opt :template_dir, lambda { |store_name|
    dirs = Pakyow::Config.presenter.template_dirs
    dirs.fetch(store_name) { dirs[:default] }
  }

  # the attribute expected for scope definitions
  config.opt :scope_attribute, 'data-scope'

  # the attribute expected for prop definitions
  config.opt :prop_attribute, 'data-prop'

  # the document class used to parse and render views
  config.opt :view_doc_class, Pakyow::Presenter::StringDoc
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pakyow-presenter-0.10.2 pakyow-presenter/lib/presenter/config/presenter.rb
pakyow-presenter-0.10.1 pakyow-presenter/lib/presenter/config/presenter.rb
pakyow-presenter-0.10.0 pakyow-presenter/lib/presenter/config/presenter.rb