Module: Rucy::Module
Instance Method Summary collapse
- #include_dir ⇒ Object
- #lib_dir ⇒ Object
- #load_tasks(*names) ⇒ Object
- #name ⇒ Object
- #root_dir(path = '') ⇒ Object
- #task_dir ⇒ Object
- #version ⇒ Object
Instance Method Details
#include_dir ⇒ Object
21 22 23 |
# File 'lib/rucy/module.rb', line 21 def include_dir () root_dir 'include' end |
#lib_dir ⇒ Object
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 |
#name ⇒ Object
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. "../../../#{path}", __FILE__ end |
#task_dir ⇒ Object
29 30 31 |
# File 'lib/rucy/module.rb', line 29 def task_dir () root_dir 'task' end |
#version ⇒ Object
13 14 15 |
# File 'lib/rucy/module.rb', line 13 def version () open(root_dir 'VERSION') {|f| f.readline.chomp} end |