From 37c2f141d2c0cee8755c8fc71952967a7895b975 Mon Sep 17 00:00:00 2001 From: LightGuard Date: Tue, 5 Nov 2013 09:09:24 -0700 Subject: [PATCH] Fixing the issue I created in #83 Added the new parameter at the front instead of the end. Not sure what I was thinking. --- helpers/repository.rb | 2 +- public_app.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/repository.rb b/helpers/repository.rb index 4c3befe..b7a3253 100644 --- a/helpers/repository.rb +++ b/helpers/repository.rb @@ -99,7 +99,7 @@ def clone_repo end end - def all_files(dir = '', allows = []) + def all_files(allows = [], dir = '') @logger.info "Finding all files, additional allows #{allows}" default_allows = [%r!(.ad)|(.adoc)|(.adoc)|(.jpg)|(.jpeg)|(.png)|(.gif)!] default_allows << allows.join unless allows.empty? diff --git a/public_app.rb b/public_app.rb index 68349ff..2319a2b 100644 --- a/public_app.rb +++ b/public_app.rb @@ -214,7 +214,7 @@ class PublicApp < Sinatra::Base get '/repo/:repo_name/images' do |repo_name| repo = create_repo(repo_name) - files = repo.all_files('images') + files = repo.all_files([], 'images') json_return = {} files.each do |f|