Module: Drupal

Defined in:
lib/drupal.rb,
lib/drupal/cck.rb,
lib/drupal/node.rb,
lib/drupal/user.rb,
lib/drupal/cck/fields.rb,
lib/drupal/cck/builder.rb

Defined Under Namespace

Modules: CCK Classes: Node, NodeRevision, PostHook, User

Constant Summary collapse

RepositoryName =
:drupal
Repository =
repository(Drupal::RepositoryName)

Class Method Summary collapse

Class Method Details

.commonObject



5
6
7
8
9
10
11
12
13
# File 'lib/drupal.rb', line 5

def self.common
  "
    include DataMapper::Resource
  
    def self.default_repository_name
      Drupal::RepositoryName
    end
  "
end

.generateObject



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/drupal/cck/builder.rb', line 82

def self.generate
  Drupal.class_eval do
    eval( CCK::Builder.fields.map do |field|
      CCK::ThroughField.new field
    end.join("\n") )

    eval CCK::Builder.code
    
    Drupal.hooks.each do |hook|
      hook.load
    end
  end
end

.hooksObject



28
29
30
31
# File 'lib/drupal.rb', line 28

def self.hooks
  @hooks||= []
  @hooks
end

.hooks=(hook) ⇒ Object



33
34
35
36
# File 'lib/drupal.rb', line 33

def self.hooks= hook
  hooks
  @hooks << hook
end