How to randomly read a .rb file in ruby?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kharry
    New Member
    • Feb 2010
    • 6

    How to randomly read a .rb file in ruby?

    Hi

    I have a .rb file with entries as below:

    ADMINLOGINBUTTO N = "//input[@value='Login']"
    MARKSINGLETRACK ING = "//input[@id='undefined']"

    I need to use ADMINLOGINBUTTO N, MARKSINGLETRACK ING, etc and fetch the corresponding value like "//input[@value='Login']", etc.

    could you please guide me on this. Thanks

    Harry
  • improvcornartist
    Recognized Expert Contributor
    • May 2007
    • 303

    #2
    You could use File.read(filen ame) to read the file, then parse each line to get the info you need.

    Comment

    Working...