Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix empty response of glob.

  • Loading branch information...
commit 0217b374806dc1090c295bc3b94812058235235d 1 parent b1d1cdf
@Sephi-Chan Sephi-Chan authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 impact.rb
View
7 impact.rb
@@ -21,8 +21,11 @@
end
get '/lib/weltmeister/api/glob' do
- @dir = from_impact_basedir(params[:glob])
- @files = Pathname.glob(@dir).map { |d| d.cleanpath.to_s }
+ @files = params[:glob].inject([]) do |memo, glob|
+ dir = from_impact_basedir(glob)
+ Pathname.glob(dir).each { |d| memo << d.cleanpath.to_s }
+ memo
+ end
content_type :json
@files.to_json
Please sign in to comment.
Something went wrong with that request. Please try again.