class IncludeEngine

@author Rodrigo Botafogo

Copyright © 2018 Rodrigo Botafogo. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation, without fee and without a signed licensing agreement, is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies, modifications, and distributions.

IN NO EVENT SHALL RODRIGO BOTAFOGO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RODRIGO BOTAFOGO HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

RODRIGO BOTAFOGO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED “AS IS”. RODRIGO BOTAFOGO HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

Attributes

engine[R]

Public Class Methods

new() click to toggle source
Calls superclass method KnitrEngine::new
# File lib/gknit/include_engine.rb, line 32
def initialize

  # call super to make @base_engine available
  super
       
  @engine = Proc.new do |options|

    # check if require should be relative or not
    req = (options[['relative']].is__null | options[['relative']].isTRUE) >> 0
    
    # load the content of the file in options.code
    options.code = GalaazUtil.inline_file(options.label >> 0, req)

    @base_engine.call(options)
  end
  
  # Add the include engine function for processing the rb block
  add(include: @engine)
  
end