Class: Nydp::Kalendor::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/nydp/kalendor.rb

Instance Method Summary collapse

Instance Method Details

#base_pathObject



27
# File 'lib/nydp/kalendor.rb', line 27

def base_path ; relative_path "../lisp/" ; end

#load_rake_tasksObject



29
# File 'lib/nydp/kalendor.rb', line 29

def load_rake_tasks ; end

#loadfilesObject



31
32
33
# File 'lib/nydp/kalendor.rb', line 31

def loadfiles
  Dir.glob(relative_path '../lisp/kalendor-*.nydp').sort
end

#nameObject



21
# File 'lib/nydp/kalendor.rb', line 21

def name ; "Nydp/Kalendor plugin" ; end

#relative_path(name) ⇒ Object



23
24
25
# File 'lib/nydp/kalendor.rb', line 23

def relative_path name
  File.expand_path(File.join File.dirname(__FILE__), name)
end

#setup(ns) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/nydp/kalendor.rb', line 39

def setup ns
  ::Kalendor::Instance::Base.send :include, ::Nydp::Kalendor::KalendorInstance
  store = ns.kalendor_store = ::Kalendor::Instance::Store.new
  factory = ::Kalendor::Factory.new
  Symbol.mk("kalendor/add"            ,  ns).assign(Nydp::Kalendor::Builtin::Store::Add        .new store, factory)
  Symbol.mk("kalendor/find"           ,  ns).assign(Nydp::Kalendor::Builtin::Store::Find       .new store, factory)
  Symbol.mk("kalendor/delete"         ,  ns).assign(Nydp::Kalendor::Builtin::Store::Delete     .new store, factory)
  Symbol.mk("kalendor/names"          ,  ns).assign(Nydp::Kalendor::Builtin::Store::Names      .new store, factory)
  Symbol.mk("kalendor/list"           ,  ns).assign(Nydp::Kalendor::Builtin::Store::List       .new store, factory)
  Symbol.mk("kalendor/dates"          ,  ns).assign(Nydp::Kalendor::Builtin::Dates             .new store, factory)
  Symbol.mk("kalendor-build/named"    ,  ns).assign(Nydp::Kalendor::Builtin::Builder::Named    .new store, factory)
  Symbol.mk("kalendor-build/annual"   ,  ns).assign(Nydp::Kalendor::Builtin::Builder::Annual   .new store, factory)
  Symbol.mk("kalendor-build/union"    ,  ns).assign(Nydp::Kalendor::Builtin::Builder::Union    .new store, factory)
  Symbol.mk("kalendor-build/intersect",  ns).assign(Nydp::Kalendor::Builtin::Builder::Intersect.new store, factory)
  Symbol.mk("kalendor-build/subtract" ,  ns).assign(Nydp::Kalendor::Builtin::Builder::Subtract .new store, factory)
  Symbol.mk("kalendor-build/list"     ,  ns).assign(Nydp::Kalendor::Builtin::Builder::DateList .new store, factory)
  Symbol.mk("kalendor-build/interval" ,  ns).assign(Nydp::Kalendor::Builtin::Builder::Interval .new store, factory)
  Symbol.mk("kalendor-build/weekday"  ,  ns).assign(Nydp::Kalendor::Builtin::Builder::Weekday  .new store, factory)
  Symbol.mk("kalendor-build/month"    ,  ns).assign(Nydp::Kalendor::Builtin::Builder::Month    .new store, factory)
end

#testfilesObject



35
36
37
# File 'lib/nydp/kalendor.rb', line 35

def testfiles
  Dir.glob(relative_path '../lisp/tests/**/*.nydp')
end