Sha256: 08de518d62782b2d409fabfcc21de699944be39a8e2c89eba1600c2369c3733f

Contents?: true

Size: 1.05 KB

Versions: 78

Compression:

Stored size: 1.05 KB

Contents

module Brief::Adapters
  class MiddlemanExtension < ::Middleman::Extension
    def self.activate_brief_extension
      ::Middleman::Extensions.register(:brief, Brief::Adapters::MiddlemanExtension)
    end

    def initialize(app, options_hash = {}, &block)
      super

    end

    helpers do
      def brief_config_path
        Pathname(root).join("brief.rb")
      end

      def briefs
        briefcase
      end

      def briefcase
        if !brief_config_path.exist?
          brief_config_path.open("w+") {|fh| fh.write("# See github.com/datapimp/brief for documentation")}
        end

        if development?
           Brief::Briefcase.new(root: root,
                                config_path: brief_config_path,
                                caching: false)
        else
          @briefs ||= begin
                       Brief::Briefcase.new(root: root,
                                            config_path: brief_config_path,
                                            caching: true)
                     end
        end
      end
    end

  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
brief-1.17.14 lib/brief/adapters/middleman_extension.rb
brief-1.17.13 lib/brief/adapters/middleman_extension.rb
brief-1.17.12 lib/brief/adapters/middleman_extension.rb
brief-1.17.11 lib/brief/adapters/middleman_extension.rb
brief-1.17.10 lib/brief/adapters/middleman_extension.rb
brief-1.17.9 lib/brief/adapters/middleman_extension.rb
brief-1.17.8 lib/brief/adapters/middleman_extension.rb
brief-1.17.7 lib/brief/adapters/middleman_extension.rb
brief-1.17.5 lib/brief/adapters/middleman_extension.rb
brief-1.17.4 lib/brief/adapters/middleman_extension.rb
brief-1.17.3 lib/brief/adapters/middleman_extension.rb
brief-1.17.2 lib/brief/adapters/middleman_extension.rb
brief-1.17.1 lib/brief/adapters/middleman_extension.rb
brief-1.17.0 lib/brief/adapters/middleman_extension.rb
brief-1.16.2 lib/brief/adapters/middleman_extension.rb
brief-1.16.1 lib/brief/adapters/middleman_extension.rb
brief-1.16.0 lib/brief/adapters/middleman_extension.rb
brief-1.15.5 lib/brief/adapters/middleman_extension.rb
brief-1.15.4 lib/brief/adapters/middleman_extension.rb
brief-1.15.3 lib/brief/adapters/middleman_extension.rb