Try this:
Dir.glob("#{folder}/**/*.pdf")
which is the same as
Dir["#{folder}/**/*.pdf"]
Where the folder variable is the path to the root folder you want to search through.
More Related Contents:
- How to search file text for a pattern and replace it with a given value
- How to write to file in Ruby?
- What are all the common ways to read a file in Ruby?
- What are the Ruby File.open modes and options?
- How to increase stack size for a ruby app. Recursive app getting: Stack level too deep (SystemStackError)
- Reading the last n lines of a file in Ruby?
- Read binary file as string in Ruby
- Fibonacci sequence in Ruby (recursion)
- How to write a switch statement in Ruby
- Ruby class instance variable vs. class variable
- “for” vs “each” in Ruby
- String concatenation vs. interpolation in Ruby
- Ruby’s double colon (::) operator usage differences
- When to use RSpec let()?
- How can I use Ruby to colorize the text output to a terminal? [closed]
- what’s different between each and collect method in Ruby [duplicate]
- How to create a file in Ruby
- What is the “=~” operator in Ruby?
- Ruby send JSON request
- In Ruby is there a way to overload the initialize constructor?
- Why does Ruby’s ‘gets’ includes the closing newline?
- Ruby multiline block without do end
- Error to install Nokogiri on OSX 10.9 Maverick?
- How to assign hash[‘a’][‘b’]= ‘c’ if hash[‘a’] doesn’t exist?
- Why does white-space affect ruby function calls?
- Why does “compass watch” say it cannot load sass/script/node (LoadError)?
- When to use `require`, `load` or `autoload` in Ruby?
- Natural Language Processing in Ruby [closed]
- How can I get the absolute URL when extracting links using Nokogiri?
- How to determine if a character is a Chinese character