Class: Yalphabetize::YamlFinder
- Inherits:
-
Object
- Object
- Yalphabetize::YamlFinder
- Defined in:
- lib/yalphabetize/yaml_finder.rb
Constant Summary collapse
- YAML_EXTENSIONS =
%w[.yml .yaml].freeze
Instance Method Summary collapse
-
#initialize ⇒ YamlFinder
constructor
A new instance of YamlFinder.
- #paths(paths) ⇒ Object
Constructor Details
#initialize ⇒ YamlFinder
Returns a new instance of YamlFinder.
9 10 11 |
# File 'lib/yalphabetize/yaml_finder.rb', line 9 def initialize @files = [] end |
Instance Method Details
#paths(paths) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/yalphabetize/yaml_finder.rb', line 13 def paths(paths) if paths.empty? files << files_in_dir else process_paths(paths) end files.flatten.select(&method(:valid?)).map { |f| File.(f) }.uniq end |