Skip to content

Commit

Permalink
refactoring: replased ugly method with correct matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
JanaVPetrova committed May 2, 2014
1 parent 57b9139 commit 9acbcbe
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/miss-marple/searcher.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
class MissMarple::Searcher
def self.search(paths)
files_and_dirs = paths.map{|path| Dir.glob("#{path}/**/*") }.flatten

permited_exts = %(.css .js .js.coffee .less .scss .sass)

no_dirs = files_and_dirs.reject{ |file| File.directory?(file) }
no_dirs.reject{|file| !permited_exts.include? File.extname(file) }
Dir.glob("**/*.{*css,js,coffee,[sa,sc,le]ss}")
end
end

0 comments on commit 9acbcbe

Please sign in to comment.