Do as below
@images = Dir.glob("my/pictures/*.{jpg,gif}")
From the documentation {p,q}
Matches literal por literal q. Equivalent to alternating patterns in a regular expression. Corresponding literals can be longer than one character. You can specify more than two literals.
source
share