Skip to content

Commit

Permalink
less flattening
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jun 11, 2011
1 parent 1da8e31 commit 781490c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/rspec/core/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,16 @@ def reporter

def files_or_directories_to_run=(*files)
files = files.flatten
if files.empty? && default_path
files << default_path
end
files << default_path if files.empty? && default_path
self.files_to_run = get_files_to_run(files)
end

def get_files_to_run(*files)
files.flatten.collect do |file|
def get_files_to_run(files)
patterns = pattern.split(",")
files.map do |file|
if File.directory?(file)
pattern.split(",").collect do |pattern|
Dir["#{file}/#{pattern.strip}"]
patterns.map do |pattern|
Dir["#{file}/{#{pattern.strip}}"]
end
else
if file =~ /(\:(\d+))$/
Expand All @@ -322,7 +321,6 @@ def get_files_to_run(*files)
end.flatten
end


# E.g. alias_example_to :crazy_slow, :speed => 'crazy_slow' defines
# crazy_slow as an example variant that has the crazy_slow speed option
def alias_example_to(new_name, *args)
Expand Down

0 comments on commit 781490c

Please sign in to comment.