Sha256: 13340b0b60f27f1a5db9fa803bf58dc4c32a6a3ea0668d28f4b388216b667b59

Contents?: true

Size: 958 Bytes

Versions: 4

Compression:

Stored size: 958 Bytes

Contents

# Blog Editor extension
module Middleman::Fjords

  class Options
    KEYS = [
            :domain,
            :domain_file,
            :rebuild,
            # :no_zip,
            :gzip_assets,
            :cdn,
            :username,
            :password
           ]
    
    KEYS.each do |name|
      attr_accessor name
    end
    
    def initialize(options={})
      options.each do |k,v|
        self.send(:"#{k}=", v)
      end
    end
  end

  # Setup extension
  class << self

    # Once registered
    def registered(app, options_hash={}, &block)
      options = Options.new(options_hash)
      yield options if block_given?

      options.rebuild      ||= false
      options.domain       ||= nil
      options.domain_file  ||= nil
      # options.no_zip       ||= false
      options.gzip_assets  ||= false
      options.cdn          ||= false
      
      app.set :fjords_options, options
    end
    alias :included :registered
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
middleman-fjords-1.1.3 lib/middleman-fjords/extension.rb
middleman-fjords-1.1.2 lib/middleman-fjords/extension.rb
middleman-fjords-1.1.1 lib/middleman-fjords/extension.rb
middleman-fjords-1.1.0 lib/middleman-fjords/extension.rb