0

In our Awestruct website, we have a directory like this:

/xsd
    /foo_1_0.xsd
    /foo_1_1.xsd
    /foo_1_2.xsd
    /foo_1_3.xsd
    ...
    /index.haml

That index.haml gives some information on how to use a foo*.xsd file. I'd like that index.haml also to list all xsd files, without hardcoding them. Is this possible?

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120

1 Answers1

1

Try this and it will lists all the directory content as an array:

 Dir.entries(".")
     #=> [".", "..", "file1", "file2"]

You can change the . with your directory path.

tokhi
  • 21,044
  • 23
  • 95
  • 105