Module: Middleman::Ontologist
- Defined in:
- lib/ontologist/version.rb,
lib/ontologist/ontology.rb,
lib/ontologist/extension.rb,
lib/ontologist/semantic_resource.rb
Defined Under Namespace
Modules: Helpers, SemanticResource, Utilities Classes: Ontology, Options
Constant Summary collapse
- VERSION =
"0.0.1"
Class Method Summary collapse
Class Method Details
.registered(app, options_hash = {}) {|options| ... } ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/ontologist/extension.rb', line 34 def registered(app, = {}, &block) require 'ontologist/ontology' require 'ontologist/semantic_resource' require 'active_support/core_ext/time/zones' app.set :time_zone, 'UTC' app.send :include, Helpers = Options.new() yield if block_given? .uri_tag ||= "uri" .date_tag ||= "date" .title_tag ||= "title" .ignore_list ||= [] .aliases ||= {} .namespaces ||= {} .default_namespace ||= "http://example.org/ns/1.0/" .resource_extension_list ||= ['.html'] .publish_future_dated ||= false .time_zone ||= "UTC" .strict ||= true app.after_configuration do # Make sure timezone is set zone_default = Time.find_zone!(.time_zone) unless zone_default raise 'Value assigned to time_zone not recognized.' end Time.zone_default = zone_default # initialize the ontology object ontology() sitemap.register_resource_list_manipulator(:ontology, ontology, false) end end |