Sha256: f72ffce58d6d77eecb1eaf508277bad44ca37e5a7f22ae03d88cc723bd0304e1
Contents?: true
Size: 808 Bytes
Versions: 9
Compression:
Stored size: 808 Bytes
Contents
# encoding: UTF-8 require 'uri' require 'net/http' require 'pathname' require_relative 'base_middleware' module GoodData module Bricks class FsUploadMiddleware < Bricks::Middleware def initialize(options = {}) super @destination = options[:destination] end def call(params) returning(@app.call(params)) do |result| destination = @destination (params['gdc_files_to_upload'] || []).each do |f| path = f[:path] case destination.to_s when 'staging' url = GoodData.get_user_webdav_path(path) GoodData.upload_to_user_webdav(path) puts "Uploaded local file \"#{path}\" to url \"#{url + path}\"" end end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems