Method: MSpecScript#files

Defined in:
lib/extensions/mspec/mspec/utils/script.rb

#files(list) ⇒ Object

Resolves each entry in list to a set of files.

If the entry has a leading '^' character, the list of files is subtracted from the list of files accumulated to that point.

If the entry has a leading ':' character, the corresponding key is looked up in the config object and the entries in the value retrieved are processed through #entries.



206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/extensions/mspec/mspec/utils/script.rb', line 206

def files(list)
  list.inject([]) do |files, item|
    case item[0]
    when ?^
      files -= entries(item[1..-1])
    when ?:
      key = item[1..-1].to_sym
      files += files(Array(config[key]))
    else
      files += entries(item)
    end
    files
  end
end