lib/pluggy/compiler.rb
def compile(file, b = TOPLEVEL_BINDING)
        file = File.new(file)
        extensions = File.basename(file).split('.')[1..-1]
        valid_exts = extensions.map(&:to_sym) & compiler_names.map(&:to_sym)
        valid_exts.inject(file.read) do |content, ext|
          compiler(ext).run(content, b)
        end
      end
# Compiles file with binding b. It also assumes which compilers to use
# based on filetype.
#
# @param [String] file A valid filepath. An error will be thrown if the
#   path is not valid
# @param [Binding] b The binding in which to compile. This is passed
#   directly to {Compiler#run}
Compiles file with binding b. It also assumes which compilers to use
based on filetype.
Compiles file with binding b . It also assumes which compilers to use based on filetype .
def compile(file, b = TOPLEVEL_BINDING)
        file = File.new(file)
        extensions = File.basename(file).split('.')[1..-1]
        valid_exts = extensions.map(&:to_sym) & compiler_names.map(&:to_sym)
        valid_exts.inject(file.read) do |content, ext|
          compiler(ext).run(content, b)
        end
      end
def compile ( file , b = TOPLEVEL_BINDING ) file = File . new ( file ) extensions = File . basename ( file ) . split ( '.' ) [ 1 .. - 1 ] valid_exts = extensions . map ( & :to_sym ) & compiler_names . map ( & :to_sym ) valid_exts . inject ( file . read ) do | content , ext | compiler ( ext ) . run ( content , b ) end end
Compiles file with binding b.
Compiles file with binding b .
file
b
b The binding in which to compile. This is passed directly to {Compiler#run}
b The binding in which to compile . This is passed directly to { Compiler#run }