#751: add url to file-store into the application.yml

This commit is contained in:
Vokhmin Alexey V 2012-12-05 14:56:59 +04:00
parent 4b5a45bb1a
commit d0179d03b6
3 changed files with 3 additions and 4 deletions

View File

@ -13,8 +13,7 @@
%tr
- sha1 = item['sha1']
- filename = item['file_name']
- url = 'http://file-store.rosalinux.ru/api/v1/file_stores/'
- url << sha1
- url = "#{APP_CONFIG['file_store_url']}/#{sha1}"
- url << '.log?show=true' if filename =~ /.*\.(log|txt)$/
%td= link_to filename, url
%td= sha1

View File

@ -9,7 +9,7 @@ old_sources = if File.exist? abf_yml
[]
end
#MAX_SIZE = 2 * 1024 * 1024 # 2.megabytes
url = 'http://file-store.rosalinux.ru/api/v1/file_stores.json'
url = "#{APP_CONFIG['file_store_url']}.json"
#url = 'http://localhost:3001/api/v1/file_stores.json'
rclient = RestClient::Resource.new(url, :user => ARGF.argv[0]) # user auth token

View File

@ -49,7 +49,7 @@ module AbfWorker
select{ |r| r['file_name'] !~ /.*\.log$/ }.first
sha1 = container ? container['sha1'] : nil
bl.results = options['results']
bl.container_path = "http://file-store.rosalinux.ru/api/v1/file_stores/#{sha1}" if sha1
bl.container_path = "#{APP_CONFIG['file_store_url']}/#{sha1}" if sha1
bl.save!
end
end