Sha256: e3bd519c94f0f6bab27a7ecf2180b138e711fa20c457602c5e70296dbb22aec9

Contents?: true

Size: 1.41 KB

Versions: 27

Compression:

Stored size: 1.41 KB

Contents

#lib_dir = File.expand_path("..", __FILE__)
#$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)

require "kaui/engine"

module Kaui
  mattr_accessor :killbill_finder
  mattr_accessor :account_home_path
  mattr_accessor :bundle_home_path
  mattr_accessor :invoice_home_path
  mattr_accessor :bundle_key_display_string
  mattr_accessor :creditcard_plugin_name
  mattr_accessor :default_current_user
  mattr_accessor :layout
  mattr_accessor :killbill_url

  self.killbill_finder = lambda { self.config[:killbill_url] }
  self.account_home_path = lambda {|account_id| Kaui::Engine.routes.url_helpers.account_path(account_id) }
  self.bundle_home_path = lambda {|bundle_id| Kaui::Engine.routes.url_helpers.bundle_path(:id => bundle_id) }
  self.invoice_home_path = lambda {|invoice_id| Kaui::Engine.routes.url_helpers.invoice_path(:id => invoice_id) }
  self.bundle_key_display_string =  lambda {|bundle_key| bundle_key }
  self.creditcard_plugin_name =  lambda { '__EXTERNAL_PAYMENT__' }

  def self.config(&block)
    # TODO
    {
      :default_current_user => default_current_user || 'Kaui admin user',
      :layout => layout || 'kaui/layouts/kaui_application',
      :killbill_url => killbill_url || ENV['KILLBILL_URL'] || 'http://127.0.0.1:8080'
    }
  end
end

# ruby-1.8 compatibility
module Kernel
  def define_singleton_method(*args, &block)
    class << self
      self
    end.send(:define_method, *args, &block)
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
kaui-0.6.6 lib/kaui.rb
kaui-0.6.5 lib/kaui.rb
kaui-0.6.4 lib/kaui.rb
kaui-0.6.3 lib/kaui.rb
kaui-0.6.2 lib/kaui.rb
kaui-0.6.1 lib/kaui.rb
kaui-0.6.0 lib/kaui.rb
kaui-0.5.3 lib/kaui.rb
kaui-0.5.2 lib/kaui.rb
kaui-0.5.1 lib/kaui.rb
kaui-0.5.0 lib/kaui.rb
kaui-0.4.9 lib/kaui.rb
kaui-0.4.8 lib/kaui.rb
kaui-0.4.7 lib/kaui.rb
kaui-0.4.6 lib/kaui.rb
kaui-0.4.5 lib/kaui.rb
kaui-0.4.4 lib/kaui.rb
kaui-0.4.3 lib/kaui.rb
kaui-0.4.2 lib/kaui.rb
kaui-0.4.1 lib/kaui.rb