Top Level Namespace
Defined Under Namespace
Modules: Dev
Classes: Hash
Constant Summary
collapse
- DEV_ROOT =
Dev::Environment.dev_root
- UNITTESTS =
Array.new
Instance Method Summary
collapse
Instance Method Details
#generate_tasks(project) ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/dev/Tasks.rb', line 18
def generate_tasks(project)
task_hash = {
info: { desc: 'display information about the rakefile' },
compile: { desc: 'compile' },
test: { desc: 'run unit tests' },
commit: { desc: 'commit' },
replace: { desc: 'replace text' },
loc: { desc: 'count the lines of code' },
setup: { desc: 'setup the project environment' }
}
if project[:type]=="gem" || project[:type]=="ruby"
task_hash[:features] = { desc: 'tests cucumber features' }
end
task_hash.each do |k,v|
name=k.to_s
desc=nil
desc=v[:desc] if v.has_key?(:desc)
ruby="task :#{name} do; task_start '#{name}'; PROJECT.#{name}; end"
ruby="desc '#{desc}'; " + ruby unless desc.nil?
unless task_defined(name)
eval(ruby)
end
end
end
|
#puts_debug(msg) ⇒ Object
if DEV_DEBUG is defined, puts_debug will send message to the console
7
8
9
10
11
|
# File 'lib/dev.rb', line 7
def puts_debug msg
if(defined?(DEV_DEBUG))
puts msg
end
end
|
#task_start(task_name) ⇒ Object
6
7
8
9
|
# File 'lib/dev/Tasks.rb', line 6
def task_start(task_name)
puts " "
puts "[:#{task_name}]".foreground(:yellow).bright
end
|