Module: CartridgeHelper

Included in:
ApplicationsController, EmbCartController, LegacyBrokerController
Defined in:
app/helpers/cartridge_helper.rb

Instance Method Summary collapse

Instance Method Details

#check_cartridge_type(framework, container, cart_type) ⇒ Object



17
18
19
20
21
22
23
24
# File 'app/helpers/cartridge_helper.rb', line 17

def check_cartridge_type(framework, container, cart_type)
  carts = CartridgeCache.cartridge_names(cart_type)
  Rails.logger.debug "Available cartridges #{carts.join(', ')}"
  unless carts.include? framework
    return false
  end
  return true
end

#get_cartridges(application) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/cartridge_helper.rb', line 2

def get_cartridges(application)
  cartridges = Array.new
  cartridges.push(RestCartridge11.new("standalone", application.framework, application, get_url, nil, nolinks)) if $requested_api_version != 1.0

  application.embedded.each_key do |key|
    if $requested_api_version == 1.0
      cartridge = RestCartridge10.new("embedded", key, application, get_url, nil, nolinks)
    else
      cartridge = RestCartridge11.new("embedded", key, application, get_url, nil, nolinks)
    end
    cartridges.push(cartridge)
  end if application.embedded
  return cartridges
end