Module: CampExt

Defined in:
lib/camping_ext.rb

Overview

This module is included if you use camping. Thid module and file is requires to make Equipment work with Camping.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(app) ⇒ Object

Equips global equipments. Make sure they are included before loading your apps.



68
69
70
# File 'lib/camping_ext.rb', line 68

def self.extended(app)
  ::Equipment.global_extensions.each{ |ext| ext.equip(app) }
end

Instance Method Details

#createObject

This will allow you to chain create methods. It also restores the the missing modules.

Examplanation

When calling YourApp.create, the call order is :

* YourApp.create
* Last extended module.create
* Second last extended module.create
* ...
* First extended module.create

By extending this app first, it will set a blank create method that will ensure that you don’t get a NoMethodError when calling ‘super`



47
48
49
50
51
52
53
54
55
# File 'lib/camping_ext.rb', line 47

def create
  puts "INFO: CampExt#create called" if $DBG
  unless self::Base.ancestors.include? self::Helpers
    self::Base.send  :include, self::Helpers
    self::Views.send :include, self::Controllers, self::Helpers
    self::Mab.send   :include, self::Views
  end
  super
end

#installObject

Same as for #create.

This method is intended to be used by launchers that support dynamically installing and removing applications.



62
# File 'lib/camping_ext.rb', line 62

def install; false end

#uninstallObject

See #install.



65
# File 'lib/camping_ext.rb', line 65

def uninstall; false end