Class: Neutron::FileList
- Inherits:
-
Array
- Object
- Array
- Neutron::FileList
- Defined in:
- lib/neutron.rb
Overview
Polyfill for Rake::FileList
Class Method Summary collapse
-
.[](filter) ⇒ Neutron::FileList
Selects all files which match given pattern/regex.
Instance Method Summary collapse
-
#ext(ext) ⇒ Object
Switches all files to given extension.
Class Method Details
.[](filter) ⇒ Neutron::FileList
Selects all files which match given pattern/regex
16 17 18 19 20 21 22 |
# File 'lib/neutron.rb', line 16 def self.[](filter) arr = Dir[filter] arr = arr.keep_if do |f| File.file? f end self.new(arr) end |
Instance Method Details
#ext(ext) ⇒ Object
Switches all files to given extension
26 27 28 29 30 |
# File 'lib/neutron.rb', line 26 def ext(ext) self.map do |f| Neutron.file_to_ext(f, ext) end end |