lib/dev_tasks.rb in dev_tasks-0.0.6 vs lib/dev_tasks.rb in dev_tasks-0.0.7
- old
+ new
@@ -1,13 +1,16 @@
require 'semver'
require 'rake'
require 'awesome_print'
+require 'rake/clean'
include Rake::DSL
require_relative './commands.rb'
require_relative './console.rb'
+CLEAN.include("*.gem")
+
class DevTasks
attr_accessor :version, :commands
def initialize
@@ -43,16 +46,16 @@
end
end
def update_tasks
dev_task_defaults=Array.new
- ["build","test","add","commit","push"].each{|task|
- if @commands.has_key? task
- define_task(task)
- dev_task_defaults << task
+ @commands.each do |key,array|
+ if(array.length > 0)
+ define_task key
+ dev_task_defaults << key
end
- }
+ end
if(!Rake::Task.task_defined?('dev_tasks_default'))
tasklist=""
dev_task_defaults.each{|t|
tasklist = tasklist + "," if tasklist.length > 0
@@ -68,7 +71,8 @@
DEV_TASKS=DevTasks.new
desc 'displays dev_task commands'
task :show_commands do
puts "DEV_TASKS.commands"
- ap DEV_TASKS.commands
+ puts " "
+ puts DEV_TASKS.commands.show
end
\ No newline at end of file