lib/rust_require/rustc.rb
# creates a c-wrapper for file at @input_path
# returns info.json, parsed with JSON
creates a c-wrapper for file at @input_path
returns info.json, parsed with JSON
creates a c - wrapper for file at @input_path returns info . json parsed with JSON
def create_wrapper
      @tempfile = "#{File.dirname(@input_path)}/#{File.basename(@input_path, ".*")}_wrapper.rs"
      analyze_tempfile
      info_file = JSON.parse File.open(@info_file_path, 'r').read
      gen = CWrapperGenerator.new(info_file)
      File.open(@tempfile, "w+") do |f|
        f << <<-SRC
            #![feature(alloc)]
        SRC
        File.open(@input_path, "r") { |input| f << input.read }
        f << gen.generate_wrapper
      end
      info_file
    end
def create_wrapper @tempfile = "#{File.dirname(@input_path)}/#{File.basename(@input_path, ".*")}_wrapper.rs" analyze_tempfile info_file = JSON . parse File . open ( @info_file_path , 'r' ) . read gen = CWrapperGenerator . new ( info_file ) File . open ( @tempfile , "w+" ) do | f | f << <<-SRC 
            #![feature(alloc)]
         SRC File . open ( @input_path , "r" ) { | input | f << input . read } f << gen . generate_wrapper end info_file end
creates a c-wrapper for file at @input_path
returns info.json, parsed with JSON
creates a c - wrapper for file at @input_path returns info . json parsed with JSON
# @input_path with wrappers added # parse info.json # add necessary extern crate definitions # add the actual file content # add wrappers # return info_file for further use