Class: Projects

Inherits:
Object show all
Defined in:
lib/xiki/projects.rb

Class Method Summary collapse

Class Method Details

.after_menuObject



5
6
7
# File 'lib/xiki/projects.rb', line 5

def self.after_menu
  nil
end

.before_menuObject



2
3
4
# File 'lib/xiki/projects.rb', line 2

def self.before_menu
  nil
end

.defaultObject



17
18
19
20
# File 'lib/xiki/projects.rb', line 17

def self.default
  # If parent is dir, return it, else return first project
  dir = FileTree.handles?(Xiki.trunk[-2]) ? "#{Dir.pwd}/" : self.default_project
end

.default_projectObject



22
23
24
25
26
27
# File 'lib/xiki/projects.rb', line 22

def self.default_project
  txt = File.read(File.expand_path "~/menu/projects.menu") rescue nil
  return nil if ! txt

  Line.without_label(:line=>txt[/.+/])
end


9
10
11
12
13
14
15
# File 'lib/xiki/projects.rb', line 9

def self.menu
  "
  - This will never be called, because of projects.menu...
    - Think again of ways for .menu and .rb to work together creating menus
  - api/
  "
end