Class: Bike::Set::Static::Folder

Inherits:
Bike::Set::Static show all
Defined in:
lib/_widget/crumb.rb,
lib/set/static_folder.rb,
lib/_widget/action_login.rb,
lib/_widget/action_signup.rb,
lib/_widget/me.rb

Overview

Author

Akira FUNAI

Copyright

Copyright © 2009-2010 Akira FUNAI

Constant Summary

Constants inherited from Field

Field::DEFAULT_META

Instance Attribute Summary

Attributes inherited from Field

#action, #result

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Bike::Set::Static

#commit, #meta_href

Methods included from Bike::Set

#collect, #each, #errors, #inspect_items, #item, #meta_base_path, #meta_path, #pending?, #val

Methods inherited from Field

#[], #[]=, #commit, #create, #default_action, #delete, #empty?, #errors, #find_ancestor, #get, h, #inspect, instance, #item, #load, #load_default, #meta_admins, #meta_client, #meta_folder, #meta_full_name, #meta_group, #meta_name, #meta_owner, #meta_owners, #meta_roles, #meta_sd, #meta_short_name, #pending?, #permit?, #post, #update, #val, #valid?, #workflow

Methods included from I18n

_, bindtextdomain, domain, domain=, find_msg, lang, lang=, merge_msg!, msg, n_, parse_msg, po_dir, po_dir=

Constructor Details

#initialize(meta = {}) ⇒ Folder

Returns a new instance of Folder.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/set/static_folder.rb', line 12

def initialize(meta = {})
  @meta = meta
  @meta.merge! load_html
  @meta.merge! load_yaml

  @meta[:tmpl].values.each {|tmpl|
    tmpl.sub!(/<head>([\s\n]*)/i) { "#{$&}<base href=\"@(href)\" />#{$1}" }
  }

  @item_object = {}
end

Class Method Details

.rootObject



8
9
10
# File 'lib/set/static_folder.rb', line 8

def self.root
  self.new(:id => '')
end

Instance Method Details

#meta_dirObject



24
25
26
# File 'lib/set/static_folder.rb', line 24

def meta_dir
  my[:parent] ? ::File.join(my[:parent][:dir], my[:id]) : my[:id]
end