class Mech::PathLoader
Attributes
paths[RW]
Public Class Methods
new(config)
click to toggle source
# File lib/mech/path_loader.rb, line 4 def initialize(config) @paths = [] @config = config find_paths filter_paths_by_env end
Protected Instance Methods
filter_paths_by_env()
click to toggle source
# File lib/mech/path_loader.rb, line 19 def filter_paths_by_env @paths.select! do |path| path =~ Regexp.new(File.join(@config.src_path, @config.env)) end end
find_paths()
click to toggle source
# File lib/mech/path_loader.rb, line 13 def find_paths Find.find(@config.src_path) { |f| @paths.push(f) if f.match(/\.yml\Z/) } end