def save_data(res)
      if res.key?("storage")
        case res["storage"].value
        when "Ruby Hash"
          req = "rh_storage"
          storage = "RubyHashStorage"
        when "Tokyo Cabinet"
          req = "tc_storage"
          storage = "TCStorage"
          bnum = Calculate.get_bnum(res)
          bnum = 5000000 if bnum < 5000000
          xmsiz = Calculate.get_xmsize_max(res)
        when "Groonga"
          req = "groonga_storage"
          storage = "GroongaStorage"
          bnum = Calculate.get_bnum(res)
          bnum = 5000000 if bnum < 5000000
          xmsiz = Calculate.get_xmsize_max(res)
        end
      end

      if res.key?("language")
        fd = Calculate.get_fd(res)
        print "\r\nPlease set FileDescriptor bigger than #{fd}.\r\n\r\n" 
      end

      body = ""
      open(CONFIG_TEMPLATE_PATH, "r") do |f|
        body = f.read
      end

      if req
        body = ch_assign(body, "require", " ", "roma\/storage\/#{req}")
        body = ch_assign(body, "STORAGE_CLASS", "Roma::Storage::#{storage}")

        case req
        when "rh_storage"
          body = ch_assign(body, "STORAGE_OPTION","")
        when /^(tc_storage|groonga_storage)$/
          body = ch_assign(body, "STORAGE_OPTION", "bnum=#{bnum}\#xmsiz=#{xmsiz}\#opts=d#dfunit=10")
        end
      end

      if res.key?("plugin")
        body = ch_assign(body, "PLUGIN_FILES", res["plugin"].value)
      end

      open(CONFIG_OUT_PATH, "w") do |f|
        f.flock(File::LOCK_EX)
        f.puts body
        f.truncate(f.tell)
        f.flock(File::LOCK_UN)
      end

      puts "Before"
      Box.print_with_box(@defaults)

      re_require(CONFIG_OUT_PATH, Config)
      results = load_config([:STORAGE_CLASS, :STORAGE_OPTION, :PLUGIN_FILES])
      print "\r\nAfter\r\n"
      Box.print_with_box(results)
      print "\r\nMkconfig is finish.\r\n"
      print "\r\nIf you need, change directory path about LOG, RTTABLE, STORAGE, WB and other setting.\r\n\r\n"
    end
def save_data(res)
      if res.key?("storage")
        case res["storage"].value
        when "Ruby Hash"
          req = "rh_storage"
          storage = "RubyHashStorage"
        when "Tokyo Cabinet"
          req = "tc_storage"
          storage = "TCStorage"
          bnum = Calculate.get_bnum(res)
          bnum = 5000000 if bnum < 5000000
          xmsiz = Calculate.get_xmsize_max(res)
        when "Groonga"
          req = "groonga_storage"
          storage = "GroongaStorage"
          bnum = Calculate.get_bnum(res)
          bnum = 5000000 if bnum < 5000000
          xmsiz = Calculate.get_xmsize_max(res)
        end
      end

      if res.key?("language")
        fd = Calculate.get_fd(res)
        print "\r\nPlease set FileDescriptor bigger than #{fd}.\r\n\r\n" 
      end

      body = ""
      open(CONFIG_TEMPLATE_PATH, "r") do |f|
        body = f.read
      end

      if req
        body = ch_assign(body, "require", " ", "roma\/storage\/#{req}")
        body = ch_assign(body, "STORAGE_CLASS", "Roma::Storage::#{storage}")

        case req
        when "rh_storage"
          body = ch_assign(body, "STORAGE_OPTION","")
        when /^(tc_storage|groonga_storage)$/
          body = ch_assign(body, "STORAGE_OPTION", "bnum=#{bnum}\#xmsiz=#{xmsiz}\#opts=d#dfunit=10")
        end
      end

      if res.key?("plugin")
        body = ch_assign(body, "PLUGIN_FILES", res["plugin"].value)
      end

      open(CONFIG_OUT_PATH, "w") do |f|
        f.flock(File::LOCK_EX)
        f.puts body
        f.truncate(f.tell)
        f.flock(File::LOCK_UN)
      end

      puts "Before"
      Box.print_with_box(@defaults)

      re_require(CONFIG_OUT_PATH, Config)
      results = load_config([:STORAGE_CLASS, :STORAGE_OPTION, :PLUGIN_FILES])
      print "\r\nAfter\r\n"
      Box.print_with_box(results)
      print "\r\nMkconfig is finish.\r\n"
      print "\r\nIf you need, change directory path about LOG, RTTABLE, STORAGE, WB and other setting.\r\n\r\n"
    end
make config.rb based on input data