Module: Rucy::Module

Extended by:
Module
Included in:
Module
Defined in:
lib/rucy/module.rb

Instance Method Summary collapse

Instance Method Details

#include_dirObject



21
22
23
# File 'lib/rucy/module.rb', line 21

def include_dir ()
  root_dir 'include'
end

#lib_dirObject



25
26
27
# File 'lib/rucy/module.rb', line 25

def lib_dir ()
  root_dir 'lib'
end

#load_tasks(*names) ⇒ Object



33
34
35
36
37
38
39
40
41
42
# File 'lib/rucy/module.rb', line 33

def load_tasks (*names)
  if names.empty?
    Dir["#{task_dir}/**/*.rake"].each {|path| load path}
  else
    names.each do |name|
      path = "#{task_dir}/#{name}.rake"
      load path if File.exist? path
    end
  end
end

#nameObject



9
10
11
# File 'lib/rucy/module.rb', line 9

def name ()
  super.split('::')[-2]
end

#root_dir(path = '') ⇒ Object



17
18
19
# File 'lib/rucy/module.rb', line 17

def root_dir (path = '')
  File.expand_path "../../../#{path}", __FILE__
end

#task_dirObject



29
30
31
# File 'lib/rucy/module.rb', line 29

def task_dir ()
  root_dir 'task'
end

#versionObject



13
14
15
# File 'lib/rucy/module.rb', line 13

def version ()
  open(root_dir 'VERSION') {|f| f.readline.chomp}
end