Sha256: 23c6346a7ff2ec8573dbd5cd7fa9eb9c6086f6751f645dfee630ba6cdbaadb30
Contents?: true
Size: 1.1 KB
Versions: 52
Compression:
Stored size: 1.1 KB
Contents
# encoding: UTF-8 # # Copyright (c) 2010-2017 GoodData Corporation. All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. require_relative 'base_middleware' module GoodData module Bricks class FsProjectUploadMiddleware < Bricks::Middleware def initialize(options = {}) super @destination = options[:destination] end def call(params) params = params.to_hash returning(@app.call(params)) do |_| destination = @destination (params['gdc_files_to_upload'] || []).each do |f| path = f[:path] case destination.to_sym when :staging GoodData.client.get '/gdc/account/token', dont_reauth: true url = GoodData.project_webdav_path GoodData.upload_to_project_webdav(path) GoodData.logger.info("Uploaded local file \"#{path}\" to url \"#{url + path}\"") end end end end end FsUploadMiddleware = FsProjectUploadMiddleware end end
Version data entries
52 entries across 52 versions & 1 rubygems