Module: FileSet

### Home Classes Methods

### In Files

- lib/padrino-support/file_set.rb

### Methods

- #glob
- #glob_require

### Class/Module Index

Quicksearch

- String
- String::Colorizer
- FileSet
- Module
- Object
- ObjectSpace

No matching classes.

# FileSet

FileSet helper method for iterating and interacting with files inside a directory

### Public Instance Methods

glob(glob_pattern, file_path=nil) click to toggle source

Iterates over every file in the glob pattern and yields to a block Returns the list of files matching the glob pattern FileSet.glob('padrino-core/application/*.rb', __FILE__) { |file| load file }

    # File lib/padrino-support/file_set.rb, line 11
    def glob(glob_pattern, file_path=nil)
      glob_pattern = File.join(File.dirname(file_path), glob_pattern) if file_path
      file_list = Dir.glob(glob_pattern).sort
      file_list.each{ |file| yield(file) }
      file_list
    end

glob_require(glob_pattern, file_path=nil) click to toggle source

Requires each file matched in the glob pattern into the application FileSet.glob_require('padrino-core/application/*.rb', __FILE__)

    # File lib/padrino-support/file_set.rb, line 22
    def glob_require(glob_pattern, file_path=nil)
      glob(glob_pattern, file_path) { |f| require f }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.