Class: Dir
- Inherits:
-
Object
- Object
- Dir
- Defined in:
- lib/chef/monkey_patches/dir.rb
Class Method Summary collapse
-
.glob(pattern, flags = 0) ⇒ Object
(also: [])
Adds a Dir.glob to Ruby 1.8.5, for compat.
- .glob_ ⇒ Object
Class Method Details
.glob(pattern, flags = 0) ⇒ Object Also known as: []
Adds a Dir.glob to Ruby 1.8.5, for compat
24 25 26 27 28 29 30 31 32 |
# File 'lib/chef/monkey_patches/dir.rb', line 24 def glob(pattern, flags=0) raise ArgumentError unless ( !pattern.nil? and ( pattern.is_a? Array and !pattern.empty? ) or pattern.is_a? String ) pattern.gsub!(/\\/, "/") if RUBY_PLATFORM =~ /mswin|mingw32|windows/ [pattern].flatten.inject([]) { |r, p| r + glob_(p, flags) } end |
.glob_ ⇒ Object
22 |
# File 'lib/chef/monkey_patches/dir.rb', line 22 alias_method :glob_, :glob |