def parse_gem(init_lib)
      # puts "Processing: #{init_lib}"
      # don't ask
      init_path = init_lib

      init_file = File.read(init_lib)
      current_file = ""

      init_file.each_line do |line|
        if line.strip =~ /^require/
          parser = RubyParser.new
          sexp = parser.parse(line)
          call = sexp[2]

          unless call == :require
            # WEIRD SHIT IS HAPPENING
            current_file += line
            next
          end

          require_type = sexp[3][1][0]
          library = sexp[3][1][1]
          #p library

          if require_type == :str && library.match(@gem_name)
            # fold in
            full_rb_path = File.join([@lib_folder, "#{library}.rb"])
            unless @require_libs.include?(full_rb_path)
              file_index = @require_libs.index(init_lib)
              insert_index = file_index
              @require_libs.insert insert_index, full_rb_path
              parse_gem(full_rb_path)
            end
          else
            current_file += "# FIXME: #require is not supported in RubyMotion\n"
            current_file += "# #{line}"
            next
          end
          # comment it out
          current_file += "# #{line}"
          next
        elsif line.strip =~ /^autoload/
          # same as require
          parser = RubyParser.new
          sexp = parser.parse(line)
          call = sexp[2]

          unless call == :autoload
            # WEIRD SHIT IS HAPPENING
            current_file += line
            next
          end

          require_type = sexp[3][2][0]
          library = sexp[3][2][1]

          full_rb_path = File.join([@lib_folder, "#{library}.rb"])
          unless @require_libs.include?(full_rb_path)
            file_index = @require_libs.index(init_lib)
            insert_index = file_index
            @require_libs.insert insert_index, full_rb_path
            parse_gem(full_rb_path)
          end
          # comment it out
          current_file += "# #{line}"
          next

        
        elsif line.strip =~ /^eval/
            # reprint as a block
            # parser = RubyParser.new
            # sexp = parser.parse(line)
            # code_str = sexp[3][1][1]
            # new_eval = "eval do\n  #{code_str}\nend\n"
            # current_file += "#{new_eval}"
            # next

            # produce a fixme

            current_file += "# FIXME: Cannot eval strings in RubyMotion. \n"
            current_file += "# Rewrite to use a block.. inbuilt hack will run \n"
            current_file += "# Change this: \n"
            current_file += "# eval %Q{ \n" 
            current_file += '# def #{c}(string = nil) ' + "\n"
            current_file += "# To this \n"
            current_file += "# eval do \n"
            current_file += "# define_method(c) do |string| \n"
            current_file += "#{line}"
            next
        elsif line.strip =~ /^binding/
            current_file += "# FIXME: binding is not supported in RubyMotion.\n"
            current_file += "#{line}"
            next
        end

        # dont intefere
        current_file += line
      end

      # replace file
      File.open(init_lib, 'w') {|f| f.write(current_file) } #unless TEST_MODE

    end
def parse_gem(init_lib)
      # puts "Processing: #{init_lib}"
      # don't ask
      init_path = init_lib

      init_file = File.read(init_lib)
      current_file = ""

      init_file.each_line do |line|
        if line.strip =~ /^require/
          parser = RubyParser.new
          sexp = parser.parse(line)
          call = sexp[2]

          unless call == :require
            # WEIRD SHIT IS HAPPENING
            current_file += line
            next
          end

          require_type = sexp[3][1][0]
          library = sexp[3][1][1]
          #p library

          if require_type == :str && library.match(@gem_name)
            # fold in
            full_rb_path = File.join([@lib_folder, "#{library}.rb"])
            unless @require_libs.include?(full_rb_path)
              file_index = @require_libs.index(init_lib)
              insert_index = file_index
              @require_libs.insert insert_index, full_rb_path
              parse_gem(full_rb_path)
            end
          else
            current_file += "# FIXME: #require is not supported in RubyMotion\n"
            current_file += "# #{line}"
            next
          end
          # comment it out
          current_file += "# #{line}"
          next
        elsif line.strip =~ /^autoload/
          # same as require
          parser = RubyParser.new
          sexp = parser.parse(line)
          call = sexp[2]

          unless call == :autoload
            # WEIRD SHIT IS HAPPENING
            current_file += line
            next
          end

          require_type = sexp[3][2][0]
          library = sexp[3][2][1]

          full_rb_path = File.join([@lib_folder, "#{library}.rb"])
          unless @require_libs.include?(full_rb_path)
            file_index = @require_libs.index(init_lib)
            insert_index = file_index
            @require_libs.insert insert_index, full_rb_path
            parse_gem(full_rb_path)
          end
          # comment it out
          current_file += "# #{line}"
          next

        
        elsif line.strip =~ /^eval/
            # reprint as a block
            # parser = RubyParser.new
            # sexp = parser.parse(line)
            # code_str = sexp[3][1][1]
            # new_eval = "eval do\n  #{code_str}\nend\n"
            # current_file += "#{new_eval}"
            # next

            # produce a fixme

            current_file += "# FIXME: Cannot eval strings in RubyMotion. \n"
            current_file += "# Rewrite to use a block.. inbuilt hack will run \n"
            current_file += "# Change this: \n"
            current_file += "# eval %Q{ \n" 
            current_file += '# def #{c}(string = nil) ' + "\n"
            current_file += "# To this \n"
            current_file += "# eval do \n"
            current_file += "# define_method(c) do |string| \n"
            current_file += "#{line}"
            next
        elsif line.strip =~ /^binding/
            current_file += "# FIXME: binding is not supported in RubyMotion.\n"
            current_file += "#{line}"
            next
        end

        # dont intefere
        current_file += line
      end

      # replace file
      File.open(init_lib, 'w') {|f| f.write(current_file) } #unless TEST_MODE

    end
def simulate!
   puts "simulator not implemented..."
 end