Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3242528
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:19:33+00:00 2026-05-17T18:19:33+00:00

I need to run ant remotelly create/modify xml files for ant pass back results

  • 0

I need to

  • run ant remotelly
  • create/modify xml files for ant
  • pass back results from ant’s execution

so I thought I am going to write a web/application server in ruby. But I do not know where to start.

The computer that will run ant is Win XP SP3 and there is no web server or anything else running.

I found this code but not sure which part to modify so I does what I want. Let’s say I want to run “dir” command and send back to the browser result of that command.

require 'socket'
webserver = TCPServer.new('127.0.0.1', 7125)
while (session = webserver.accept)
   session.print "HTTP/1.1 200/OK\r\nContent-type:text/html\r\n\r\n"
   request = session.gets
   trimmedrequest = request.gsub(/GET\ \//, '').gsub(/\ HTTP.*/, '')
   filename = trimmedrequest.chomp
   if filename == ""
      filename = "index.html"
   end
   begin
      displayfile = File.open(filename, 'r')
      content = displayfile.read()
      session.print content
   rescue Errno::ENOENT
   session.print "File not found"
   end
   session.close
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:19:34+00:00Added an answer on May 17, 2026 at 6:19 pm

    Ruby includes a Web server (WEBrick) so you don’t actually need to use the code that you posted. Sinatra is designed specifically for writing very small Web applications – it lets you write a Web application in a few lines of code and automatically uses the provided Web server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to run a command (.cmd file) from Ant? Would I need
I need to run a java class (actually a test case) from ant script.
Is it possible to run testng from ant without passing a testng.xml file? I
I need to run a stored procedure from a C# application. I use the
I need to run a Linux CLI command and get its stdout output from
I need to run a RLIKE query on a database mmoved from MySQL to
The reason is long and boring, but I need to run an Ant script
I need to run java class using ant. But when i run a class
I need to run a JavaScript function onLoad(), but only do it if the
I need to run an equipment audit and to do that I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.