Sha256: e3826eaa357c96f0c105eeaadc975f212e3706994552c5ff8eef51af350c46f3

Contents?: true

Size: 714 Bytes

Versions: 3

Compression:

Stored size: 714 Bytes

Contents

module ErbAsterisk
  module Inclusion
    # Declare current config file inclusion to file_name
    # args can has :priority key (larger the number - higher the priority)
    def include_to(file_name, args = {})
      default_args!(args)
      @exports[file_name] = [] if @exports[file_name].nil?

      arr = @exports[file_name]

      if arr.index { |i| i[:file] == @current_conf_file }
        log_warn(
          "Skip #{@current_conf_file} duplicate inclusion to #{file_name}")
        return
      end

      log_debug("include_to: #{@current_conf_file}, #{file_name}, #{args}", 2)

      arr << { file: @current_conf_file, priority: args[:priority] }
      "; Included to \"#{file_name}\""
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
erb_asterisk-0.0.19 lib/erb_asterisk/inclusion.rb
erb_asterisk-0.0.18 lib/erb_asterisk/inclusion.rb
erb_asterisk-0.0.17 lib/erb_asterisk/inclusion.rb