Sha256: 79b486889867f947542cfb6eb69086384ff7c93b865cd791c9dab860e9265e91
Contents?: true
Size: 1.21 KB
Versions: 2
Compression:
Stored size: 1.21 KB
Contents
# encoding: UTF-8 # # Copyright (c) 2010-2015 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' require 'gooddata_datawarehouse' module GoodData module Bricks class WarehouseMiddleware < Bricks::Middleware def call(params) if params.key?('ads_client') puts "Setting up ADS connection to #{params['ads_client']['ads_id']}" raise "ADS middleware needs username either as part of ads_client spec or as a global 'GDC_USERNAME' parameter" unless params['ads_client']['username'] || params['GDC_USERNAME'] raise "ADS middleware needs password either as part of ads_client spec or as a global 'GDC_PASSWORD' parameter" unless params['ads_client']['password'] || params['GDC_PASSWORD'] ads = GoodData::Datawarehouse.new(params['ads_client']['username'] || params['GDC_USERNAME'], params['ads_client']['password'] || params['GDC_PASSWORD'], params['ads_client']['ads_id']) @app.call(params.merge('ads_client' => ads, :ads_client => ads)) else @app.call(params) end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gooddata-bricks-0.4.0 | lib/gooddata/bricks/middleware/dwh_middleware.rb |
gooddata-bricks-0.3.0 | lib/gooddata/bricks/middleware/dwh_middleware.rb |