Module: Flak::Template::Doc::Settings

Extended by:
MergeEngine
Defined in:
lib/flak/rake/templates/doc.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MergeEngine

flatten_yaml, flatten_yaml_file, infuse, settings_modifications

Class Method Details

.extended(target) ⇒ Object



9
10
11
# File 'lib/flak/rake/templates/doc.rb', line 9

def self.extended target
  infuse target
end

.settings_modifications(settings) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/flak/rake/templates/doc.rb', line 13

def self.settings_modifications settings

  mods = Hash.new

  bind = binding()
  Flak::Errors.assert("settings[:product_revision]", "String", bind,__FILE__)
  Flak::Errors.assert("settings[:release_root]", "String", bind,__FILE__)

  mods[:doc_directory_name] = "#{settings[:product_revision]}/doc"

  mods[:doc_destination] =  File.join(  settings[:release_root] , mods[:doc_directory_name] )

  mods
end

Instance Method Details

#doc_default_hash(item) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/flak/rake/templates/doc.rb', line 28

def doc_default_hash(item)
  bind = binding()
  Flak::Errors.assert("@settings[:product_name]", "String", bind,__FILE__)
  Flak::Errors.assert("@settings[:product_revision]", "String", bind,__FILE__)
  Flak::Errors.assert("@settings[:author_name]", "String", bind,__FILE__)
  Flak::Errors.assert("@settings[:author_email]", "String", bind,__FILE__)

  {
    :title => "#{@settings[:product_name].capitalize} #{item[:type]}", 
    :description=> "#{@settings[:product_name].capitalize} #{@settings[:product_revision]} #{item[:type]}",
    :author=> @settings[:author_name],
    :email=> @settings[:author_email],
    :created_at => Time.now.strftime("%d %B %Y")
  }
end

#doc_plug_metadata(site) ⇒ Object



45
46
47
48
49
50
51
52
53
# File 'lib/flak/rake/templates/doc.rb', line 45

def (site)
  site.items.each do |item| 
    unless item.binary?
      item[:type] =  "Index" if item.identifier == "/"
      item[:type] =  "Release Notes" if item.identifier == "/release_notes/"
      item.attributes= doc_default_hash(item).merge(item.attributes)   
    end
  end
end