Advertisement

05.23.2008 at 08:09PM PDT, ID: 23429406
[x]
Attachment Details

Where do I run RUBY?

Asked by bpfsr in Ruby Scripting Language, Extensible Markup Language (XML)

I am reading the book Programming Amazon Web Services by James Murty. In the book he says "In this book we will demonstrate how to parse and create XML documents using the Ruby library called REXML." Then says "To demonstrate how to use this XPath in Ruby, we have saved the XML document to a file named example.xml, and we will use the REXML Ruby library to parse and query this document in an interactive Ruby session." And starts giving the following commands:

# Load the XML document text from a file
irb> xml_text = File.new('example.xml', 'r').read

# Load Ruby's XML handling library REXML
irb> require 'rexml/document'

# Parse the XML text in to a document object using REXML
irb> xml_doc = REXML::Document.new(xml_text)

# Define an XPath query string
irb> xpath = '/ListAllMyBucketsResult/Buckets/Bucket/Name'

# Perform the XPath query on the document and print the results
irb> xml_doc.elements.each(xpath) do |result|
irb>    puts result
irb> end
<Name>oreilly-aws</Name>
<Name>my-bucket</Name>

What I can't figure out is where I am running RUBY! I have RUBY 1.86.26 loaded on my computer cannot figure out where I'm entering the commands to get the thing to do the above. I wanted to program Amazon AWS, not learn RUBY! Any clue where I run this thing...???

Start Free Trial
[+][-]05.23.2008 at 08:57PM PDT, ID: 21637799

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Ruby Scripting Language, Extensible Markup Language (XML)
Sign Up Now!
Solution Provided By: blimster
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.23.2008 at 09:31PM PDT, ID: 21637857

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.24.2008 at 02:09PM PDT, ID: 21640248

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.25.2008 at 01:00AM PDT, ID: 21641788

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.25.2008 at 10:06AM PDT, ID: 21643166

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628