Skip to content

Commit

Permalink
Removed another MacRuby return-from-block workaround from mspec.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Apr 4, 2009
1 parent 64f1345 commit ad8219f
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions mspec/lib/mspec/utils/script.rb
Expand Up @@ -169,32 +169,16 @@ def entries(partial)
patterns << File.join(config[:prefix], file)
end

# patterns.each do |pattern|
# expanded = File.expand_path(pattern)
# return [pattern] if File.file?(expanded)
#
# specs = File.join(pattern, "/**/*_spec.rb")
# specs = File.expand_path(specs) rescue specs
# return Dir[specs].sort if File.directory?(expanded)
# end
#
# Dir[partial]

# MR Hack: workaround return from block problem.
res = nil
patterns.each do |pattern|
expanded = File.expand_path(pattern)
if File.file?(expanded)
res = [pattern]
elsif File.directory?(expanded)
specs = File.join(pattern, "/**/*_spec.rb")
specs = File.expand_path(specs) rescue specs
res = Dir[specs].sort
end
break if res
return [pattern] if File.file?(expanded)

specs = File.join(pattern, "/**/*_spec.rb")
specs = File.expand_path(specs) rescue specs
return Dir[specs].sort if File.directory?(expanded)
end

res || Dir[partial]
Dir[partial]
end

# Resolves each entry in +list+ to a set of files.
Expand Down

0 comments on commit ad8219f

Please sign in to comment.