In Files

Parent

Methods

Class Index [+]

Quicksearch

Module

Public Instance Methods

inline(lang = :C, options={}) click to toggle source

Extends the Module class to have an inline method. The default language/builder used is C, but can be specified with the lang parameter.

     # File lib/inline.rb, line 804
804:   def inline(lang = :C, options={})
805:     Inline.register self
806: 
807:     case options
808:     when TrueClass, FalseClass then
809:       warn "WAR\NING: 2nd argument to inline is now a hash, changing to {:testing=>#{options}}" unless options
810:       options = { :testing => options  }
811:     when Hash
812:       options[:testing] ||= false
813:     else
814:       raise ArgumentError, "BLAH"
815:     end
816: 
817:     builder_class = begin
818:                       Inline.const_get(lang)
819:                     rescue NameError
820:                       require "inline/#{lang}"
821:                       Inline.const_get(lang)
822:                     end
823: 
824:     builder = builder_class.new self
825: 
826:     yield builder
827: 
828:     unless options[:testing] then
829:       unless builder.load_cache then
830:         builder.build
831:         builder.load
832:       end
833:     end
834:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.