Sha256: d6432e411b256c4156a9e0bd55cd83f5eaae282fbb286d4169eb5cc93f278d1a

Contents?: true

Size: 863 Bytes

Versions: 58

Compression:

Stored size: 863 Bytes

Contents

module Middleman::CoreExtensions::Builder
  class << self
    def registered(app)
      app.extend ClassMethods
    end
  end
  
  module ClassMethods
    # Add a block/proc to be run after features have been setup
    def after_build(&block)
      @run_after_build ||= []
      @run_after_build << block
    end

    def after_build_callbacks
      @run_after_build ||= []
      @run_after_build
    end
    
    def build_reroute(&block)
      @build_rerouters ||= []
      @build_rerouters << block
    end
    
    def reroute_builder(desination, request_path)
      @build_rerouters ||= []
      
      result = [desination, request_path]
      
      @build_rerouters.each do |block|
        output = block.call(desination, request_path)
        if output
          result = output
          break
        end
      end
      
      result
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
middleman-2.0.16.1-x86-mingw32 lib/middleman/core_extensions/builder.rb
middleman-2.0.16.1 lib/middleman/core_extensions/builder.rb
middleman-2.0.16-x86-mingw32 lib/middleman/core_extensions/builder.rb
middleman-2.0.16 lib/middleman/core_extensions/builder.rb
middleman-2.0.15.4-x86-mingw32 lib/middleman/core_extensions/builder.rb
middleman-2.0.15.4 lib/middleman/core_extensions/builder.rb
middleman-2.0.15.3-x86-mingw32 lib/middleman/core_extensions/builder.rb
middleman-2.0.15.3 lib/middleman/core_extensions/builder.rb
middleman-2.0.15.2-x86-mingw32 lib/middleman/core_extensions/builder.rb
middleman-2.0.15.2 lib/middleman/core_extensions/builder.rb
middleman-2.0.15.1-x86-mingw32 lib/middleman/core_extensions/builder.rb
middleman-2.0.15.1 lib/middleman/core_extensions/builder.rb
middleman-2.0.15-x86-mingw32 lib/middleman/core_extensions/builder.rb
middleman-2.0.15 lib/middleman/core_extensions/builder.rb
middleman-2.0.14-x86-mingw32 lib/middleman/core_extensions/builder.rb
middleman-2.0.14 lib/middleman/core_extensions/builder.rb
middleman-2.0.14.pre2-x86-mingw32 lib/middleman/core_extensions/builder.rb
middleman-2.0.14.pre2 lib/middleman/core_extensions/builder.rb
middleman-2.0.13.2-x86-mingw32 lib/middleman/core_extensions/builder.rb
middleman-2.0.14.pre-x86-mingw32 lib/middleman/core_extensions/builder.rb